How to resize the KVM Virtual Machine Disk

In this post I’ll show you the steps for resizing the virtual disk without creating a copy or clone of it. Before starting this procedure, I would suggest you backing up any important data on the virtual machine.

Login to the KVM Machine and verify the current hard drive size:

1

Power off the KVM Machine:

2

Login to the KVM Host and dump the xml of the desired machine for which you want to resize the disk:

virsh dumpxml win7

3Note: where win7 is the machine name for which I want to resize the disk.

From the disk part get this information:

  1. Disk image name
  2. VOL-Pool on which the disk image reside

4

In this case:

  1. win7.img is the disk image name.
  2. It resides on the default volume Pool,which is locate at /var/lib/libvirt/images.

Run the following command to get the volume pool information:

virsh vol-list --pool default

4a

Run the following command to resize the disk:

virsh vol-resize win7.img 25G --pool default

5

Please note, where win7.img is the hard drive that we want to extend from 20GB to 25GB and it reside on default pool.

Power on the machine:

virsh start win7

6

Verify the hard drive size:

7

Now we need to extend the disk size through Disk Management :

8

Right-click on the drive which is required to be extended and select the Extend Volume:

9

Use the space bar to select the drive we requires to extend the volume:

10

Verify the hard drive size after extending the volume:

11

Enjoy :-)

Hope this will help you!

Please Remember me in your prayers!

 

One response to “How to resize the KVM Virtual Machine Disk

  1. Pingback: Virsh tools per gestire le macchine virtuali in KVM | maurizio siagri

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: