Bug 1629916 - [v2v] Migration of VM with Encrypted Disk Fails
Summary: [v2v] Migration of VM with Encrypted Disk Fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Documentation
Version: 5.9.4
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: GA
: 5.10.0
Assignee: Avital Pinnick
QA Contact: Red Hat CloudForms Documentation
Red Hat CloudForms Documentation
URL:
Whiteboard: v2v
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-17 16:01 UTC by Kedar Kulkarni
Modified: 2019-01-23 06:29 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
Cause: VMs with encrypted disks fail migration. Consequence: VM fails to migrate. Workaround (if any): De-encrypt VM disks prior to VM migration. Result: Post disk de-encryption successful VM migration.
Clone Of:
Environment:
Last Closed: 2019-01-23 06:29:58 UTC
Category: ---
Cloudforms Team: V2V
Target Upstream Version:
Embargoed:
kkulkarn: automate_bug+


Attachments (Terms of Use)
virt-v2v logs (81.07 KB, application/octet-stream)
2018-09-17 16:01 UTC, Kedar Kulkarni
no flags Details

Description Kedar Kulkarni 2018-09-17 16:01:38 UTC
Created attachment 1484095 [details]
virt-v2v logs

Description of problem:
Migration of VM with Encrypted Disk Fails- Tested with RHEL7 Server Minimal install LUKS Encrypted Disk.

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

How reproducible:
100%

Steps to Reproduce:
1.Add VMware and RHV provider 
2.Configure Conversion host for migration
3.Create a VM which has LUKS Encryption on its disk
4.Create infra mapping and migration plan to migrate this VM


Actual results:
Migration Fails with Error :
libguestfs: trace: v2v: vfs_type = "crypto_LUKS"
getline: Inappropriate ioctl for device
libguestfs: trace: v2v: close

See attached Log file

Expected results:
Migration of Encrypted Disk VM should be supported or appropriate error should be displayed to user in CF. Probably block migration of such VM.

Additional info:

Comment 3 Richard W.M. Jones 2018-12-04 08:33:47 UTC
virt-v2v is asking for an encryption passphrase to decrypt the
disk.  However as there is no console it gets an error when
reading it:

https://github.com/libguestfs/libguestfs/blob/b0c11adee755018208d946fd104fdfc9f0da8de3/common/options/keys.c#L77

You can pass keys to virt-v2v using the
virt-v2v --keys-from-stdin option, but it will require additional
support in the wrapper.

Comment 4 Pino Toscano 2018-12-04 08:55:13 UTC
(In reply to Richard W.M. Jones from comment #3)
> You can pass keys to virt-v2v using the
> virt-v2v --keys-from-stdin option, but it will require additional
> support in the wrapper.

This is correct, however it is very inconvenient to use: you need to write to stdin the passphrases in the correct order of the LUKS volumes.

I introduced upstream a new --key command line parameter in all the tools (virt-v2v included) to help with this process:
https://github.com/libguestfs/libguestfs/commit/4b1e5b0c3f900b0f197885e85f8c917caff3c339
Maybe this needs a --machine-readable capability? (Also to help virt-p2v to use it.)


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