Bug 1306666
Summary: | Failure when disk contains an LV with activationskip=y | |||
---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Fabian Deutsch <fdeutsch> | |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> | |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 22 | CC: | mbooth, ptoscano, rjones, virt-maint | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | libguestfs-1.30.6-2.fc22 libguestfs-1.32.2-2.fc23 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1343167 (view as bug list) | Environment: | ||
Last Closed: | 2016-02-22 20:49:45 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: |
Description
Fabian Deutsch
2016-02-11 14:40:39 UTC
The problem is not the activationskip flag, but that libguestfs needs to be robust and ignore LVs which were not activated. (It's also possible that we could activate them anyway, but there may be other reasons why that's not a good idea). Something like this (untested): diff --git a/daemon/lvm.c b/daemon/lvm.c index 8bef4d5..529e20d 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -157,6 +157,10 @@ filter_convert_old_lvs_output (char *out) if (lv_attr[0] == 't') goto skip_line; + /* Ignore activationskip (RHBZ#1306666). */ + if (strlen (lv_attr) >= 10 && lv_attr[9] == 'k') + goto skip_line; + /* Ignore "unknown device" message (RHBZ#1054761). */ if (STRNEQ (p, "unknown device")) { char buf[256]; @@ -260,7 +264,7 @@ do_lvs (void) r = command (&out, &err, str_lvm, "lvs", "-o", "vg_name,lv_name", - "-S", "lv_role=public", + "-S", "lv_role=public && lv_active=active", "--noheadings", "--separator", "/", NULL); if (r == -1) { My reproducer for this is a bit involved, but here goes: $ virt-builder fedora-23 $ truncate -s 20G bigger.img $ virt-resize fedora-23.img bigger.img $ virt-rescue bigger.img ><rescue> pvcreate /dev/sda4 ><rescue> vgcreate VG /dev/sda4 ><rescue> lvcreate -L 2G -n LV1 VG ><rescue> lvcreate -L 2G -n LV2 VG ><rescue> lvcreate -L 2G -n LV3 VG ><rescue> exit # The following command works as expected: $ virt-inspector bigger.img # Now we set the activationskip flag: $ virt-rescue bigger.img ><rescue> lvchange -k y /dev/VG/LV1 ><rescue> lvs -o lv_attr,lv_name,vg_name Attr LV VG -wi-a----k LV1 VG <--- notice the 'k' flag -wi-a----- LV2 VG -wi-a----- LV3 VG ><rescue> exit # Now the following command will fail: $ virt-inspector bigger.img libguestfs: error: internal_parse_mountable: internal_parse_mountable_stub: /dev/VG/LV1: No such file or directory virt-inspector: no operating system could be detected inside this disk image. Upstream commit: https://github.com/libguestfs/libguestfs/commit/2e16e3e99324112845446c82b6a6e8b3e652e10d libguestfs-1.32.2-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-0a73d084ca libguestfs-1.30.6-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c491f221e5 libguestfs-1.30.6-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c491f221e5 libguestfs-1.32.2-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-0a73d084ca $ guestfish -a ovirt-node-ng-image.installed.qcow2
Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.
Type: 'help' for help on commands
'man' to read the manual
'quit' to quit the shell
><fs> run
><fs> list-filesystems
/dev/sda1: unknown
/dev/sda2: ext4
/dev/centos_installed/ovirt-node-ng-1.0-0.0: ext4
/dev/centos_installed/ovirt-node-ng-1.0-0.0+1: ext4
/dev/centos_installed/root: ext4
/dev/centos_installed/swap: swap
/dev/centos_installed/var: ext4
This works for me.
In comment 10 there was actually no k used - but I rechecked with k=y and it works as well: … ><fs> sh "lvchange -k y centos_installed/ovirt-node-ng-1.0-0.0" Logical volume "ovirt-node-ng-1.0-0.0" changed. ><fs> sh "lvs" LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert ovirt-node-ng-1.0-0.0 centos_installed Vwi-a-tz-k 14.50g pool00 root 12.46 ovirt-node-ng-1.0-0.0+1 centos_installed Vwi-aotz-- 14.50g pool00 ovirt-node-ng-1.0-0.0 12.78 pool00 centos_installed twi-aotz-- 14.52g 15.33 8.72 root centos_installed Vwi-a-tz-- 14.50g pool00 12.46 swap centos_installed -wi-a----- 2.04g var centos_installed Vwi-a-tz-- 4.00g pool00 6.23 ><fs> ------------ $ guestfish -a ovirt-node-ng-image.installed.qcow2 Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell ><fs> run ><fs> list-filesystems /dev/sda1: unknown /dev/sda2: ext4 /dev/centos_installed/ovirt-node-ng-1.0-0.0+1: ext4 /dev/centos_installed/root: ext4 /dev/centos_installed/swap: swap /dev/centos_installed/var: ext4 /dev/centos_installed/ovirt-node-ng-1.0-0.0 is nto there, this is correct libguestfs-1.30.6-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. libguestfs-1.32.2-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report. |