2

I have a Windows VHD image created in Hyper-V, and I want it to exist as a S3-backed instance on EC2. I've found several articles (and a tutorial) on how to import my virtual machine to EC2. However, I can't find any instructions on how to use the imported VM to create a S3-backed instance.

The end result I'm looking for is that I have my Windows VHD image as an EC2 instance, whose root device type is 'instance store', not EBS.

Can anyone point me to instructions on how to accomplish this? I am new to Amazon EC2.

4
  • 1
    Why in the world would you prefer instance storage over EBS? You do realize that if the instance is terminated, the contents of instance storage are lost? There certainly are scenarios where this is OK, particularly if you're firing up multiple instances on demand to do a job: in these cases, their value is in their external output and you don't care about preserving their internal state. These are not generally considered to be "newbie" scenarios.
    – Skyhawk
    Apr 19, 2012 at 1:39
  • The 'doing a job' scenario is exactly what I'm interested in. We're using TeamCity (for continuous integration) and when a TeamCity job ends, the EBS instance keeps running even though it's no longer needed, thus costing us lots of money. Hence the desire to use instance storage.
    – Craig
    Apr 19, 2012 at 2:48
  • You can simply stop the instance, and maintain the data. Storing data on EBS is STUPID CHEAP. (10GB is $10/mo).
    – JohnThePro
    Apr 19, 2012 at 21:42
  • It's not that simple, unfortunately. We have lots of people using TeamCity who don't need to know the intricacies of AWS. We are looking into writing some script that could do it for us, but we'd prefer a way to get AWS to do this automatically.
    – Craig
    Apr 20, 2012 at 3:45

2 Answers 2

4

According to Amazon's documentation, you cannot build an instance store backed Windows AMI from scratch. You must build it up from an Amazon AMI. This is different from the options for creating Linux AMIs.

Reference: Bundling Amazon EC2 instance store-backed Windows AMIs

2
  • I appreciate your reply and it seems that you're right. I'd vote your answer up but I don't have enough rep yet.
    – Craig
    Apr 20, 2012 at 3:48
  • I now have enough rep so I've upvoted your answer - thanks again.
    – Craig
    Apr 20, 2012 at 6:24
5

So far as I know there is no way to do this from the GUI, so you'll have to use the command-line. There is a command that will do what you wish, ec2-import-instance.

Creates a new import instance task using metadata from the specified disk image, and imports the image to Amazon EC2.

Once you have the CLI tools up to the point where they actually work, you can get away with a command like:

ec2-import-instance M:\VHD\YourServer-disk1.vhd -f VHD -b AWSBuckkit -o [bucket onner access ID] -w [bucket owner secret key]

Amazon does have a page describing the ways to import foreign virtual machines to their format:

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.html

I expect the "Exporting from Microsoft Hyper-V" is most relevant to you.

As for setting up the CLI in the first place, they have a guide for that too. The tools do require Java and GPG to work, and unfortunately kind of assume a Linux host. They do have Windows versions of the tools though.

5
  • I appreciate the link and I'm already half way done with importing my VHD to EC2 using ec2-import-instance. However, my question remains: what do I do next? When the import is done, will I automatically get a new EC2 instance whose root device type is 'instance store'? The page you pointed to explains how to import volumes into EBS but mentions nothing about S3.
    – Craig
    Apr 19, 2012 at 2:51
  • The import finished but the instance that EC2 created has a root device type of EBS, not instance-store. Is there some flag on ec2-import-instance that will control the root device type?
    – Craig
    Apr 19, 2012 at 3:38
  • @Craig What I would do here would be to use that EBS to create an AMI, not an instance. You can then use ec2-create-image to spin up new instances, and ec2-terminate-instances on it when your job is done.
    – sysadmin1138
    Apr 19, 2012 at 11:17
  • I think JohnThePro made a similar suggestion and I suspect this may be the only option to get the behavior we need. I'd vote your answer up, since I think it is relevant, but I don't have enough rep yet.
    – Craig
    Apr 20, 2012 at 3:47
  • I now have enough rep so I've upvoted your answer - thanks again.
    – Craig
    Apr 20, 2012 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .