Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-13144

Nova metadata service doesn't process ipless ports properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Can't Do
    • Icon: Normal Normal
    • None
    • None
    • openstack-nova
    • Important

      Description of problem:
      After bug #2081254 was fixed in RHOSP 17.1 it is possible to attach ports without IP addresses to VMs. Feature itself works as expected, but Nova doesn't create consistent network_data.json for this scenario: ipless ports are not added to 'links' list.

      The reason is that network_info for ipless ports contains empty list of subnets:
      {"id": "24e7183c-6e96-44cb-be67-b76f93dc8a6b", "address": "fa:16:3e:3a:a6:fa", "network": {"id": "720efe1b-e34c-4cc4-b9f8-6f186f6e0443", "bridge": "br-int", "label": "internal-2", "subnets": [], "meta": {"injected": false, "tenant_id": "3ff81dd8d02b450cb7b0da6197c33a93", "mtu": 1442, "physical_network": null, "tunneled": true}}, "type": "ovs", "details":

      {"port_filter": true, "connectivity": "l2"}

      , "devname": "tap24e7183c-6e", "ovs_interfaceid": "24e7183c-6e96-44cb-be67-b76f93dc8a6b", "qbh_params": null, "qbg_params": null, "active": true, "vnic_type": "normal", "profile": {}, "preserve_on_delete": true, "delegate_create": true, "meta": {}}

      As a result, netutils library skips adding such VIFs to 'links' list (empty 'subnets' -> VIF is skipped): https://github.com/openstack/nova/blob/e2ef2240b1e732b359d29457cc12abc7554fa286/nova/virt/netutils.py#L189

      This is inconsistent: 'links' list contains information about L2 connection and doesn't require IP address/subnet.

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

      How reproducible:

      $ openstack port create --disable-port-security --no-security-group --network external-net --fixed-ip "subnet=external-sub" port1
      $ openstack port create --disable-port-security --no-security-group --network testnet --no-fixed-ip port2
      $ openstack server create --image testimage --flavor m1.nano --port port1 --port port2 testvm1

      Inside test VM:

      1. mount -o ro /dev/sr0 /mnt
      2. cat /mnt/openstack/2020-10-14/network_data.json
        Unknown macro: {"links"}

      Actual results:
      'links' list doesn't contain ipless ports

      Expected results:
      'links' list contains ipless ports

              Unassigned Unassigned
              jira-bugzilla-migration RH Bugzilla Integration
              RH Bugzilla Integration RH Bugzilla Integration
              rhos-dfg-compute
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: