filmov
tv
How to Backup an EC2 Instance on AWS

Показать описание
In this video you will learn how to backup and restore an entire EC2 instance, including all EBS volumes, at once. I will walk you step by step through the process of creating an Amazon Machine Image (AMI) with all attached disk drives.
TIMESTAMPS:
0:00 - Why EBS volume snapshots aren't enough
0:38 - The difference between a snapshot and an AMI
1:04 - How to create an Amazon Machine Image (AMI) from an existing EC2 instance
2:42 - How to create a new EC2 instance from an existing Amazon Machine Image (AMI)
VIDEO TRANSCRIPT:
Today I'm going to show you how to backup and restore an EC2 instance, including all its attached hard drives, also known as EBS volumes, in two simple steps.
One way to create backups is by making individual snapshots of the underlying EBS volumes. However, these snapshots then are just a backups of these individual volumes. It contains all the data stored on that volume at the time it was created, but to really restore the instance you would have to go through a number of steps. You would have to recreate the instance, restore all its volumes, and re-attach all these volumes to the instance.
On the other hand, by creating an AMI - an Amazon Machine Image -, you can backup and restore the entire EC2 instance, including attached volumes and their block device mappings at the time of the backup. If you want to quickly create a fresh instance to maybe restore a failed one or duplicate an existing one, then AMIs are the quickest and simplest way and it can be done in two easy steps:
Step 1: Create an AMI from the existing instance
Step 2: Launch a new instance from the AMI
Let's have a look at this web server. To see it's EBS volumes, I will click on the "Storage" tab. If we scroll down a bit, we can see it has an unencrypted root volume and an encrypted data volume.
Now let's start with step 1: Create an AMI from the existing instance. To create an AMI, lets click on "Actions" → "Image and templates" → "Create image"
To give the image a name, we can call it "Web Server Backup". The "No reboot" option is deselected by default. This means that, for the image to be created, the instance will be shut down and rebooted. Activate no reboot to avoid having your instance shut down, but remember that in this case, there might be data in memory that won't be flushed to disk before the snapshots are taken.
Next, we see both volumes that are currently attached. For the backup, we can change some attributes, depending on if it's a root or data volume. I'll just leave everything as it is, scroll down, and click on "Create image". Now we get a success message with the AMI ID. We can click on the ID or go to the menu and click on "AMIs" to see all our images. You can see, the image creation is in process and after a minute or so, the status turns to "available".
Let's have a quick look at our EBS snapshots. If we click on "Snapshots" in the menu, we can see two snapshots that have automatically been created.
We could now use any of these snapshots to create a new EBS volume, but to restore the entire server with all its disks at once, lets' go back to our AMIs and start with step 2: Launch a new instance from the AMI.
With our new AMI selected, we can now click on "Actions" → "Launch". This will guide us through the launch wizard, where we select an instance type, configure the details - I'll leave everything as it is - and go to the storage page. Here you can see, that it has added both the root and the data volume and will use the snapshots that are associated with the image. Let's click on "Next: Add Tags" and directly move on to the security group. Right here I want to use the existing security group for the web server, which allows inbound web requests.
Now we can click on "Review and Launch". We can ignore the warning because in this simple demo we don't need SSH access, by clicking on "Continue", and if everything is set and done, click on "Launch". For this demo I don't need the key pair and simply click on "Launch Instances".
Now we can navigate back to our instances and you can see that the new web server is in the process of booting up. It has its own IP addresses, but apart from that, it is in exactly the same state as our original web server when we created the backup. Let's give it a name - "Web Server" - and now we have our original server and a virtually identical twin, created from the backup.
And this is how you backup and restore an EC2 instance, including all its EBS volumes, in just two simple steps.
If you like this video, please give it a thumbs up.
Thanks for watching, I will see you next time.
#AWS #In5MinutesOrLess #Tutorial
TIMESTAMPS:
0:00 - Why EBS volume snapshots aren't enough
0:38 - The difference between a snapshot and an AMI
1:04 - How to create an Amazon Machine Image (AMI) from an existing EC2 instance
2:42 - How to create a new EC2 instance from an existing Amazon Machine Image (AMI)
VIDEO TRANSCRIPT:
Today I'm going to show you how to backup and restore an EC2 instance, including all its attached hard drives, also known as EBS volumes, in two simple steps.
One way to create backups is by making individual snapshots of the underlying EBS volumes. However, these snapshots then are just a backups of these individual volumes. It contains all the data stored on that volume at the time it was created, but to really restore the instance you would have to go through a number of steps. You would have to recreate the instance, restore all its volumes, and re-attach all these volumes to the instance.
On the other hand, by creating an AMI - an Amazon Machine Image -, you can backup and restore the entire EC2 instance, including attached volumes and their block device mappings at the time of the backup. If you want to quickly create a fresh instance to maybe restore a failed one or duplicate an existing one, then AMIs are the quickest and simplest way and it can be done in two easy steps:
Step 1: Create an AMI from the existing instance
Step 2: Launch a new instance from the AMI
Let's have a look at this web server. To see it's EBS volumes, I will click on the "Storage" tab. If we scroll down a bit, we can see it has an unencrypted root volume and an encrypted data volume.
Now let's start with step 1: Create an AMI from the existing instance. To create an AMI, lets click on "Actions" → "Image and templates" → "Create image"
To give the image a name, we can call it "Web Server Backup". The "No reboot" option is deselected by default. This means that, for the image to be created, the instance will be shut down and rebooted. Activate no reboot to avoid having your instance shut down, but remember that in this case, there might be data in memory that won't be flushed to disk before the snapshots are taken.
Next, we see both volumes that are currently attached. For the backup, we can change some attributes, depending on if it's a root or data volume. I'll just leave everything as it is, scroll down, and click on "Create image". Now we get a success message with the AMI ID. We can click on the ID or go to the menu and click on "AMIs" to see all our images. You can see, the image creation is in process and after a minute or so, the status turns to "available".
Let's have a quick look at our EBS snapshots. If we click on "Snapshots" in the menu, we can see two snapshots that have automatically been created.
We could now use any of these snapshots to create a new EBS volume, but to restore the entire server with all its disks at once, lets' go back to our AMIs and start with step 2: Launch a new instance from the AMI.
With our new AMI selected, we can now click on "Actions" → "Launch". This will guide us through the launch wizard, where we select an instance type, configure the details - I'll leave everything as it is - and go to the storage page. Here you can see, that it has added both the root and the data volume and will use the snapshots that are associated with the image. Let's click on "Next: Add Tags" and directly move on to the security group. Right here I want to use the existing security group for the web server, which allows inbound web requests.
Now we can click on "Review and Launch". We can ignore the warning because in this simple demo we don't need SSH access, by clicking on "Continue", and if everything is set and done, click on "Launch". For this demo I don't need the key pair and simply click on "Launch Instances".
Now we can navigate back to our instances and you can see that the new web server is in the process of booting up. It has its own IP addresses, but apart from that, it is in exactly the same state as our original web server when we created the backup. Let's give it a name - "Web Server" - and now we have our original server and a virtually identical twin, created from the backup.
And this is how you backup and restore an EC2 instance, including all its EBS volumes, in just two simple steps.
If you like this video, please give it a thumbs up.
Thanks for watching, I will see you next time.
#AWS #In5MinutesOrLess #Tutorial
Комментарии