Bug 1850482 - [v2v][VM import from RHV to CNV] 2 nics are mapped to a new network though second was mapped to pod.
Summary: [v2v][VM import from RHV to CNV] 2 nics are mapped to a new network though se...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: V2V
Version: 2.4.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 2.4.0
Assignee: Jakub Dzon
QA Contact: Ilanit Stein
URL:
Whiteboard: v2v
: 1850509 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-24 11:49 UTC by Ilanit Stein
Modified: 2020-07-28 19:10 UTC (History)
7 users (show)

Fixed In Version: v2.4.0-17
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-28 19:10:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
"network map setting screenshot" (55.84 KB, image/png)
2020-06-24 11:55 UTC, Ilanit Stein
no flags Details
"network map outcome screenshot" (29.07 KB, image/png)
2020-06-24 11:57 UTC, Ilanit Stein
no flags Details
VM yaml (4.37 KB, application/octet-stream)
2020-06-24 12:00 UTC, Ilanit Stein
no flags Details
vm-import-controller.log (182.54 KB, text/plain)
2020-06-24 12:02 UTC, Ilanit Stein
no flags Details
vm import cr yaml (7.21 KB, text/plain)
2020-06-28 12:00 UTC, Ilanit Stein
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt vm-import-operator pull 312 0 None closed Block import with more than one source network mapped to a pod network 2020-10-30 11:45:48 UTC
Red Hat Product Errata RHSA-2020:3194 0 None None None 2020-07-28 19:10:50 UTC

Description Ilanit Stein 2020-06-24 11:49:18 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: Name: ovn-kubernetes1  Type: bridge (Set by default and can't be changed) 
nic2: Pod Networking Type: masquerade (Set by default and can't be changed)

The VM import is resulted with setting network ovn-kubernetes1 to both nics 
(attachment "network map outcome screenshot").
 
Version-Release number of selected component (if applicable):
CNV-2.4

How reproducible:
Same behavior Repeated on 3 trials.

Comment 1 Ilanit Stein 2020-06-24 11:55:01 UTC
Created attachment 1698578 [details]
"network map setting screenshot"

Comment 2 Ilanit Stein 2020-06-24 11:57:57 UTC
Created attachment 1698580 [details]
"network map outcome screenshot"

Comment 3 Ilanit Stein 2020-06-24 11:59:38 UTC
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 4 Ilanit Stein 2020-06-24 12:00:48 UTC
Created attachment 1698581 [details]
VM yaml

Comment 5 Ilanit Stein 2020-06-24 12:02:09 UTC
Created attachment 1698583 [details]
vm-import-controller.log

Comment 6 Jakub Dzon 2020-06-24 12:03:37 UTC
Please provide also VM import CR YAML that was created by the wizard.

Comment 7 Ilanit Stein 2020-06-28 12:00:08 UTC
Created attachment 1699028 [details]
vm import cr yaml

Comment 8 Piotr Kliczewski 2020-06-29 06:59:02 UTC
Pod network is not part of the mapping.

        networkMappings:
        - source:
            id: 324d9357-4d0b-41c0-a28a-8aaae904b3ae
          target:
            name: ovn-kubernetes1
          type: multus

Comment 9 Jakub Dzon 2020-06-29 08:08:11 UTC
Source VM defines two network interfaces (nic1 and nic2), which both use the same vnic profile (ovirtmgmt/ovirtmgmt). The network resource mapping is translating source VM's nic's vnic profile to target network so if two nics use the same vnic profile, they will be mapped to the same target network. 
In this case:
1. although UI shows mapping to a pod network for nic2, it doesn't add it to the mapping in import yaml;
2. Multus mapping for nic1 is present in the yaml and because both nic1 and nic2 use the same vnic profile, they are both mapped to the multus network;
3. Even if UI put the mapping for nic2 in the import yaml, it wouldn't work either - the same vnic profile id would be mapped to two different targets.

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

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

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

Comment 11 Jakub Dzon 2020-06-30 11:17:43 UTC
*** Bug 1850509 has been marked as a duplicate of this bug. ***

Comment 12 Filip Krepinsky 2020-06-30 13:49:23 UTC
The conclusion for the UI:
 - UI should detect if nics have same vnicprofile and react to that.
 - Pod network should not be possible to set for these nics and allow only the same multus network

Comment 13 Piotr Kliczewski 2020-06-30 14:22:12 UTC
@Filip, please create a UI bug which would track changes from comment #12.

Comment 14 Jakub Dzon 2020-06-30 16:09:13 UTC
Validation has been added on the back-end side that would block any VM import with more than one network interface mapped to a pod network (either because that was specified explicitly or the nics share the same vnic profile).

Comment 16 Jakub Dzon 2020-07-03 08:24:34 UTC
Fixed in https://github.com/kubevirt/vm-import-operator/pull/312

Comment 17 Ilanit Stein 2020-07-08 19:45:16 UTC
Verified on CNV-2.4 from July 07 2020.

For 2 source networks mapped to target pod network got this import error:


"The virtual machine could not be imported.
VMCreationFailed: Error while creating virtual machine default/vm-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"

@Jakub,
Is there a way to remove the "in spec.template.spec.interfaces" from the error message here?

Comment 18 Jakub Dzon 2020-07-13 06:39:05 UTC
Ilanit,
the part of the message after "VMCreationFailed: Error while creating virtual machine default/vm-istein:" comes from KubeVirt and is added by generic code handling VM creation errors. There may be many other cases when VM CR path is present in the message and they may be helpful in detecting and solving either environment issues or bugs.

Comment 19 Ilanit Stein 2020-07-16 05:20:32 UTC
@Jakub,

OK, thanks for explaining.

Comment 22 errata-xmlrpc 2020-07-28 19:10:39 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, 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-2020:3194


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