Bug 1451665 - RFE: Virt-v2v can't convert the guest which has encrypted partition
Summary: RFE: Virt-v2v can't convert the guest which has encrypted partition
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs   
(Show other bugs)
Version: 7.4
Hardware: x86_64 Unspecified
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
Yehuda Zimmerman
Whiteboard: V2V
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2017-05-17 09:16 UTC by mxie@redhat.com
Modified: 2018-04-10 09:15 UTC (History)
10 users (show)

Fixed In Version: libguestfs-1.36.7-1.el7
Doc Type: Enhancement
Doc Text:
*virt-v2v* now converts Linux guests encrypted with LUKS With this update, the *virt-v2v* utility can convert Linux guests installed with full-disk LUKS encryption, that is when all the partitions other than the `/boot` partition are encrypted. Notes: * The *virt-v2v* utility does not support conversion of Linux guests on partitions with other types of encryption schemes. * The *virt-p2v* utility does not support conversion of Linux machines installed with full-disk LUKS encryption.
Story Points: ---
Clone Of:
Last Closed: 2018-04-10 09:15:08 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
virt-v2v-encrypted-guest.log (72.25 KB, text/plain)
2017-05-17 09:16 UTC, mxie@redhat.com
no flags Details
v2v-exit.log (66.15 KB, text/plain)
2017-10-13 09:23 UTC, kuwei@redhat.com
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0677 normal SHIPPED_LIVE libguestfs new packages, bug fix and enhancement update 2018-04-10 13:13:49 UTC
Red Hat Bugzilla 1398191 None NEW RFE: virt-v2v should support converting vm with LUKS disk encryption format 2019-01-23 01:26 UTC

Description mxie@redhat.com 2017-05-17 09:16:24 UTC
Created attachment 1279603 [details]

Description of problem:
Virt-v2v can't convert the guest which has encrypted partition

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Prepare a linux guest which has encrypted partition on xen server and using virt-v2v can convert the encrypted guest but the conversion is failed. pls refer to attachment log
# virt-v2v -ic xen+ssh://root@ Auto-xen-rhel6.9-case13063 -of qcow2 -b default
[   0.0] Opening the source -i libvirt -ic xen+ssh://root@ Auto-xen-rhel6.9-case13063
[   0.7] Creating an overlay to protect the source from being modified
[   7.2] Initializing the target -o libvirt -os default
[   7.2] Opening the overlay
[ 237.4] Inspecting the overlay
virt-v2v: error: inspection could not detect the source guest (or physical 

Assuming that you are running virt-v2v/virt-p2v on a source which is 
supported (and not, for example, a blank disk), then this should not 

No root device found in this operating system image.

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Actual results:
As above description

Expected results:
Virt-v2v can convert encrypted guest

Additional info:

Comment 2 Pino Toscano 2017-05-22 09:41:24 UTC
Hi mxie,

the guest of this test is the classic whole-disk LUKS encryption done by the  Fedora/RHEL installer, right?

Comment 3 mxie@redhat.com 2017-05-22 10:06:17 UTC
(In reply to Pino Toscano from comment #2)
> Hi mxie,
> the guest of this test is the classic whole-disk LUKS encryption done by the
> Fedora/RHEL installer, right?

Hi Pino, 

Yes, pls refer to below partition info of the encrypted rhel6.9 guest which is installed on xen server
NAME                          MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
xvda                          202:0    0 14.7G  0 disk  
├─xvda1                       202:1    0  500M  0 part  /boot
└─xvda2                       202:2    0 14.2G  0 part  
  └─luks-6b952cdc-9d5b-426d-bd0c-1ba16e00b4eb (dm-0)
                              253:0    0 14.2G  0 crypt 
    ├─VolGroup-lv_root (dm-1) 253:1    0 12.7G  0 lvm   /
    └─VolGroup-lv_swap (dm-2) 253:2    0  1.5G  0 lvm   [SWAP]
sr0                            11:0    1 1024M  0 rom

Comment 4 Pino Toscano 2017-05-30 07:05:40 UTC
Fixed with
which is in libguestfs >= 1.37.15.

Comment 8 kuwei@redhat.com 2017-10-13 09:23 UTC
Created attachment 1338167 [details]

Comment 11 kuwei@redhat.com 2017-10-30 04:42:34 UTC
To verify it with below builds:

1.Using virt-v2v to convert the guest as below.
# virt-v2v -ic xen+ssh://root@ 6.9-encrypted  -of raw
[   0.0] Opening the source -i libvirt -ic xen+ssh://root@ 6.9-encrypted
[   0.5] Creating an overlay to protect the source from being modified
[   1.0] Initializing the target -o libvirt -os default
[   1.1] Opening the overlay
Enter key or passphrase ("/dev/sda2"): 
[   7.3] Inspecting the overlay
[  17.0] Checking for sufficient free disk space in the guest
[  17.0] Estimating space required on target for each disk
[  17.0] Converting Red Hat Enterprise Linux Server release 6.9 (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  78.2] Mapping filesystem data to avoid copying unused and blank areas
virt-v2v: warning: fstrim on guest filesystem /dev/VolGroup/lv_root failed. 
 Usually you can ignore this message.  To find out more read "Trimming" in 

Original message: fstrim: fstrim: /sysroot/: the discard operation is not 
[  78.3] Closing the overlay
[  78.4] Checking if the guest needs BIOS or UEFI to boot
[  78.4] Assigning disks to buses
[  78.4] Copying disk 1/1 to /var/lib/libvirt/images/6.9-encrypted-sda (raw)
[ 258.8] Creating output metadata
Pool default refreshed

Domain 6.9-encrypted defined from /tmp/v2vlibvirt3254f2.xml

[ 261.2] Finishing off

2.After conversion,boot into the system and checkpoints all passed.

Sorry for comment6,maybe that guest exist some problem.Thanks for your reply.

So, the bug has fixed ,move the bug status to VERIFIED.

Comment 18 errata-xmlrpc 2018-04-10 09:15:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.