Bug 1877685 - [v2v][RHV to CNV VM import] Import fails on DNS-1123 rules when VM FQDN is reported in RHV
Summary: [v2v][RHV to CNV VM import] Import fails on DNS-1123 rules when VM FQDN is re...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: V2V
Version: 2.4.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 2.5.0
Assignee: Piotr Kliczewski
QA Contact: David Vaanunu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-10 08:02 UTC by Maayan Hadasi
Modified: 2020-12-07 09:53 UTC (History)
4 users (show)

Fixed In Version: 2.5.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-07 09:53:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt vm-import-operator pull 397 0 None closed Normalize vm hostname 2020-12-06 18:00:06 UTC
Github kubevirt vm-import-operator pull 418 0 None closed Use label normalizer 2020-12-06 17:59:39 UTC

Description Maayan Hadasi 2020-09-10 08:02:14 UTC
Description of problem:
Failed to import RHV VM once its FQDN is reported
FQDN includes period characters ('.') that are not allowed by DNS-1123


Version-Release number of selected component (if applicable):
CVN 2.4.1 / OCP 4.5.6


How reproducible:
100%


Steps to Reproduce:
1. Have a running VM in RHV
2. Verify VM FQDN is reported
3. Try to import to CNV


Actual results:

Import Error:
The virtual machine could not be imported.
VMCreationFailed: Error while creating virtual machine default/v2v-rhel8-vm-guest-agent-installed: admission webhook "virtualmachine-validator.kubevirt.io" denied the request: spec.template.spec.hostname does not conform to the kubernetes DNS_LABEL rules : a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')

Comment 1 Maayan Hadasi 2020-10-01 21:07:32 UTC
Moving to ASSIGNED as the issue is reproduced

VM FQDN: rhev-orange-03.rdu2.scalelab.redhat.com

Versions:
CNV 2.5.0 (createdAt: "2020-09-27 03:29:41")
OCP 4.6.0-fc.8

The validation error is displayed in 'oc describe my_vmimport' (see Bug 1884403)


$ oc describe virtualmachineimports vm-import-v2v-rhel8-vm-guest-agent-installed-xlwfl
Name:         vm-import-v2v-rhel8-vm-guest-agent-installed-xlwfl
Namespace:    default
Labels:       <none>
Annotations:  vmimport.v2v.kubevirt.io/progress: 100
              vmimport.v2v.kubevirt.io/source-vm-initial-state: up
API Version:  v2v.kubevirt.io/v1beta1
Kind:         VirtualMachineImport
Metadata:
  Creation Timestamp:  2020-10-01T21:02:32Z
  Finalizers:
    vmimport.v2v.kubevirt.io/restore-state
  Generate Name:  vm-import-v2v-rhel8-vm-guest-agent-installed-
  Generation:     1
  Managed Fields:
    API Version:  v2v.kubevirt.io/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:generateName:
      f:spec:
        .:
        f:providerCredentialsSecret:
          .:
          f:name:
          f:namespace:
        f:source:
          .:
          f:ovirt:
            .:
            f:mappings:
              .:
              f:diskMappings:
            f:vm:
              .:
              f:id:
        f:startVm:
        f:targetVmName:
    Manager:      Mozilla
    Operation:    Update
    Time:         2020-10-01T21:02:32Z
    API Version:  v2v.kubevirt.io/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:vmimport.v2v.kubevirt.io/progress:
          f:vmimport.v2v.kubevirt.io/source-vm-initial-state:
        f:finalizers:
          .:
          v:"vmimport.v2v.kubevirt.io/restore-state":
      f:spec:
        f:source:
          f:ovirt:
            f:mappings:
              f:networkMappings:
      f:status:
        .:
        f:conditions:
        f:targetVmName:
    Manager:         vm-import-controller
    Operation:       Update
    Time:            2020-10-01T21:02:50Z
  Resource Version:  5072507
  Self Link:         /apis/v2v.kubevirt.io/v1beta1/namespaces/default/virtualmachineimports/vm-import-v2v-rhel8-vm-guest-agent-installed-xlwfl
  UID:               a9479a76-755d-4c63-9fad-126898063e8d
