1

All VMs run off an LVM pool.

I resized one of the LVM volumes to increase VMs drive copacity. Resized it with lvextend as usual. Everything is successful and lvs shows the new size.

Libvirt does not see the new size though. I try refreshing - no luck. It still shows old capacity.

Running virsh vol-info on the volume shows the old size in capacity entry and the new size in allocation entry. Why is this so? It never used to be like this. Increasing an LVM volume would propagate and be visible after a refresh.

Now, the only way to get this new size to the VM is to reboot, which is out of the question. How can I make the new size visible?

EDIT

OS: Arch Libvirt: 1.3.0 Qemu: 2.4.1

Restarting libvirt service does not help either. The volume still shows up with the old size in libvirt.

lvs

...      
  sswus00-vd0     vga  -wi-a----- 200.00g
...

virsh vol-info --pool pool sswus00-vd0

Name:           sswus00-vd0
Type:           block
Capacity:       100.00 GiB
Allocation:     200.00 GiB

So capacity is still at the old size and that is what VM gets.

EDIT2

This is really strange.

lsblk shows the old disk size for this lvm volume - 100G But lvs shows the new size - 200g

The back-end for the logical volume group is iSCSI. So I thought maybe rescanning scsi bus would help.

Neither echo "- - -" > echo "- - -" > /sys/devices/platform/host2/scsi_host/host2/scan

or iscsiadm -m node -R

make any difference

Any ideas? How would I make kernel aware of the new size? And most important why it is doing this?

  • Hmm. Good question. It shouldn't matter much; the VM should already be able to use the extra space. – Michael Hampton Feb 5 '16 at 1:50
  • VM still sees the old size. Weird. I don't know when it started happening and after which update. I will update my questing with the outputs for clarity. – r.sendecky Feb 5 '16 at 2:00
0

You can send a qemu monitor command to the VM's qemu process to cause it to recognize the new size of the block device. For example:

virsh qemu-monitor-command vmname --hmp "block_resize drive/virtio-disk0 200G"

Note that drive/virtio-disk0 refers to qemu's idea of the drive, which will vary depending on the driver in use (e.g. virtio or virtio-scsi) and which virtual drive it is in order (the 0 will change to a 1, 2, etc.). For a SCSI drive, you would have something like drive-scsi0-0-0-0 where the numbers refer to the virtual controller, bus, target and LUN as defined in the libvirt XML.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.