Your resources in AWS can fail at any time be it because of public disaster or manual mistake by your team. So AWS suggests you create snapshots of your resources frequently, so you can backup your resources on time. In this tutorial, we will see how to create a snapshot of the Windows server instance with Amazon Lightsail? Let’s start!
So before we move forward on creating the snapshot, let’s understand first that what is a Snapshot and why it is important?
What is a Snapshot?
A snapshot can be considered as a copy of the system disk and including the original configuration of an instance. A snapshot contains all the data that is required to restore your resource or instance such as CPU, disk size, memory, and data transfer rate.
In the AWS Lightsail, you can create a snapshot of databases, instances and block storage disk. This snapshot can be used as a disk to restore all of your data in case of any mishappening.
So why creating a Snapshot is important? Because of your own security. What if you lose your data due to any attack on your server or any human error of your team? The snapshot will help you then by recovering all the data for you. Thus creating a snapshot frequently is important.
What are the types of Snapshots in Lightsail?
There are many three types of Snapshots available in AWS and they are as following:
- Manual Snapshots: Manual snapshots are created and updated by the users frequently and they remain in your server until you delete them.
- System Disk Snapshots: In case if you need to access the files on the system disk and your instance becomes unresponsive, you can create a backup of the instance root volume by creating a snapshot of it. Later, your files in the system disk will be accessible by creating a new block storage disk from the snapshot and attaching it to another instance.
- Automatic Snapshots: If you are hosting critical information on your Lightsail server then you must take snapshots of your instances but sometimes it is not easy to find time to snapshot these instances frequently. So you can also allow automatic snapshots.
In this tutorial first, we will create a snapshot before running the System Preparation(Sysprep), then we will attach this to the instance, and then again will take a snapshot after running the System Preparation(Sysprep).
Create a backup snapshot before running System Preparation (Sysprep)
When we create a snapshot after running the Sysprep, there is some system-specific information that is removed from the snapshot, and to avoid that we will take a snapshot before running Sysprep.
- Login to your AWS Console and Open Lightsail.
- On the AWS Lightsail homepage, click the name of the instance for which you want to create the snapshot.
- Now first stop the instance to take a before Sysprep snapshot. (There will be a stop button at the top)
4. Now click on Snapshots and under the Manual Snapshot tab click on Create Snapshot. Enter the name of your snapshot and click on Create. This will take some time to create a snapshot and after the successful completion, start your instance again from the top of the page.
Connect to your instance and shut down it again using System Preparation (Sysprep)
- From the instance management page, click on the Connect tab, then choose RDP.
- From the open windows’ homepage, open the Start menu. Here on Windows Server 2019 and Windows Server 2016 instances, choose Start, then choose Ec2LaunchSettings.
- For the Administrator Password section, choose Random (Retrieve from console), then choose Shutdown with Sysprep. Then click on ok and move forward with it. After few minutes your instance will shut down.
Create a snapshot after running System Preparation(Sysprep)
- Go back to Lightsail Console and click on the Snapshots tab from the instance management page of your windows instance.
- Enter the name of your snapshot and click on Create. After few minutes, your instance will be created.
- Now start your instance again and you will notice that you have two snapshots available.
Congratulations! You have successfully created a snapshot of the Windows Server instance in Amazon Lightsail.