Bug 470693
Summary: | Colon as a delimiter to parse the 'lvs' is not always working | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Niklas Hagman <redhat> | ||||||
Component: | libvirt | Assignee: | Daniel Veillard <veillard> | ||||||
Status: | CLOSED UPSTREAM | QA Contact: | |||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | unspecified | CC: | berrange, crobinso | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2008-12-02 16:39:44 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Niklas Hagman
2008-11-08 23:12:31 UTC
I believe there were some regressions in 0.4.6 wrt logical pools. These should be fixed upstream. Can you try with latest upstream? git clone git://git.et.redhat.com/libvirt.git Created attachment 323132 [details]
Logfile from autogen.sh
Having problem compiling libvirt from git. Am not an expert at this so am probably doing something wrong. See the attachment for my errors. Using ubuntu 8.10 server...
I figure out what I was missing. I did not have automake. Sorry about that. Okay, I tested the latest git and it produces the same error for me. So no go... I can see now that it was a slightly difference in the error output from libvirt taken from git: libvir: Storage error : internal error cannot open volume '/dev/vg/root:6V34m5-Jvrt-Mbdp-wgiY-DiMk-ssZk-xFoqFq': No such file or directory libvir: Storage error : internal error lvs command failed libvir: error : internal error '/sbin/vgchange -an vg' exited with non-zero status 5 and signal 0: Can't deactivate volume group "vg" with 5 open logical volume(s) Okay, we debugged this on IRC. Libvirt uses the a colon as a delimiter to parse the 'lvs' command when starting a pool. Unfortunately, on ubuntu, lvs prints a colon in the physical device name, so our parsing is all messed up. Ubuntu output: root:6V34m5-Jvrt-Mbdp-wgiY-DiMk-ssZk-xFoqFq:/dev/block/254:0(0):9663676416:4194304 Fedora output: lvhome:fktHK1-MC62-tjuz-AxrR-js47-waBp-6clGPh:/dev/sda2(0):50331648000:33554432 Notice the extra ':' between the device name and (0). We verified that the use of : is hardcoded, since specifying a different separator (tested with '#') shows the expected output format. So we should probably change our call in libvirt to not use ':'. Ah, i see the actual device name is "/dev/block/254:0" which is a little wierd. While changing the separator will be needed, we may also need to do some extra magic to turn '/dev/block/254:0' back into a /dev/sdXXX type name. This is because if you have an iSCSI / disk pool you want to be able to correlate LVM pvs against the devices in other pools. For separator, using ';' or ',' or '|' would be possible choices. For your information, '/dev/block/254:0' is a encrypted volume with lvm inside. The encrypted volume is mounted with the command "cryptsetup luksOpen /dev/sda cryptroot" that will give the source path "/dev/mapper/cryptroot" for this encrypted volume with lvm inside. After mounting this encrypted volume, ubuntu is setting up lvm2 automatic. Thanks, that's useful info - its almost certainly not Ubuntu specific then - I imagine if we did an encrypted phys device in LVM on Fedora we'd hit the same issue. Created attachment 323389 [details]
Switch the delimiter to a comma
Niklas, can you test this patch and see if it fixes your problem?
Yes, it seems to work. virt-manager can see the list of lvs. Have created and deleted a lv from within virt-manager at it works. But virt-install (within virt-manager) don't allow me to choose a disk as virtual harddrive. But that is another problem/bug. You can mark this bug solved when ready. Nice done! This was fixed upstream and is in version 0.5.0: http://git.et.redhat.com/?p=libvirt.git;a=commit;h=c6b0d780cc0b245226e668bada94d02bf4cd9831 Closing as UPSTREAM. |