Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a windows instance from snapshot in AWS

My company want to take daily snapshots of a windows in Amazon Web Service. We can take snapshot without any issue but when I try to create instance from snapshot, it always creates a linux ami. so when the server starts, it always fails the health check.

Is it possible to create a windows instance from a snapshot?

like image 218
Charlie Wu Avatar asked Nov 19 '12 04:11

Charlie Wu


1 Answers

[Please note that I'm assuming you are using EBS-Backed EC2 instances; if not, please check Eric Hammond's explanation why You Should Use EBS Boot Instances on Amazon EC2.]

It sounds like there might be a misunderstanding regarding the related AWS concepts:

While Amazon EBS snapshots are indeed utilized for the creation of an Amazon Machine Images (AMI) under the hood, you do not explicitly interact with them for the use case at hand. Specifically, you don't want to use CreateSnapshot, which only Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3, rather you want to simply create such an AMI via the dedicated action CreateImage, which Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped [emphasis mine]:

  • This process is outlined in Creating Amazon EBS-Backed AMIs (while this section addresses creating a 'new' AMI, the process is identical to your backup scenario).
  • Please note that CreateImage automatically takes care of additional EBS volumes attached to your instance as well, if any:
    • If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.

Once you have an image (AMI) generated like so in place, creating your Amazon EC2 instance from that AMI should work out as desired, be it a Windows or Unix one.

like image 188
Steffen Opel Avatar answered Oct 17 '22 15:10

Steffen Opel