1

I have a machine instance and attached volume that I would like to clone, but apply new network settings to it.

What is the best process for doing this, which will leave the original instance unchanged?

Can I take a snapshot of a running instance, and use that snapshot to instantiate a new instance of the same type, but with a different network address? How do I go about doing that, if so?

EDIT:

From looking at the EC2 console, the snapshot functionality clones a volume (by volume ID), not an instance (by instance ID). Is there a way to create a new volume made from a snapshot of an existing volume and attach it to a new machine instance that has different network settings assigned to it, without detaching/reattaching volumes and manually cp/scp-ing thousands of files?

I am basically looking for a way to duplicate an existing machine instance and the full contents of its attached EBS volume, with the only difference being new network settings. (If I'm using the wrong terminology for describing what I am trying to do, please let me know!)

Alex Reynolds
  • 453
  • 2
  • 9
  • 22

3 Answers3

2

You should be able to 'clone' an EC2 server by taking an image of it.

You can select the no reboot option during testing, but if it works, best practice is to have a reboot to ensure no filesystem issues.

Once you have the image taken, you can check your AMI via the console and deploy a new cloned server using that AMI.

Jared
  • 21
  • 1
  • This is correct. And, unless one has inproperly twiddled the network configuration in the existing instance, the correct network settings will be applied to the new instance and it will "just work." The network uses DHCP. – Michael - sqlbot Oct 18 '18 at 11:59
0

The best option is to create an AMI if your instance then launch more instances from that AMI.

Tim
  • 31,888
  • 7
  • 52
  • 78
  • I'm afraid the first option isn't correct: *The **Launch More Like This** wizard option does not clone your selected instance; [...]. To create a copy of your instance, first create an AMI from it, then launch more instances from the AMI.* (quoting from the link you posted). – MLu Oct 18 '18 at 08:06
  • The "launch more like this" option appears to make a new instance but does not clone the volume. It also does not create a new EBS volume of the same size as the root volume attached to the parent instance, which requires an involved unmount/extend/reformat process to resize and fix. – Alex Reynolds Oct 18 '18 at 08:17
  • Thanks, I've removed the first option and left the AMI method there. – Tim Oct 18 '18 at 18:17
0

After you clone the instance via snapshot, create new volume with settings you want and attach it to the new instance. Then use something like scp or rsync to copy old content to the new volume.

ivanderz
  • 26
  • 2