Bug 2000021 - [VMIO][RHV VM Import] 63 long char VM Name with more than 1 Disk results in DataVolumeCreationFailed
Summary: [VMIO][RHV VM Import] 63 long char VM Name with more than 1 Disk results in D...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: V2V
Version: 4.8.5
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: 4.8.2
Assignee: Sam Lucidi
QA Contact: Daniel Gur
URL:
Whiteboard:
Depends On:
Blocks: 2000409
TreeView+ depends on / blocked
 
Reported: 2021-09-01 08:24 UTC by Amos Mastbaum
Modified: 2021-09-21 11:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2000409 (view as bug list)
Environment:
Last Closed: 2021-09-21 11:08:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
vmio controller log (7.79 MB, text/plain)
2021-09-01 08:24 UTC, Amos Mastbaum
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt vm-import-operator pull 509 0 None None None 2021-09-02 21:09:56 UTC
Red Hat Product Errata RHSA-2021:3598 0 None None None 2021-09-21 11:08:54 UTC

Description Amos Mastbaum 2021-09-01 08:24:54 UTC
Created attachment 1819605 [details]
vmio controller log

Created attachment 1819605 [details]
vmio controller log

Description of problem:

Import a source VM with 63 char long name and More Than 1 Disk causes the VMIO import to fail:

DataVolumeCreationFailed: Error while importing disk image: . admission webhook "virtualmachine-validator.kubevirt.io" denied the request: spec.template.spec.domain.devices.disks[1] and spec.template.spec.domain.devices.disks[0] must not have the same Name., spec.template.spec.volumes[1] and spec.template.spec.volumes[0] must not have the same Name.



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


How reproducible:
100%


Steps to Reproduce:
1. Import Any VM with at least 2 disks and a 63 char long name
2.
3.

Actual results:


Expected results:


Additional info:

vmio cr:
http://pastebin.test.redhat.com/990953


VMIO controller log attached

Note: RHV (vmware not tested yet).

Comment 2 Ilanit Stein 2021-09-01 16:39:42 UTC
The flow in the bug description PASS for VMware-6.5.

When using a short VM name, this bug doesn't occur.

Comment 3 Fabien Dupont 2021-09-01 20:26:27 UTC
I think the problem comes from https://github.com/kubevirt/vm-import-operator/blob/master/pkg/providers/ovirt/mapper/mapper.go#L199.
The volume names are shortened to 63 characters to respect the RFC 1123 Label Names specification [1].
The problem is that the base name before shortening is "dv-<DataVolume.name>". And the DataVolume.name is "<VM.name>-<DiskAttachment.Id>".
When there is only one disk, the DataVolume.name is still unique, since the VM.name is unique. But with 2 disks, the shortened name is identical for the 2 disks.
This leads the admission controller to reject the VirtualMachine.

[1] https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names

Comment 5 Fabien Dupont 2021-09-07 20:27:47 UTC
Please verify with hco-registry-bundle-container-v4.8.2-15 / iib:106992.

Comment 6 Amos Mastbaum 2021-09-09 15:26:22 UTC
verfifed CNV-v4.8.2-18

Comment 11 errata-xmlrpc 2021-09-21 11:08:02 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 (Moderate: OpenShift Virtualization 4.8.2 Images security and bug fix update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHSA-2021:3598


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