I've created my storage pool incorrectly. I'm using LVM and I have a volume group called vms-lvm. When I look at it in virt-manager I see that the volumes it contains are home, root and swap, so when I created the storage group in virt-manager I must have specified something incorrectly. Unfortunately I can't find a way to correct this. If I try to destroy (stop) the storage group I get an error: # virsh pool-destroy vms-lvm error: Failed to destroy pool vms-lvm error: internal error: Child process (/usr/sbin/vgchange -aln centos_hyv2) unexpected exit status 5: Logical volume centos_hyv2/swap in use. Can't deactivate volume group "centos_hyv2" with 3 open logical volume(s) Same if I try to undefine it: # virsh pool-undefine vms-lvm error: Failed to undefine pool vms-lvm error: Requested operation is not valid: storage pool 'vms-lvm' is still active Can anyone please advise how I get out of this mess? There must surely be a way of undefining this?
It says that Logical volume centos_hyv2/swap in use. Maybe centos_hyv2/swap is mounted. So I think you should umount or swapoff centos_hyv2/swap first, make sure it is not used by other process. Then try pool-destroy. ----- Original Message ----- From: "Phill Edwards" <philledwards@gmail.com> To: libvirt-users@redhat.com Sent: Wednesday, November 11, 2015 8:59:22 PM Subject: [libvirt-users] How to fix an incorrect storage pool? I've created my storage pool incorrectly. I'm using LVM and I have a volume group called vms-lvm. When I look at it in virt-manager I see that the volumes it contains are home, root and swap, so when I created the storage group in virt-manager I must have specified something incorrectly. Unfortunately I can't find a way to correct this. If I try to destroy (stop) the storage group I get an error: # virsh pool-destroy vms-lvm error: Failed to destroy pool vms-lvm error: internal error: Child process (/usr/sbin/vgchange -aln centos_hyv2) unexpected exit status 5: Logical volume centos_hyv2/swap in use. Can't deactivate volume group "centos_hyv2" with 3 open logical volume(s) Same if I try to undefine it: # virsh pool-undefine vms-lvm error: Failed to undefine pool vms-lvm error: Requested operation is not valid: storage pool 'vms-lvm' is still active Can anyone please advise how I get out of this mess? There must surely be a way of undefining this? _______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users
Phill Edwards
2015-Nov-12 04:50 UTC
Re: [libvirt-users] How to fix an incorrect storage pool?
On 12 Nov 2015 13:27, "Han Han" <hhan@redhat.com> wrote:> > It says that Logical volume centos_hyv2/swap in use. Maybecentos_hyv2/swap is mounted. So I think you should umount or> swapoff centos_hyv2/swap first, make sure it is not used by otherprocess. Then try pool-destroy.>Yes, that's the system swap. That and home and root are all in the storage pool and are, of course, all in use and I can't run the machine without them being in use. Perhaps if I rm'd the storage pool definition file? Do you think that would work or is it too dangerous?