Description of problem: When starting VM connected to Network Attachment Definition configured for CNV Linux Bridge and VLAN ID specified, Virt-launcher pod fails to start. Version-Release number of selected component (if applicable): Server Version: 4.5.13 Kubernetes Version: v1.18.3+47c0e71 Openshift Virtualization (kubevirt-hyperconverged-operator.v2.4.2) How reproducible: Simple Steps to Reproduce: 1. Configure bridge on nodes using nncp (nmstate): apiVersion: nmstate.io/v1alpha1 kind: NodeNetworkConfigurationPolicy metadata: name: br874-cnv-policy-create spec: nodeSelector: node-role.kubernetes.io/worker: "" desiredState: interfaces: - name: br874 description: Linux bridge for VM connectivity for VLAN 874 type: linux-bridge state: up ipv4: dhcp: false enabled: false bridge: options: stp: enabled: false port: - name: bond0.874 2. Configure NAD: apiVersion: k8s.cni.cncf.io/v1 kind: NetworkAttachmentDefinition metadata: annotations: k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/br874 creationTimestamp: "2020-10-16T16:44:18Z" generation: 1 managedFields: - apiVersion: k8s.cni.cncf.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:k8s.v1.cni.cncf.io/resourceName: {} f:spec: .: {} f:config: {} manager: Mozilla operation: Update time: "2020-10-16T16:44:18Z" name: br-cnv-vlan874-tagged namespace: billtest resourceVersion: "34926902" selfLink: /apis/k8s.cni.cncf.io/v1/namespaces/billtest/network-attachment-definitions/br-cnv-vlan874-tagged uid: 631965d1-d43a-41b9-9919-16eef3352398 spec: config: '{"name":"br-cnv-vlan874-tagged","cniVersion":"0.3.1","plugins":[{"type":"cnv-bridge","bridge":"br874","vlan":"874","ipam":{}},{"type":"cnv-tuning"}]}' 3. Attach VM network interface to NAD and power up. Actual results: During startup of the VM, Virt-launcher does not start, produces error as follows: virt-launcher-vm-example2-fvvvj (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to create pod network sandbox k8s_virt-launcher-vm-example2-fvvvj_billtest_7f27b670-bb9e-4e13-b29e-7365c055eeb8_0(7431a2aef650db7bda329b07d5e91763b7d7990abb513b435859197c01239d96): Multus: [billtest/virt-launcher-vm-example2-fvvvj]: error adding container to network "br-cnv-vlan874-tagged": delegateAdd: error invoking conflistAdd - "br-cnv-vlan874-tagged": conflistAdd: error in getting result from AddNetworkList: failed to load netconf: json: cannot unmarshal string into Go struct field NetConf.vlan of type int Expected results: Expect VM to power up. Additional info:
looks like vlan value in net-attach-def is quoted as string: #### config: '{"name":"br-cnv-vlan874-tagged","cniVersion":"0.3.1","plugins":[{"type":"cnv-bridge","bridge":"br874","vlan":"874","ipam":{}},{"type":"cnv-tuning"}]}' #### so the bridge CNI complains the type error: ### failed to load netconf: json: cannot unmarshal string into Go struct field NetConf.vlan of type int ### you might need to create the net-attach-def using integer vlan value (remove the double quotes)
Thanks Zenghui. Bill, could you try the suggested change with VLAN?
Hi, Thanks for the info. I modified the Network Attachment Definition using the integer value of the VLAN and the VM powered up. Just note, that initially I created the Network Attachment Definition using the GUI panel, specifying: Network Type = CNV Linux Bridge VLAN Tag Number: 888 The resulting yaml had the vlan as string ("888"). --Bill Souhrada
Thanks Bill, that explains it. We tracked that issue via https://bugzilla.redhat.com/show_bug.cgi?id=1858317 and it should be fixed in 4.6.
*** This bug has been marked as a duplicate of bug 1858317 ***