Spec:
  Provider Credentials Secret:
    Name:       admin-rhev-blue-01-rdu2-scalel-nrd8b
    Namespace:  default
  Source:
    Ovirt:
      Mappings:
        Disk Mappings:
          Source:
            Id:  213ab526-bfad-476e-9243-a488b97b16d4
          Target:
            Name:       
          Volume Mode:  Filesystem
        Network Mappings:
          Source:
            Id:  b183d36a-6ba6-4821-9960-6df92c185ef3
          Type:  pod
      Vm:
        Id:        560b560b-e1ab-4c44-97f6-e4a16a78e32b
  Start Vm:        false
  Target Vm Name:  v2v-rhel8-vm-guest-agent-installed
Status:
  Conditions:
    Last Heartbeat Time:   2020-10-01T21:02:33Z
    Last Transition Time:  2020-10-01T21:02:33Z
    Message:               Default storage class will be used for 213ab526-bfad-476e-9243-a488b97b16d4 disk 
    Reason:                ValidationReportedWarnings
    Status:                True
    Type:                  Valid
    Last Heartbeat Time:   2020-10-01T21:02:33Z
    Last Transition Time:  2020-10-01T21:02:33Z
    Message:               VM specifies IO Threads: 0, VM has NUMA tune mode secified: interleave, Interface 1cf2eea7-9239-4086-ab38-8052e8ccda01 uses profile with a network filter with ID: d2370ab4-fee3-11e9-a310-8c1645ce738e.
    Reason:                MappingRulesVerificationReportedWarnings
    Status:                True
    Type:                  MappingRulesVerified
    Last Heartbeat Time:   2020-10-01T21:02:50Z
    Last Transition Time:  2020-10-01T21:02:50Z
    Message:               Error while importing disk image: . VirtualMachine.kubevirt.io "" not found
    Reason:                ProcessingFailed
    Status:                False
    Type:                  Processing
    Last Heartbeat Time:   2020-10-01T21:02:50Z
    Last Transition Time:  2020-10-01T21:02:44Z
    Message:               Error while importing disk image: . VirtualMachine.kubevirt.io "" not found
    Reason:                DataVolumeCreationFailed
    Status:                False
    Type:                  Succeeded
  Target Vm Name:          
Events:
  Type     Reason            Age   From                             Message
  ----     ------            ----  ----                             -------
  Warning  VMCreationFailed  32s   virtualmachineimport-controller  Error while creating virtual machine default/v2v-rhel8-vm-guest-agent-installed: admission webhook "virtualmachine-validator.kubevirt.io" denied the request: spec.template.spec.hostname does not conform to the kubernetes DNS_LABEL rules : a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
  Normal   ImportScheduled   27s   virtualmachineimport-controller  Import of Virtual Machine default/ started
  Warning  DVCreationFailed  26s   virtualmachineimport-controller  VirtualMachine.kubevirt.io "" not found

Comment 2 Piotr Kliczewski 2020-10-02 15:01:09 UTC
It seems like our normalization logic is buggy. Please share fqdn used by your vm.

Comment 3 Maayan Hadasi 2020-10-03 17:52:07 UTC
(In reply to Piotr Kliczewski from comment #2)
> It seems like our normalization logic is buggy. Please share fqdn used by
> your vm.

VM FQDN: rhev-orange-03.rdu2.scalelab.redhat.com (please see comment #1)

Comment 4 Md Nadeem 2020-10-23 13:36:03 UTC
verified on CNV version : v2.5.0-333

The VM import works for VM v2v-rhel8-vm-guest-agent-installed with FQDN ( rhev-orange-03.rdu2.scalelab.redhat.com )


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