Daily Archives: May 23, 2013

A better way to change the size of your instance on Amazon EC2. #geekish

Let’s say you have a micro instance on Amazon and you want to make it bigger, either because it is too slow or you don’t have enough memory. You want to change it from a micro instance to a small instance.

One way to do this is to stop the instance and then right click on it and select the action: change instance type. If you see the new size you want, you can select it and then start the server.

However, that won’t work for all instance types. (For example, if you want to go from an m1.medium to an m1.large). In those cases, try the following approach. First, create the small instance. Make sure it is in the same zone as the micro instance. Indeed, try to keep as much the same as possible, including using the same AMI ID, security groups, key pair names, etc.

Second, once it is up and available, write down the instance and the instance ID and the volume IDs of all the volumes attached to the old (micro) instance and the new (small) instance. Also note how each volume is attached to the instance.
Third, stop both instances
Fourth, detach all the volumes from the small and the micro instance.
Fifth, attach the micro volumes to the small instance and the small volumes to the micro instance. In effect, you are swapping the volumes of two instances. Make sure you attach them properly.
Sixth, start the small instance and the login to the instance to make sure all the volume are attached properly and operational. Start up any processes or software you need on the new small instance and make sure it is working properly.
Seventh, if things are not working, stop the instance and swap the volumes back. If things are working, after a period of time, you can delete the old instance. Make sure the volume associated with it is gone too.

Finally, the other way to do this is create a small instance and then set it up the way you did the micro instance.

Advertisements