Bug 1850509 - [v2v][VM import from RHV to CNV] Import fail for setting nic1 to Pod and nic2 to a new network
Summary: [v2v][VM import from RHV to CNV] Import fail for setting nic1 to Pod and nic2...
Keywords:
Status: CLOSED DUPLICATE of bug 1850482
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: V2V
Version: 2.4.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 2.4.0
Assignee: Jakub Dzon
QA Contact: Ilanit Stein
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-24 12:30 UTC by Ilanit Stein
Modified: 2020-06-30 11:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-30 11:17:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
set network mapping (29.07 KB, image/png)
2020-06-24 12:30 UTC, Ilanit Stein
no flags Details
vm-import-failure (42.19 KB, image/png)
2020-06-24 12:31 UTC, Ilanit Stein
no flags Details
VM yaml (3.71 KB, application/octet-stream)
2020-06-24 12:32 UTC, Ilanit Stein
no flags Details
vm-import-controller.log (145.91 KB, text/plain)
2020-06-24 12:36 UTC, Ilanit Stein
no flags Details
vm import CR yaml (3.39 KB, text/plain)
2020-06-28 10:47 UTC, Ilanit Stein
no flags Details

Description Ilanit Stein 2020-06-24 12:30:06 UTC
Description of problem:
Import a VM with 2 ovirtmgmt/ovirtmgmt nics on RHV side.
In UI VM import wizard, map the 2 networks as follows (attachment "network map setting screenshot"):

nic1: Pod Networking Type: masquerade (Set by default and can't be changed)
nic2: Name: ovn-kubernetes1  Type: bridge (Set by default and can't be changed) 
(attachment: "set network mapping"
The VM import fails on:
"The virtual machine could not be imported.
VMCreationFailed: Error while creating virtual machine openshift-cnv/cirros-istein: admission webhook "virtualmachine-validator.kubevirt.io" denied the request: more than one interface is connected to a pod network in spec.template.spec.interfaces"
(attachment: "vm-import-failure")

Note that when setting the nics in a reverse order, make the VM import work,
but with wrong networks. see bug 1850482.

Version-Release number of selected component (if applicable):
CNV-2.4
vm-import-operator: quay.io/kubevirt/vm-import-operator:v0.0.3
vm-import-controller: quay.io/kubevirt/vm-import-controller:v0.0.3

How reproducible:
100%

Additional info:
This was used to create the new network:

$ oc apply -f second_network.yaml


second_network.yaml:
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: ovn-kubernetes1
spec:
  config: '{
      "cniVersion": "0.3.1",
      "type": "cnv-bridge",
      "bridge": "br1"
    }'

Comment 1 Ilanit Stein 2020-06-24 12:30:45 UTC
Created attachment 1698587 [details]
set network mapping

Comment 2 Ilanit Stein 2020-06-24 12:31:39 UTC
Created attachment 1698588 [details]
vm-import-failure

Comment 3 Ilanit Stein 2020-06-24 12:32:25 UTC
Created attachment 1698589 [details]
VM yaml

Comment 4 Ilanit Stein 2020-06-24 12:36:29 UTC
Created attachment 1698591 [details]
vm-import-controller.log

Comment 5 Jakub Dzon 2020-06-24 12:41:04 UTC
Please provide VM Import CR YAML int its state after the import.

Comment 6 Ilanit Stein 2020-06-28 10:47:59 UTC
Created attachment 1699022 [details]
vm import CR yaml

Comment 7 Piotr Kliczewski 2020-06-29 06:56:39 UTC
In provided CR there is one mapped network:

        networkMappings:
        - source:
            id: 324d9357-4d0b-41c0-a28a-8aaae904b3ae
          type: pod

so because of the defaults we attempt to use pod network for both interfaces. Can we check this from the api to be sure that it is only a UI issue?

Comment 8 Jakub Dzon 2020-06-29 07:06:18 UTC
Yes. I will check it. There might be something going on on the back-end as well.

Comment 9 Jakub Dzon 2020-06-29 07:12:33 UTC
We may want to make sure that we don't attempt to create VM with more than one pod network (default settings or not) by adding proper resource mapping validation.

Comment 10 Jakub Dzon 2020-06-29 08:17:54 UTC
Because both nics use the same vnic profile, both will be mapped to the same target; the UI set only one mapping in the VM import CR (to pod network) and as a result both nics were mapped to a pod network, which is an illegal kubevirt configuration.

I can only speculate that UI holds the mapping of vnic profile ID to target in a map (which by itself has unique keys) and eventually the resource mapping in the import CR is created with whichever nic mapping was added to the map last.

Please re-test with nics that use different vnic profiles.

Comment 11 Ilanit Stein 2020-06-30 05:50:32 UTC
Import VM with 2 nics on 2 different vnic profiles via UI:
Map
network1 to pod
network2 to new network added

VM import works fine.
The VM created on CNV had these networks, which are exactly as set in the wizard:
nic1: Pod Networking	masquerade
nic2: ovn-kubernetes1	bridge

Comment 12 Jakub Dzon 2020-06-30 11:17:43 UTC
The core problem of this and 1850482 bugs is the same - marking as a duplicate.

*** This bug has been marked as a duplicate of bug 1850482 ***


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