Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-45757

[multi-homing IPAM] - Error message not clear when the IP pool is exhausted

XMLWordPrintable

    • 0.42
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • ---
    • ---
    • None

      Description of problem:

      When there are no available IP addresses in the IP pool, the VM will not start. The error message in the virt launcher pod is not clear.

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

      v4.17

      How reproducible:

      Define a NAD with IPAM defining a small range, and exhaust the pool.

      Steps to Reproduce:

      1. Create a namespace:
      oc new-project localnet-ipam
      
      2. Create a NAD with a small IP range:
      cat << EOF | oc create -f -                                                 
      apiVersion: k8s.cni.cncf.io/v1
      kind: NetworkAttachmentDefinition
      metadata:
        name: ipam-localnet-nad
      spec:
        config: |2
          {
                  "cniVersion": "0.4.0",
                  "name": "tenantblue-network",
                  "type": "ovn-k8s-cni-overlay",
                  "topology":"localnet",
                  "subnets": "192.168.10.0/30",
                  "excludeSubnets": "192.168.10.1/32",
                  "allowPersistentIPs": true,
                  "netAttachDefName": "localnet-ipam/ipam-localnet-nad"
          }
      EOF
      
      3. Create a VM (it will get the only IP available in the pool):
      cat << EOF | oc create -f -  
      apiVersion: kubevirt.io/v1
      kind: VirtualMachine
      metadata:
        creationTimestamp: null
        labels:
          kubevirt.io/vm: vma-localnet-ipam
        name: vma-localnet-ipam
      spec:
        running: true
        template:
          metadata:
            creationTimestamp: null
            labels:
              kubevirt.io/domain: vma-localnet-ipam
              kubevirt.io/vm: vma-localnet-ipam
          spec:
            domain:
              devices:
                disks:
                - disk:
                    bus: virtio
                  name: containerdisk
                - disk:
                    bus: virtio
                  name: cloudinitdisk
                interfaces:
                - masquerade: {}
                  name: default
                - bridge: {}
                  name: ipam-network
                rng: {}
              machine:
                type: ''
              resources:
                requests:
                  memory: 1024Mi
            networks:
            - name: default
              pod: {}
            - multus:
                networkName: localnet-ipam/ipam-localnet-nad
              name: ipam-network
            volumes:
            - containerDisk:
                image: quay.io/openshift-cnv/qe-cnv-tests-fedora:39
              name: containerdisk
            - cloudInitNoCloud:
                userData: |-
                  #cloud-config
                  user: fedora
                  password: password
                  chpasswd: { expire: False }
              name: cloudinitdisk
      EOF
      4. Create another VM:
      cat << EOF | oc create -f -  
      apiVersion: kubevirt.io/v1
      kind: VirtualMachine
      metadata:
        creationTimestamp: null
        labels:
          kubevirt.io/vm: vmb-localnet-ipam
        name: vmb-localnet-ipam
      spec:
        running: true
        template:
          metadata:
            creationTimestamp: null
            labels:
              kubevirt.io/domain: vmb-localnet-ipam
              kubevirt.io/vm: vmb-localnet-ipam
          spec:
            domain:
              devices:
                disks:
                - disk:
                    bus: virtio
                  name: containerdisk
                - disk:
                    bus: virtio
                  name: cloudinitdisk
                interfaces:
                - masquerade: {}
                  name: default
                - bridge: {}
                  name: ipam-network
                rng: {}
              machine:
                type: ''
              resources:
                requests:
                  memory: 1024Mi
            networks:
            - name: default
              pod: {}
            - multus:
                networkName: localnet-ipam/ipam-localnet-nad
              name: ipam-network
            volumes:
            - containerDisk:
                image: quay.io/openshift-cnv/qe-cnv-tests-fedora:39
              name: containerdisk
            - cloudInitNoCloud:
                userData: |-
                  #cloud-config
                  user: fedora
                  password: password
                  chpasswd: { expire: False }
              name: cloudinitdisk
      EOF
      
      

      Actual results:

      The event section of the virt launcher pod for the second VM (vmb):
      Events:
        Type     Reason                  Age   From               Message
        ----     ------                  ----  ----               -------
        Normal   Scheduled               5m9s  default-scheduler  Successfully assigned localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv to net-awax-417-jsfcg-worker-0-skwx2
        Warning  FailedCreatePodSandBox  3m8s  kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to create pod network sandbox k8s_virt-launcher-vmb-localnet-ipam-zxgxv_localnet-ipam_95789cf1-02a7-46e4-a1c0-3bb96d491a93_0(860a275ec4ad7fc653d516f0765ecf7f2e601153da638b350902054915a05dc6): error adding pod localnet-ipam_virt-launcher-vmb-localnet-ipam-zxgxv to CNI network "multus-cni-network": plugin type="multus-shim" name="multus-cni-network" failed (add): CmdAdd (shim): CNI request failed with status 400: 'ContainerID:"860a275ec4ad7fc653d516f0765ecf7f2e601153da638b350902054915a05dc6" Netns:"/var/run/netns/c61361b7-fae9-4369-8ad8-81cf42226a13" IfName:"eth0" Args:"IgnoreUnknown=1;K8S_POD_NAMESPACE=localnet-ipam;K8S_POD_NAME=virt-launcher-vmb-localnet-ipam-zxgxv;K8S_POD_INFRA_CONTAINER_ID=860a275ec4ad7fc653d516f0765ecf7f2e601153da638b350902054915a05dc6;K8S_POD_UID=95789cf1-02a7-46e4-a1c0-3bb96d491a93" Path:"" ERRORED: error configuring pod [localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv] networking: [localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv/95789cf1-02a7-46e4-a1c0-3bb96d491a93:tenantblue-network]: error adding container to network "tenantblue-network": CNI request failed with status 400: '[localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv 860a275ec4ad7fc653d516f0765ecf7f2e601153da638b350902054915a05dc6 network tenantblue-network NAD localnet-ipam/ipam-localnet-nad] [localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv 860a275ec4ad7fc653d516f0765ecf7f2e601153da638b350902054915a05dc6 network tenantblue-network NAD localnet-ipam/ipam-localnet-nad] failed to get pod annotation: timed out waiting for annotations: context deadline exceeded
      '
      ': StdinData: {"binDir":"/var/lib/cni/bin","clusterNetwork":"/host/run/multus/cni/net.d/10-ovn-kubernetes.conf","cniVersion":"0.3.1","daemonSocketDir":"/run/multus/socket","globalNamespaces":"default,openshift-multus,openshift-sriov-network-operator","logLevel":"verbose","logToStderr":true,"name":"multus-cni-network","namespaceIsolation":true,"type":"multus-shim"}
        Warning  FailedCreatePodSandBox  66s  kubelet  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to create pod network sandbox k8s_virt-launcher-vmb-localnet-ipam-zxgxv_localnet-ipam_95789cf1-02a7-46e4-a1c0-3bb96d491a93_0(91efc314224198eb1dd75689d1a2ab32297df110e97d33437c79bdfbcf37c5ef): error adding pod localnet-ipam_virt-launcher-vmb-localnet-ipam-zxgxv to CNI network "multus-cni-network": plugin type="multus-shim" name="multus-cni-network" failed (add): CmdAdd (shim): CNI request failed with status 400: 'ContainerID:"91efc314224198eb1dd75689d1a2ab32297df110e97d33437c79bdfbcf37c5ef" Netns:"/var/run/netns/c57ded9f-df4d-4c8e-bc7e-0d67096ce5d3" IfName:"eth0" Args:"IgnoreUnknown=1;K8S_POD_NAMESPACE=localnet-ipam;K8S_POD_NAME=virt-launcher-vmb-localnet-ipam-zxgxv;K8S_POD_INFRA_CONTAINER_ID=91efc314224198eb1dd75689d1a2ab32297df110e97d33437c79bdfbcf37c5ef;K8S_POD_UID=95789cf1-02a7-46e4-a1c0-3bb96d491a93" Path:"" ERRORED: error configuring pod [localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv] networking: [localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv/95789cf1-02a7-46e4-a1c0-3bb96d491a93:tenantblue-network]: error adding container to network "tenantblue-network": CNI request failed with status 400: '[localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv 91efc314224198eb1dd75689d1a2ab32297df110e97d33437c79bdfbcf37c5ef network tenantblue-network NAD localnet-ipam/ipam-localnet-nad] [localnet-ipam/virt-launcher-vmb-localnet-ipam-zxgxv 91efc314224198eb1dd75689d1a2ab32297df110e97d33437c79bdfbcf37c5ef network tenantblue-network NAD localnet-ipam/ipam-localnet-nad] failed to get pod annotation: timed out waiting for annotations: context deadline exceeded
      '
      ': StdinData: {"binDir":"/var/lib/cni/bin","clusterNetwork":"/host/run/multus/cni/net.d/10-ovn-kubernetes.conf","cniVersion":"0.3.1","daemonSocketDir":"/run/multus/socket","globalNamespaces":"default,openshift-multus,openshift-sriov-network-operator","logLevel":"verbose","logToStderr":true,"name":"multus-cni-network","namespaceIsolation":true,"type":"multus-shim"}
        Normal  AddedInterface  65s (x3 over 5m9s)  multus  Add eth0 [10.129.2.50/23] from ovn-kubernetes
      

      Expected results:

      Error message indicating the lack of available IP in the pool as the cause for the failure.

      Additional info:

       

              ralavi@redhat.com Ram Lavi
              rh-ee-awax Anat Wax
              Miguel Duarte de Mora Barroso
              Yossi Segev Yossi Segev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: