[et-mgmt-tools] virt-path modification sugestion

Adrian Revill adrian.revill at shazamteam.com
Wed Feb 27 14:49:32 UTC 2008


I was trying to to do an install onto an existing logical volume, 
VolVirt/el5test. I have not found any documentation on the use of the 
logical volumes, so I set virt-path to VolVirt/el5test
But i got an error saying "The volume group [VolVirt/el5test] does not 
exist."

I have looked at the koan code app.py, calc_virt_path2.

It first checks to see if the volume group exists.
It runs /usr/sbin/vgs -o vg_name which correctly lists the volume groups.
   VG
   VolGroup00
   VolVirt
But It then searches the list of volume groups looking for 
VolVirt/el5test, which of course fails, it should be spliting the 
location string and  only looking for the volume group name.

Reading on, It then checks the size of the volume group by running 
/usr/sbin/vgs --noheadings -o vg_free --units g VolVirt/el5test
Which also fails as it is expecting just the volume group name "VolVirt"

After this it starts to check the logical volume.
It correctly runs lvs -o lv_name VolVirt/el5test
   LV
   el5test

It now defines the logical volume name as Wed_Feb_27_14_19_24_2008-disk0
(The date is inserted as i have not defined a system name.)

Now the logical volume is created with the command /usr/sbin/lvcreate -L 
5G -n Wed_Feb_27_14_19_24_2008-disk0 VolVirt/el5test
Which fails.

-----

So from this i can see that when using logical volumes the volume names 
are defined by setting the virt-path to the volume group name and the 
logical volume name will be sytstemName-disk0

If the calc_virt_path2 function was modified slightly, to first split 
the location on / and using the first part as the volume group name, and 
then if the second part is not null set the logical volume name to the 
second part, else use the default name.
It would be possible to also explicitly specify the logical volume in 
the virt-path using the form volumeGroup/logicalVolume

I would submit a patch to do it, but im not a python programmer.

regards
Adrian Revill








More information about the et-mgmt-tools mailing list