13

I would like to create an ISO of my AWS EC2 server so that I can use that as a development test environment on my local machine. Is this possible?

1

5 Answers 5

21

Not to ISO - that's usually used for installations, not as a format for snapshots.

You can export EC2 to VMDK, VHD or OVA formats which can be used in VirtualBox, VMWare or other VM systems. Check out Exporting an Instance as a VM Using VM Import/Export

Hope that helps :)

10

ISO is not the right format for exporting virtual machine disks. It is usually used for software installations.

You can export your EC2 server as a virtual machine disk. I would recommend using the StarWind V2V converter for this purpose.

https://www.starwindsoftware.com/starwind-v2v-converter

You have several options for using this tool. First one is connecting to your AWS EC2 instance remotely:

enter image description here

Another option is installing the tool inside the EC2 instance and selecting the P2V option. You can export the instance into a hypervisor of your choice, directly to another cloud or a local file:

enter image description here

The options include various virtual machine disk formats like VHD(X), VMDK, QCOW and IMG/RAW which is the closest one to ISO.

enter image description here

This application has a small footprint of 38MB and is completely free to use. I hope it will help you.

8

You can V2V or P2V from inside your VM to the pretty much any VM format you like.

https://www.starwindsoftware.com/starwind-v2v-converter

3

An ISO is just an image of the disk.

Amazon doesn't give you a way to make this directly, but your server's disk is just a normal EBS volume, and if you boot up another fresh EC2 instance you can attach your server's EBS volume to the fresh instance.

Once it's attached to another system, you can SSH to that system to make an image of it like any other hard drive, e.g.

ssh [email protected] "dd if=/dev/sdf bs=4M" | dd of=drive.iso bs=4M
7
  • 1
    There are probably ways to simplify this process -- I'm not terribly experienced with AWS -- but it should at least give you a starting point for how you can accomplish this. Mar 25, 2020 at 6:43
  • 1
    Great idea - I do this reattach thing routinely. One minor caveat - if you've got a linux host then the root volume will have a UUID in the filesystem. If you attach that root volume to another instance of the same distro then it gets upset. We use a lot of CentOS in production, so I use Debian instances for this kind of recovery. You can also re-do the UUID but that will interfere with booting your original instance later.
    – Criggie
    Mar 25, 2020 at 18:39
  • A ISO is generally in iso9660 format (with some extensions such as UDF, Rock Ridge, etc. to make it palatable), not a disk image.
    – Ángel
    Mar 25, 2020 at 23:12
  • Your command connects from the host being imaged to the final host where the image will sit. However, the host you want to fetch the disk from is in AWS, so it would make more sense to connect from the host that will be storing the image to the remote one, not from AWS to a local machine! Also note that copying a live system that you have mounted, the final image would probably be slightly corrupted (maybe not acceptable if there's almost nothing writing on it. Ideally, you would boot a Live system or equivalent mode which didn't mount it). Plus, you'd better use a bigger blocksize (bs)
    – Ángel
    Mar 25, 2020 at 23:17
  • 1
    @Ángel The point of connecting it to a different fresh system as a secondary EBS volume is you're not copying from a live system Mar 25, 2020 at 23:28
0

No, you cannot create an ISO of an EC2 instance.

Generally speaking, there's no way to "export" an EC2 instance so that it can be used locally.

AWS does have a VM Import/Export service, however, that won't work for EC2 instances that originated on EC2. The only way to export an EC2 instance using that service is to have imported it from a local VM in the first place.

You must log in to answer this question.

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