The course is part of this learning path
This course explores Alibaba's Elastic Compute Service and the features it offers to manage your Alibaba instances. We'll look at the main applications of the ECS service before moving on to a couple of guided demos from the platform to show you how to use the ECS service.
Learning Objectives
- Get a foundational understanding of the main concepts of Alibaba ECS
- Learn about the different instances available in Alibaba Cloud, including their features and use cases
- Learn the capabilities and limitations of ECS storage
- Learn how to connect instances together through ECS networking, specifically through the use of VPCs
- Learn how to create an ECS instance and attach a data disk to it
Intended Audience
This course is intended for anyone looking to use Alibaba ECS to manage their Alibaba Cloud workloads, as well as anyone studying for the ACP Cloud Computing certification exam.
Prerequisites
To get the most out of this course, you should have a basic understanding of the Alibaba Cloud platform.
Okay, let's move on to ECS storage. All right, so ECS utilizes cloud disk as both its system and data disks. So ECS instances will use this cloud disk service, both for data disks and for system disks, which are used to boot up ECS instances. So the cloud disk itself is actually not a physical disk installed on the same physical server as the virtual machine. It is instead a abstraction provided by our Pangu storage service.
So the entire Alibaba cloud system runs on top of Apsara. And Apsara has a component called Pangu that is used for handling storage interactions. So the nice thing about this is that each cloud disk relies on Pangu for reliability and redundancy. So each Pangu cloud disk is actually stored three times separately on different physical servers attached to different network switches, i.e. not in the same rack, which means that any two of these physical servers can fail, and your cloud disk will still continue to work. So you get extremely high reliability this way. I believe the data durability for the cloud disk system is 11 or 12/9. So it's very, very high.
You can also flexibly mount and unmount cloud disks and move them between ECS instances. There are currently three types: ultra disk, which is a standard rotating hard drive, standard SSD, which is a solid state drive, and then enhanced SSD, which is a high performance solid state drive. So the cloud disk itself can be purchased independently of the ECS instance. They can be mounted to any ECS instance, assuming that the instance is in the same zone as the cloud disk. So that's important.
The cloud disk has to be in the same zone as the ECS instance it's attached to. It cannot cross zones, and that's for reasons of network bandwidth and latency, because again, remember, each zone within a region is its own physically independent data center, and those data centers are networked together using Alibaba cloud's private links. But because it's a network link between two physical buildings that are not near each other, there are some delay. So it's a little bit too slow to run a disk service so ECS instances and their cloud disks need to be together in the same data center, meaning they need to be in the same zone. And just like a real physical block device installed in a real server, only one ECS instance can mount a cloud disk at a time.
If you want to have another ECS instance mount the disk, you have to unmount it from instance A first, and then mount it again on instance B. And disks are built based on their type. So ultra disk, standard SSD, enhanced SSD. And also based on their capacity, which is their size in gigabytes. And just like with ECS, there are pay-as-you go at subscription billing methods available.
You can see here on the bottom of the slide, we have an example. We have a disk. We'll call him d-001. That's mounted to an instance i-001 in zone A. If you want to move this disk over to i-002, what you would have to do is from instance 001, you would unmount the disk. So you do that at the operating system levels. You would log into the instance and unmount the disk. Then from the Alibaba cloud console, you detach the disk from instance 001, attach it to instance 002, and then you'd log into instance 002. And again, from the operating system level, mount the disk. And again, that would only work if these two instances are in the same zone as the disk.
So how do you choose a type? Well, it has to do with how much performance you expect and also the cost per gigabyte that you're trying to achieve here. So ultra disk is of course the cheapest type, but it's also fairly slow compared to the other disk types. It has a maximum throughput of 140 megabytes per second, and a maximum IOPS of 5,000. In fact, newer instances such as the generation six don't even support ultra disks. So this is only something you can use with older instance classes.
Standard SSD is a lot faster. It has five times the IOP performance. So it's got 25,000 IOPS with a maximum throughput of 300 megabytes per second. And then enhanced SSD originally had just three types, but there's now a fourth type not listed here called PL0. So here you can see, we have PL1, PL2 and PL3. There is now a new type called PL0. And on our most brand new ECS instances, the gen 6 enhanced, so we call those 6E.
On the 6E instances, actually, you can't use ultra disk core standard SSD. You have to use enhanced SSD PL0, which is faster than standard SSD, but a lot cheaper than the other three enhanced SSD types. So how do you choose between those? PL0 is a good safe default if you're using one of our new gen 6 enhanced instances. PL1, PL2 and PL3 are distinguished, mostly based on their maximum IOPS and maximum throughput. So you choose whichever one meets your workload. For instance, you might use PL3 to run maybe a database or a file system like HDFS, whereas PL1 would be fine for a system disk.
One of the nice things about having cloud disks be a virtual disk service rather than an actual physical disk attached to the server that holds your VM is that you can do things like take snapshots. So an ECS snapshot is a copy of all the data on a cloud disk. And you can take a snapshot from a disk that's running and mounted on an instance anytime you want, and you can set up automatic policies to do snapshots for you.
So let's say that you want to make a complete backup of your ECS instances boot disk, the system disk, every day at 3:00 AM, and you want to keep those backups for 14 days, well, you can create a policy to do that. And then every day at 3:00 AM, a complete backup of your disk will be made and stored separately from the disk itself. And you can restore from that backup anytime you want. So that's great for routine backup. It's also great for creating new instances.
So if you spend time to set up an ECS instance the way you want, and then you want to clone or copy that instance, you can use one of these disk snapshots to do that. Disk snapshots are also a great way to clone the data on a disk. So if you're trying to do testing or development, and you want to poke around on the disk without affecting a running system, you can take a snapshot and then mount that snapshot to another ECS instance in your test environment and do all of your checking and probing and analysis over there without affecting your live system.
Again, disk snapshots, there's two kinds. There's manual snapshots, and then there's automatic snapshots. Manual snapshots, you can make yourself from the console anytime. Automatic snapshots, you have to define a snapshot policy. And then that policy will determine when snapshots are made and how long they are retained for. You can have up to 100 automatic snapshot policies in a given region. And of course, more than one ECS instance can use the same policy. It's generally a good idea by the way, to avoid making snapshots during the peak use time for your instance, because there is a performance hit, especially when you make your first snapshot, which has to clone the entire disk.
Okay, in terms of limitations, you can create up to 256 manual snapshots per disk, and up to 1000 automatic snapshots per disk. And snapshot fees are charged based on how long you keep the snapshot and how much space it takes up. But I should say the fees for snapshots are much, much lower than the fees for cloud disks themselves. So you can safely keep quite a lot of snapshots without incurring too much expense. But still, when you create an automatic snapshot policy, it's a good idea to include in the policy rule about when to delete old snapshots.
The snapshots are made using an incremental mechanisms. So after you make your first snapshot, when you next create a snapshot, when you create your second snapshot, only changes between your first snapshot and the cloud disk are going to be capped. So if you have a 100 gigabyte cloud disk, your first snapshot is going to take up 100 gigabytes. It will be a copy of everything on the disk. But let's say maybe a day goes by and of those 100 gigabytes on your cloud disk, only about two gigabytes worth of data has actually changed. Well, great.
When you go to do your second snapshot, only those two gigabytes that are different from your first snapshot will be stored. So the second snapshot will happen faster, and it will take up less space, and it will cost less because it only records changes between the previous snapshot and the current state of your disk. And the changes, the increments between snapshots, Alibaba cloud snapshot service takes care of recording those for you. So you can delete any snapshot in the chain and restore from any snapshot in the chain without worrying about missing any data.
The relationship between the snapshots themselves and between your cloud disk is all recorded and managed automatically by our system. You can also turn snapshots into what we call a disk image. A disk image is just a special snapshot that you can boot from. So it's a snapshot you can use to start your instance. So let's say that you have installed Apache and MySQL, and maybe a Vanilla WordPress theme on an ECS instance, on the system disk along with the operating system, well, what you can do is you can take a snapshot of that disk. You can then, from the console, convert that disk into what we call an image. And the next time you go to the Buy page for ECS, or the next time you create an ECS from the console, you'll have the option to select what we call a user-defined image or custom image. And in that custom image list will be this image you created that has Ubuntu Plus WordPress on it. And then you can just boot a new ECS instance directly from that.
You can also take those custom images and share them with other users. So if you have multiple Alibaba cloud accounts, you can share an image from one account to another. And this isn't just limited to you. Our partners and marketplace builders can also use this image feature. So when you go in the Alibaba cloud marketplace, the software you see there is available in the form of a disk image. So when you buy third-party software from our cloud marketplace, it's in the form of a disk image. And of course you, yourself, if you register, can become a marketplace vendor, and you can take your custom images and sell them in the Alibaba cloud marketplace. Of course, you don't have to do any of that. When you use ECS for the first time, you can use what we call public images or system images. These are just disk images that we prepare ourselves.
So these come from Alibaba cloud, and this includes multiple versions of Linux and Windows, and even FreeBSD. So you have a lot of choice when you're starting out for what you want your base image to be because we provide a set of public images. But keep in mind that if you need it, you can create a disk snapshot yourself and turn it into a bootable disk image that you can use to create new ECS instances. The obvious benefit of creating a disk image is that after you purchase an ECS instance, you can do all the configuration you want to get your application up and running. And then you can, in the future, make clones of that instance that you've already set up correctly, and you'll avoid doing all that manual work to install software packages again. Same thing for the marketplace. The images in the Alibaba cloud marketplace are already pre-configured and ready to use. So if you need something like WordPress or Fortinet firewall already pre-installed, you can get that from our marketplace in the form of a disk image.
Alibaba Cloud, founded in 2009, is a global leader in cloud computing and artificial intelligence, providing services to thousands of enterprises, developers, and governments organizations in more than 200 countries and regions. Committed to the success of its customers, Alibaba Cloud provides reliable and secure cloud computing and data processing capabilities as a part of its online solutions.