Resizing a KVM virtual machine image
Recently I was in need to resize one of our KVM images. A quick search on Google showed that the task is simpler than I thought:
- Shut down the virtual machine
- Create a backup of the virtual machine (e.g. sudo cp my_vm.img my_vm.img.bak)
- Run sudo qemu-img resize my_vm.img +10GB to increase the size by 10GB
- Fire up the virtual machine and use your favourite tool to re-partition the harddisk of your virtual machine.