Description of problem: when importing a RHEL-7 VM from VMware to CNV via API, the VM import fails instantly with error: vmw-import-3 could not be imported. DataVolumeCreationFailed: Error while importing disk image: . VirtualMachine.kubevirt.io "" not found Version-Release number of selected component (if applicable): CNV-2.5: iib-22696 hco-v2.5.0-396 How reproducible: 100% Expected results: 1. VM import should succeed 2. VM import error message (if indeed there should be an error) should indicate the cause. Additional info: Same flow pass for RHV to CNV VM import $ oc get events 6s Warning VMCreationFailed virtualmachineimport/vmware-import-4 Error while creating virtual machine default/vmw-import-vm-4: admission webhook "virtualmachine-validator.kubevirt.io" denied the request: virtio-net multiqueue request, but there are no virtio interfaces defined 6s Normal ImportScheduled virtualmachineimport/vmware-import-4 Import of Virtual Machine default/ started 6s Warning DVCreationFailed virtualmachineimport/vmware-import-4 VirtualMachine.kubevirt.io "" not found Resource Mapping: apiVersion: v2v.kubevirt.io/v1beta1 kind: ResourceMapping metadata: creationTimestamp: "2020-10-25T13:03:02Z" generation: 5 name: example-vmware-resourcemappings namespace: default resourceVersion: "2045607" selfLink: /apis/v2v.kubevirt.io/v1beta1/namespaces/default/resourcemappings/example-vmware-resourcemappings uid: e72401f1-c6b8-41c8-940e-18d6f6e0e8ad spec: vmware: networkMappings: - source: name: VM Network target: name: pod type: pod storageMappings: - source: id: datastore-12 target: name: ocs-storagecluster-ceph-rbd volumeMode: Block vm -import-controller log: {"level":"info","ts":1603705686.2721922,"logger":"controller_virtualmachineimport","msg":"Reconciling VirtualMachineImport","Request.Namespace":"default","Request.Name":"vmware-import-4"} {"level":"info","ts":1603705686.401598,"logger":"controller_virtualmachineimport","msg":"Storing source VM status","Request.Namespace":"default","Request.Name":"vmware-import-4","status":"down"} {"level":"info","ts":1603705686.6851554,"logger":"controller_virtualmachineimport","msg":"A template was found for creating the virtual machine","Request.Namespace":"default","Request.Name":"vmware-import-4","Template.Name":"rhel7-server-medium-v0.11.3"} {"level":"info","ts":1603705686.7521782,"logger":"controller_virtualmachineimport","msg":"Creating a new VM","Request.Namespace":"default","Request.Name":"vmware-import-4","VM.Namespace":"default","VM.Name":"vmw-import-vm-4"} {"level":"info","ts":1603705686.8047888,"logger":"controller_virtualmachineimport","msg":"VM struct","Request.Namespace":"default","Request.Name":"vmware-import-4","VM spec":"{\"kind\":\"VirtualMachine\",\"apiVersion\":\"kubevirt.io/v1alpha3\",\"metadata\":{\"name\":\"vmw-import-vm-4\",\"namespace\":\"default\",\"creationTimestamp\":null,\"labels\":{\"app\":\"vmw-import-vm-4\",\"flavor.template.kubevirt.io/medium\":\"true\",\"os.template.kubevirt.io/rhel7.7\":\"true\",\"tags\":\"\",\"vm.kubevirt.io/template\":\"rhel7-server-medium-v0.11.3\",\"vm.kubevirt.io/template.namespace\":\"openshift\",\"vm.kubevirt.io/template.revision\":\"1\",\"vm.kubevirt.io/template.version\":\"v0.12.3\",\"workload.template.kubevirt.io/server\":\"true\"},\"annotations\":{\"vmware-description\":\"\"},\"ownerReferences\":[{\"apiVersion\":\"v2v.kubevirt.io/v1beta1\",\"kind\":\"VirtualMachineImport\",\"name\":\"vmware-import-4\",\"uid\":\"1dee5aa5-4b04-492c-9a55-045112d78580\",\"controller\":true,\"blockOwnerDeletion\":true}]},\"spec\":{\"running\":false,\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"flavor.template.kubevirt.io/medium\":\"true\",\"kubevirt.io/domain\":\"vmw-import-vm-4\",\"kubevirt.io/size\":\"medium\",\"os.template.kubevirt.io/rhel7.7\":\"true\",\"vm.kubevirt.io/name\":\"vmw-import-vm-4\",\"workload.template.kubevirt.io/server\":\"true\"}},\"spec\":{\"domain\":{\"resources\":{\"requests\":{\"memory\":\"2Gi\"}},\"cpu\":{\"cores\":1,\"sockets\":1},\"machine\":{\"type\":\"pc-q35-rhel8.2.0\"},\"firmware\":{\"bootloader\":{\"efi\":{}},\"serial\":\"5003d811-caf3-487b-dd12-feaa93d4def0\"},\"clock\":{\"utc\":{\"offsetSeconds\":0},\"timer\":{}},\"features\":{\"acpi\":{},\"smm\":{\"enabled\":true}},\"devices\":{\"inputs\":[{\"bus\":\"virtio\",\"type\":\"tablet\",\"name\":\"tablet\"}],\"rng\":{},\"networkInterfaceMultiqueue\":true}},\"evictionStrategy\":\"LiveMigrate\",\"terminationGracePeriodSeconds\":180}}},\"status\":{}}"} {"level":"info","ts":1603705686.8572476,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"virtualmachineimport-controller","source":"kind source: /, Kind="} {"level":"info","ts":1603705686.986988,"logger":"controller_virtualmachineimport","msg":"Reconciling VirtualMachineImport","Request.Namespace":"default","Request.Name":"vmware-import-4"} {"level":"info","ts":1603705686.9871936,"logger":"controller_virtualmachineimport","msg":"Not running reconcile","Request.Namespace":"default","Request.Name":"vmware-import-4"}
Can you please share the VirtualMachine spec generated for a RHV VM?
VM import from RHV, for a VM with no nic - VM & VM import yaml files: ==================================================================== VM yaml: ------- apiVersion: kubevirt.io/v1alpha3 kind: VirtualMachine metadata: annotations: comment: CNV-4469 kubevirt.io/latest-observed-api-version: v1alpha3 kubevirt.io/storage-observed-api-version: v1alpha3 sso: guest_agent selfLink: /apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/cirros-import resourceVersion: '10208908' name: cirros-import uid: 31c5aeaf-339b-4a57-9917-7a394637de57 creationTimestamp: '2020-10-29T11:16:56Z' generation: 2 managedFields: - apiVersion: kubevirt.io/v1alpha3 fieldsType: FieldsV1 fieldsV1: 'f:metadata': 'f:annotations': 'f:kubevirt.io/latest-observed-api-version': {} 'f:kubevirt.io/storage-observed-api-version': {} 'f:status': {} manager: virt-controller operation: Update time: '2020-10-29T11:16:56Z' - apiVersion: kubevirt.io/v1alpha3 fieldsType: FieldsV1 fieldsV1: 'f:metadata': 'f:annotations': .: {} 'f:comment': {} 'f:sso': {} 'f:labels': 'f:os.template.kubevirt.io/rhel8.1': {} 'f:vm.kubevirt.io/template.version': {} 'f:vm.kubevirt.io/template.namespace': {} 'f:flavor.template.kubevirt.io/medium': {} 'f:app': {} 'f:tags': {} .: {} 'f:workload.template.kubevirt.io/desktop': {} 'f:vm.kubevirt.io/template.revision': {} 'f:origin': {} 'f:vm.kubevirt.io/template': {} 'f:spec': .: {} 'f:running': {} 'f:template': .: {} 'f:metadata': .: {} 'f:creationTimestamp': {} 'f:labels': .: {} 'f:flavor.template.kubevirt.io/medium': {} 'f:kubevirt.io/domain': {} 'f:kubevirt.io/size': {} 'f:os.template.kubevirt.io/rhel8.1': {} 'f:vm.kubevirt.io/name': {} 'f:workload.template.kubevirt.io/desktop': {} 'f:spec': .: {} 'f:domain': 'f:devices': .: {} 'f:autoattachGraphicsDevice': {} 'f:disks': {} 'f:inputs': {} .: {} 'f:firmware': .: {} 'f:bootloader': .: {} 'f:bios': {} 'f:resources': .: {} 'f:limits': .: {} 'f:memory': {} 'f:requests': .: {} 'f:memory': {} 'f:features': .: {} 'f:acpi': {} 'f:machine': .: {} 'f:type': {} 'f:cpu': .: {} 'f:cores': {} 'f:sockets': {} 'f:threads': {} 'f:memory': {} 'f:clock': .: {} 'f:timer': {} 'f:utc': {} 'f:evictionStrategy': {} 'f:terminationGracePeriodSeconds': {} 'f:volumes': {} manager: vm-import-controller operation: Update time: '2020-10-29T11:16:58Z' namespace: default labels: app: cirros-import workload.template.kubevirt.io/desktop: 'true' origin: rhev vm.kubevirt.io/template: rhel8-desktop-medium-v0.11.3 flavor.template.kubevirt.io/medium: 'true' os.template.kubevirt.io/rhel8.1: 'true' vm.kubevirt.io/template.version: v0.12.3 tags: '' vm.kubevirt.io/template.namespace: openshift vm.kubevirt.io/template.revision: '1' spec: running: false template: metadata: creationTimestamp: null labels: flavor.template.kubevirt.io/medium: 'true' kubevirt.io/domain: cirros-import kubevirt.io/size: medium os.template.kubevirt.io/rhel8.1: 'true' vm.kubevirt.io/name: cirros-import workload.template.kubevirt.io/desktop: 'true' spec: domain: clock: timer: {} utc: {} cpu: cores: 1 sockets: 1 threads: 1 devices: autoattachGraphicsDevice: true disks: - bootOrder: 1 disk: bus: virtio name: dv-cirros-import-cd642023-e698-49b1-b2fc-5e06b7006b18 inputs: - bus: virtio name: tablet type: tablet features: acpi: {} firmware: bootloader: bios: {} machine: type: q35 memory: {} resources: limits: memory: 16Gi requests: memory: 4Gi evictionStrategy: LiveMigrate terminationGracePeriodSeconds: 180 volumes: - dataVolume: name: cirros-import-cd642023-e698-49b1-b2fc-5e06b7006b18 name: dv-cirros-import-cd642023-e698-49b1-b2fc-5e06b7006b18 VM import yaml: -------------- $ oc get vmimports example-virtualmachineimport -oyaml apiVersion: v2v.kubevirt.io/v1beta1 kind: VirtualMachineImport metadata: annotations: vmimport.v2v.kubevirt.io/progress: "100" vmimport.v2v.kubevirt.io/source-vm-initial-state: down creationTimestamp: "2020-10-29T11:16:55Z" generation: 1 managedFields: - apiVersion: v2v.kubevirt.io/v1beta1 fieldsType: FieldsV1 fieldsV1: f:spec: .: {} f:providerCredentialsSecret: .: {} f:name: {} f:namespace: {} f:source: .: {} f:ovirt: .: {} f:vm: .: {} f:id: {} f:startVm: {} f:targetVmName: {} manager: kubectl-create operation: Update time: "2020-10-29T11:16:55Z" - apiVersion: v2v.kubevirt.io/v1beta1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:vmimport.v2v.kubevirt.io/progress: {} f:vmimport.v2v.kubevirt.io/source-vm-initial-state: {} f:status: .: {} f:conditions: {} f:dataVolumes: {} f:targetVmName: {} manager: vm-import-controller operation: Update time: "2020-10-29T11:17:05Z" name: example-virtualmachineimport namespace: default resourceVersion: "10208902" selfLink: /apis/v2v.kubevirt.io/v1beta1/namespaces/default/virtualmachineimports/example-virtualmachineimport uid: 98f0557a-5583-44eb-a5c2-000cb6052a46 spec: providerCredentialsSecret: name: blue-secret namespace: default source: ovirt: vm: id: b68feba8-a6d3-4e39-b53b-a7ed186e740b startVm: false targetVmName: cirros-import status: conditions: - lastHeartbeatTime: "2020-10-29T11:16:55Z" lastTransitionTime: "2020-10-29T11:16:55Z" message: 'Default storage class will be used for GlanceDisk-aa51d20_cirros-vm-no-nics(cd642023-e698-49b1-b2fc-5e06b7006b18) disk ' reason: ValidationReportedWarnings status: "True" type: Valid - lastHeartbeatTime: "2020-10-29T11:16:55Z" lastTransitionTime: "2020-10-29T11:16:55Z" message: 'VM specifies IO Threads: 1, VM has NUMA tune mode secified: interleave' reason: MappingRulesVerificationReportedWarnings status: "True" type: MappingRulesVerified - lastHeartbeatTime: "2020-10-29T11:17:05Z" lastTransitionTime: "2020-10-29T11:16:56Z" message: Copying virtual machine disks reason: ProcessingCompleted status: "True" type: Processing - lastHeartbeatTime: "2020-10-29T11:17:05Z" lastTransitionTime: "2020-10-29T11:17:05Z" message: Virtual machine disks import done reason: VirtualMachineReady status: "True" type: Succeeded dataVolumes: - name: cirros-import-cd642023-e698-49b1-b2fc-5e06b7006b18 targetVmName: cirros-import
If I read the error message correctly, the spec for the virtual machine that failed was: --- kind: VirtualMachine apiVersion: kubevirt.io/v1alpha3 metadata: name: vmw-import-vm-4 namespace: default creationTimestamp: labels: app: vmw-import-vm-4 flavor.template.kubevirt.io/medium: 'true' os.template.kubevirt.io/rhel7.7: 'true' tags: '' vm.kubevirt.io/template: rhel7-server-medium-v0.11.3 vm.kubevirt.io/template.namespace: openshift vm.kubevirt.io/template.revision: '1' vm.kubevirt.io/template.version: v0.12.3 workload.template.kubevirt.io/server: 'true' annotations: vmware-description: '' ownerReferences: - apiVersion: v2v.kubevirt.io/v1beta1 kind: VirtualMachineImport name: vmware-import-4 uid: 1dee5aa5-4b04-492c-9a55-045112d78580 controller: true blockOwnerDeletion: true spec: running: false template: metadata: creationTimestamp: labels: flavor.template.kubevirt.io/medium: 'true' kubevirt.io/domain: vmw-import-vm-4 kubevirt.io/size: medium os.template.kubevirt.io/rhel7.7: 'true' vm.kubevirt.io/name: vmw-import-vm-4 workload.template.kubevirt.io/server: 'true' spec: domain: resources: requests: memory: 2Gi cpu: cores: 1 sockets: 1 machine: type: pc-q35-rhel8.2.0 firmware: bootloader: efi: {} serial: 5003d811-caf3-487b-dd12-feaa93d4def0 clock: utc: offsetSeconds: 0 timer: {} features: acpi: {} smm: enabled: true devices: inputs: - bus: virtio type: tablet name: tablet rng: {} networkInterfaceMultiqueue: true evictionStrategy: LiveMigrate terminationGracePeriodSeconds: 180 status: {} And the wrong parameter is "networkInterfaceMultiqueue: true", as it cannot be set if no virtio network interface is present. This is set by the "_linux.yaml" base template that is imported in all linux templates. There's an issue opened for that: https://github.com/kubevirt/common-templates/issues/186. However, I don't know why the RHV machine didn't have this attribute. Maybe a custom template?
https://github.com/kubevirt/vm-import-operator/pull/441
Verified on CNV-2.6.0: iib-37005 hco-v2.6.0-466 VM is migrated successfully, with no network interface.
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 2.6.0 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:0799