AWS Windows EC2 instance: daily EBS snapshot without downtime

amazon ec2amazon s3amazon-ebs

I have one "Windows Server 2008" instance on "Amazon AWS EC2" with two "EBS-volumes" attached: D:\, E:\.

I want to schedule a daily snapshot of only D:\ "EBS-volume" to "s3 bucket" so that we have daily backups available.

it is possible/safe make daily "EBS snapshot" without downtime?

My EBS is more or less 30 GB with an 5% of new/change data every daily.

I found this powershell script (AWS Tools for Windows PowerShell), it's good point to start for a daily cron?

New-EC2Snapshot MyVolumeId -Description "My Snapshot DD-MM-YYYY"

sorry for my bad english guys…

Best Answer

You can use the AWS API to create a snapshot but the without downtime part is going to be tricky if your care about file system integrity.

Note: In many cases, you might not be super concerned with file system integrity, but it's hard to decide that for you without a lot more information about your system.

From this: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSnapshot.html ...

...See this:

If you can pause any file systems on the volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending.

...And this:

To create a snapshot for EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.

You can also issue a 'Create Image' which creates an AMI (and creates a snapshot of the volume too). http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html This has the option of NoReboot:

By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.