Error when resizing LVM based KVM instance volume.

Today, I shut down a KVM instance. After confirmation it was down, i wanted to resize it's volume. So :

  • I went in "Ressources" / "Manage disks".
  • Choose the instance's Volume.
  • Entered the new size (4Gb, was 2Gb).
  • Slicked "save".

Then I got this message : "Updating virtual disk on /dev/VolGroup00/xxxx_yyyyyyyyy_net_img .." .. update failed : parted -s \/dev\/VolGroup00\/xxxx_yyyyyyyyy_net_img rm 1 failed : Error: Partition /dev/mapper/VolGroup00-txxxx_yyyyyyyyy_net_imgp1 is being used. You must unmount it before you modify it with Parted."

Checked on the host : - The volume is NOT mounted. - There is NO qemu-kvm process still running.

Problem : Cloudmin now shows "4 GB" as the Volume's size, even thoug it was NOT resized.

Questions : - How can I fix that quickly ? - Can I safely boot the KVM instance ?

Thanks a lot.

Status: 
Closed (fixed)

Comments

Sounds like something was accessing the partition on the host system - to find out what, you could use a command like :

fuser /dev/VolGroup00/xxxx_yyyyyyyyy_net_img

or :

fuser /dev/mapper/VolGroup00-txxxx_yyyyyyyyy_net_imgp1

and then kill that process. Or reboot the host system.

Once this is fixed, you can fix the inconsistency in the partition size by expanding it again to something like 4.1 GB.

Unfortunately, the fuser command gives no output. Already tried it.

I sure could reboot the system, but i'd like to avoid that...

Any other idea ?

fuser is the only way I know of to find the user of a partition, sorry..

The only other option I can suggest (other than rebooting) is looking for any unusual kvm, qemu, fdisk or parted processes on the host system that might be using the partition, and killing them.

ps aux give nothing about kvm, qemu, fdisk or parted... Strange...

Strange also that from the host (a cloudmin replica), I can open the volume with parted or fdisk...

Couldn't Cloudmin be "wrong" about the Volume being used by another process ?

That error is actually coming from the parted command, when it attempts to delete the partition ... not Cloudmin. The disk expansion is done by deleting the partition, and then re-creating it with the same start position but a larger end position.

OK. I guess there's no other choice than rebooting the host. I'll do that tomorrow and keep you in touch.

Thanks.

Rebooting the host indeed did the trick.

But I remain puzzled by that problem. It's not always possible to "just" reboot a KVM host.

If it happens again, I'll keep you in touch.

Thanks anyway.

Yeah. a reboot certainly isn't ideal.

I'm pretty sure fuser can be used to find the process using the partition, but working out which device corresponds to it is tricky.

Automatically closed -- issue fixed for 2 weeks with no activity.