Hi Daniel,

my Virtual machines are running, so how I can stop the volumes?

Br.

Umar


On Thu, Dec 19, 2013 at 9:21 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Thu, Dec 19, 2013 at 01:54:19AM +0500, Umar Draz wrote:
> Hi I am trying to stop the storage pool through php-libvirt api which is a
> LVM volume group.
>
> when I tried to stop it I got error
>
> error: internal error Child process (/sbin/vgchange -aln mylvmgrp)
> unexpected exit status 5:   Can't deactivate volume group "mylvmgrp" with 4
> open logical volume(s)
>
> Then I tried throggh virsh command but the result remain same.
>
> *root@kvm02:~# virsh pool-destroy vms*
> error: Failed to destroy pool vms
> error: internal error Child process (/sbin/vgchange -aln mylvmgrp)
> unexpected exit status 5:   Can't deactivate volume group "mylvmgrp" with 4
> open logical volume(s)

This indicates some process(s) are still using the logical volumes
so it is preventingn you breaking those apps. This is expected
behaviour.

>
> The same error also occured if I use direct vgchange -aln on my kvm host,
> but then I tried
>
>
> *vgchange -aly mylvmgrp*
>
> this time its worked

That is a totally different operation -aly *activates* volumes which
is the exact opposite of what 'pool-destroy' needs, which is to
de-activate the volumes

>
>   14 logical volume(s) in volume group "mylvmgrp" now active
>
> 1) Now would you please help me? is this libvirt issue? or LVM?
> 2) Is this possible virsh pool-destroy pool also run the vgchange -aly
> instead of -aln

AFAICT, there's no bug here. You just need to stop using the volumes
before stopping the pool.

Daniel
--
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



--
Umar Draz
Network Architect