[libvirt] [PATCH 3/3]: Implement logical stopPool and deletePool more fully

Chris Lalancette clalance at redhat.com
Tue Sep 23 07:30:46 UTC 2008


Daniel P. Berrange wrote:
>> 3)  In deletePool, remove the -f from the vgremove command.  Besides the fact
>> that we probably don't usually want to force things, the -f option doesn't exist
>> prior to F-9, so this would fail on F-8, RHEL-5, etc.
> 
> Hmm, are you sure it won't prompt for a y/n confirmation ? IIRC, that was 
> the reason I put in the -f. Perhaps simply ensuring stdin is /dev/null
> takes care of that problem.

This was already committed, but just to follow-up:

First, I was wrong about RHEL-5.  Apparently we've rebased the LVM tools in
RHEL-5, so it does have the -f flag for vgremove.  That being said, it's not
actually necessary, based on my testing.  Here's what I did:

1)  pvcreate /dev/sdb
2)  vgcreate MyVG2 /dev/sdb
3)  lvcreate -L1G 0n guest1 /dev/MyVG2

At this point, I have a valid volume at /dev/MyVG2/guest1

4)  lvremove -f /dev/MyVG2/guest1 (this corresponds to the code in
virStorageBackendLogicalDeleteVol)
5)  vgremove /dev/MyVG2 (this corresponds to the new code in
virStorageBackendLogicalDeletePool)
6)  pvremove /dev/sdb

All commands completed without prompts, and remove the logical volumes.  In step
4), if I do a vgremove, *then* I get a prompt saying:

"Do you really want to remove volume group "MyVG2" containing 1 logical volumes?
[y/n]: n"

But that's only because you are trying to de-activate a volume group that has
active logical volumes.

The bottom-line is that I think we are OK with the new code, but we will need to
do further testing/use cases to make sure.

Chris Lalancette




More information about the libvir-list mailing list