Bug 1856347 - SR-IOV : Missing network name for sriov during vm setup
Summary: SR-IOV : Missing network name for sriov during vm setup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Networking
Version: 2.4.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 2.6.0
Assignee: oshoval
QA Contact: Meni Yakove
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-13 12:49 UTC by Geetika Kapoor
Modified: 2021-03-10 11:18 UTC (History)
3 users (show)

Fixed In Version: virt-launcher-container-v2.6.0-74
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-10 11:16:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
yaml_config_vm (1.80 KB, text/plain)
2020-07-13 12:49 UTC, Geetika Kapoor
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:0799 0 None None None 2021-03-10 11:18:24 UTC

Description Geetika Kapoor 2020-07-13 12:49:56 UTC
Created attachment 1700836 [details]
yaml_config_vm

Description of problem:

Interface name for sriov is found missing during vm setup.
This is useful to track if vm is setup using which sriov or bridge basically to find the network backend.

For vm with interfaces:

          interfaces:
          - masquerade: {}
            name: default
          - name: sriov-test-network
            sriov: {}
          rng: {}
        machine:
          type: ''
        resources:
          requests:
            memory: 1024Mi

oc get vmi <> -o yaml shows:

  interfaces:
  - interfaceName: eth1
    ipAddress: 10.129.2.104
    ipAddresses:
    - 10.129.2.104
    mac: 02:b1:38:00:00:08
    name: default
  - interfaceName: eth0
    ipAddress: 10.46.41.129/24
    ipAddresses:
    - 10.46.41.129/24
    - 2620:52:0:2e29:b1:38ff:fe00:9/64
    - fe80::b1:38ff:fe00:9/64
    mac: 02:b1:38:00:00:09


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

# oc get csv -n openshift-cnv | awk ' { print $4 } ' | tail -n1
2.4.0


How reproducible:
always 

Steps to Reproduce:
1.Use the attached vm file to reproduce the issue.
2.
3.

Actual results:

interface name missing.

Expected results:

interface name should be displayed so that it's easy to understand the backend network.

Additional info:

Comment 2 Petr Horáček 2020-09-30 14:24:41 UTC
We are after the feature freeze. Since this bug affects only reporting, I'm deferring it to 2.6.

Comment 3 oshoval 2020-11-17 07:06:38 UTC
Fixed by 
https://github.com/kubevirt/kubevirt/pull/4335

Please see the known limitation in the Release notes of the PR:
VMI status displays SRIOV interfaces with their network name only when they have originally
been defined with an explicit MAC address in the VMI spec.

Comment 4 yzaindbe 2020-12-03 01:10:06 UTC
NOT FIXED

ENVIRONMENT:
-----------
(on BM with OCP 4.6 after CNV upgrade 2.5->2.6)
CNV: 2.6.0
virt-launcher-container-v2.6.0-80


vmi config:
-----------
  interfaces:
  - masquerade: {}
    name: default
  - name: example-sriovnetwork
    sriov: {}
    macAddress: 02:01:00:00:00:00


vmi status:
-----------
$ oc get vmi vmi-sriov -oyaml

  interfaces:
  - ipAddress: 10.128.2.143
    ipAddresses:
    - 10.128.2.143
    mac: 02:00:00:90:1b:8b
    name: default

(sriov interface doesn't appear at all)


from vmi console:
----------------
[fedora@vmi-sriov ~]$ ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 02:00:00:90:1b:8b brd ff:ff:ff:ff:ff:ff
    altname enp3s0
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 02:01:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    altname enp2s1
    altname ens1

Comment 5 oshoval 2020-12-03 06:26:38 UTC
Hi Yoav,
Please post the whole vm/vmi yaml use used, including the cloud-init part and all the spec.

Also please note that if you don't see the interface, it might be because you need to wait up to 2 minutes
for the guest-agent to report the interfaces.

Thanks

Comment 6 oshoval 2020-12-03 06:28:27 UTC
I see now that your VM doesnt have ip, this is what we must solve first
by the right configuration.

See please
https://bugzilla.redhat.com/show_bug.cgi?id=1874812#c1
for how to config the cloud-init in the right way,
it must use the right interface according MAC address, and the right nmcli commands.

Comment 7 oshoval 2020-12-03 06:36:08 UTC
Please use ip address command instead ip link.

Comment 8 yzaindbe 2020-12-06 06:44:49 UTC
Hi Or,
after applying this yaml I still didnt see any other interfaces in vmi status, even after a few minutes:

apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachineInstance
metadata:
  labels:
    special: vmi-sriov
  name: vmi-sriov
spec:
  domain:
    devices:
      disks:
      - disk:
          bus: virtio
        name: containerdisk
      - disk:
          bus: virtio
        name: cloudinitdisk
      interfaces:
      - masquerade: {}
        name: default
      - name: example-sriovnetwork
        sriov: {}
        macAddress: 02:01:00:00:00:00
      rng: {}
    machine:
      type: ""
    resources:
      requests:
        memory: 1024M
  networks:
  - name: default
    pod: {}
  - multus:
      networkName: openshift-sriov-network-operator/example-sriovnetwork
    name: example-sriovnetwork
  terminationGracePeriodSeconds: 0
  volumes:
  - containerDisk:
      image: kubevirt/fedora-cloud-container-disk-demo:latest
    name: containerdisk
  - cloudInitNoCloud:
      userData: |
        #cloud-config
        password: fedora
        chpasswd: { expire: False }
        bootcmd:
          - MAC=02:01:00:00:00:00
          - IFACE=$(ip --brief l | grep $MAC | cut -f1 -d' ')
          - nmcli con add type ethernet con-name $IFACE ifname $IFACE
          - nmcli con mod $IFACE ipv4.addresses 10.200.3.1/24 ipv4.method manual connection.autoconnect-priority 1 ipv6.method ignore
          - nmcli con up $IFACE
    name: cloudinitdisk

Comment 9 oshoval 2020-12-06 07:25:21 UTC
Please make sure you have guest agent installed

Comment 10 yzaindbe 2020-12-06 10:57:57 UTC
ok bug is resolved because when you do see the sriov interface the name is shown.
there is another bug though that secondary interface comes and goes in yaml status.guest os info.interfaces.
Do we have a bug in bugzilla for it?

Comment 11 oshoval 2020-12-06 11:02:26 UTC
Not that i know of, maybe Geetika opened one about it,
Can you please look if there is a bugzilla by Geetika, and if not open one please?

Thanks

Comment 16 errata-xmlrpc 2021-03-10 11:16:31 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 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


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