Resize a qcow2 harddrive images

I have been dealing with disk images a lot recently, I make the hard drives on my virtual machines as small as possible because I believe its easier to extend then shrink. Since I do have lvm on my systems and use xfs this has been really easy for me.

Here is a quick excersize to resizing a qcow2 disk image.

Shutdown the guest.

virsh shutdown 

Increase the qcow2 disk. It a simple command to increase the size of the disk.
As roon I am adding 10G to a Centos Server disk.

qemu-img resize centos7_system.qcow2 +10GB

Now all you need to do is go to guest and resize partition.