- Here are the requirements for converting a PV instance to HVM.
- A PV based instance, HVM instance (needs to be created) and a conversion instance (needs to be created).
- Snapshots of the EBS volume(s) of the instance to be converted.
- You'll need to snapshot the volume of the existing PV instance. Ideally the snapshot is taken with the instance in a stopped state.
You may also have an instance store volume. During a stop action any data on the instance store will be lost.
Next create an HVM instance, using as close as possible your current OS, (i.e., make sure the kernel versions match).
2.A. Create the HVM instance in the same Availability Zone (AZ) as your PV instance (eu-west-1b) and with the same size EBS volume 15GB.
2.B. Once it has started and is running you can stop it. Tag the Volume with something like OS-HVM and detach it from the HVM instance.
Start a conversion instance wait for it to fully start. (It is important that the instance is fully started before attaching the other volumes.)
3.A. SSH into the conversion instance.
3.B. Attach the HVM volume to the conversion instance as /dev/xvdf. For example:
The following 3.C, 3.D and 3.E steps may not be needed on all Linux versions, however it is recommended.
With the snapshot of the Volume from your PV instance you'll want to Create Volume in the EC2 console. Keep the current volume size and create it in the same AZ (eu-west-1b). Find the new EBS volume and tag it OS-PV.
4.A. Attach it to the conversion instance as /dev/xvdg
Change the boot directory to be HVM based.
5.A. Remove the PV boot directory and replace it with the HVM boot directory.
- Verify there are now all the needed directories and files on the HVM volume with.
- You can now unmount the hvm volume.
Find the OS-HVM volume and detach it from the conversion instance.
8.A. Attach it back to the HVM instance as device /dev/xvda
8.B. Start the HVM instance.
Clean up the conversion instance and any unwanted or left over volumes/snapshots.