MAC address of direct-physical port is not updated during migration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Balazs Gibizer | ||
neutron |
Fix Released
|
Medium
|
Balazs Gibizer |
Bug Description
Description
===========
Nova update the MAC of the direct-physical port based on the MAC of the PF selected during the initial boot of the VM. But Nova does not update the MAC when the VM is migrated to another compute and therefore using another PF.
Steps to reproduce
==================
Needs a multi node devstack with available SRIOV PFs.
stack@master0:~$ openstack hypervisor list
+----+-
| ID | Hypervisor Hostname | Hypervisor Type | Host IP | State |
+----+-
| 1 | master0 | QEMU | 10.1.0.21 | up |
| 2 | node0 | QEMU | 10.1.0.22 | up |
+----+-
stack@master0:~$ mysql -D nova_cell1 -e "select status, address, parent_addr, dev_type, compute_node_id, product_id, instance_uuid from pci_devices;"
+------
| status | address | parent_addr | dev_type | compute_node_id | product_id | instance_uuid |
+------
| available | 0000:81:00.0 | NULL | type-PF | 1 | 154d | NULL |
| available | 0000:81:00.1 | NULL | type-PF | 1 | 154d | NULL |
| available | 0000:81:10.0 | 0000:81:00.0 | type-VF | 1 | 10ed | NULL |
| available | 0000:81:10.2 | 0000:81:00.0 | type-VF | 1 | 10ed | NULL |
| available | 0000:81:10.4 | 0000:81:00.0 | type-VF | 1 | 10ed | NULL |
| available | 0000:81:10.6 | 0000:81:00.0 | type-VF | 1 | 10ed | NULL |
| available | 0000:81:00.0 | NULL | type-PF | 2 | 154d | NULL |
| available | 0000:81:00.1 | NULL | type-PF | 2 | 154d | NULL |
| available | 0000:81:10.0 | 0000:81:00.0 | type-VF | 2 | 10ed | NULL |
| available | 0000:81:10.2 | 0000:81:00.0 | type-VF | 2 | 10ed | NULL |
| available | 0000:81:10.4 | 0000:81:00.0 | type-VF | 2 | 10ed | NULL |
| available | 0000:81:10.6 | 0000:81:00.0 | type-VF | 2 | 10ed | NULL |
+------
These are the PF MAC's
stack@master0:~$ ip a | grep b4:96:91:34
link/ether b4:96:91:34:f4:34 brd ff:ff:ff:ff:ff:ff
link/ether b4:96:91:34:f4:36 brd ff:ff:ff:ff:ff:ff
stack@node0:~/nova$ ip a | grep b4:96:91:34
link/ether b4:96:91:34:ed:d4 brd ff:ff:ff:ff:ff:ff
link/ether b4:96:91:34:ed:d6 brd ff:ff:ff:ff:ff:ff
1) create a port with vnic_type=
stack@master0:~$ openstack port show port-direct-
+------
| Field | Value |
+------
| admin_state_up | UP |
| allowed_
| binding_host_id | |
| binding_profile | physical_
| binding_vif_details | |
| binding_vif_type | unbound |
| binding_vnic_type | direct-physical |
| created_at | 2021-08-
| data_plane_status | None |
| description | |
| device_id | |
| device_owner | |
| device_profile | None |
| dns_assignment | None |
| dns_domain | None |
| dns_name | None |
| extra_dhcp_opts | |
| fixed_ips | ip_address=
| id | 864ee6f2-
| ip_allocation | None |
| mac_address | fa:16:3e:71:fe:26 |
| name | port-direct-
| network_id | 96d669e1-
| numa_affinity_
| port_security_
| project_id | 493cf4fe555d4ea
| propagate_
| qos_network_
| qos_policy_id | None |
| resource_request | None |
| revision_number | 10 |
| security_group_ids | 16150c45-
| status | DOWN |
| tags | |
| trunk_details | None |
| updated_at | 2021-09-
+------
2) boot a VM with that port
stack@master0:~$ openstack --os-compute-
+------
| Field | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | active |
| OS-SRV-
| OS-SRV-
| accessIPv4 | |
| accessIPv6 | |
| addresses | net0=10.0.4.227 |
| adminPass | B5Zje4m3vbq6 |
| config_drive | |
| created | 2021-09-
| description | None |
| flavor | disk='1', ephemeral='0', extra_specs.
| hostId | 512757d0f0cb65d
| host_status | UP |
| id | 4707526d-
| image | cirros-
| key_name | None |
| locked | False |
| locked_reason | None |
| name | vm1 |
| progress | 0 |
| project_id | 493cf4fe555d4ea
| properties | |
| security_groups | name='default' |
| server_groups | [] |
| status | ACTIVE |
| tags | |
| trusted_
| updated | 2021-09-
| user_id | e08f3a84c1484d6
| volumes_attached | |
+------
3) Observer the the VM is booted on node0 and check that the MAC of the port is updated to the mac of one of the PF on node0
stack@master0:~$ openstack port show port-direct-
| mac_address | b4:96:91:34:ed:d6 |
4) Cold migrate the VM
stack@master0:~$ openstack server migrate vm1
stack@master0:~$ openstack server migration confirm vm1
5) Observe that the VM is now running on master0 but MAC of the port is not changed
stack@master0:~$ openstack server show vm1 | grep hypervisor
| OS-EXT-
stack@master0:~$ openstack port show port-direct-
| mac_address | b4:96:91:34:ed:d6 |
Expected behavior
=================
The MAC of the neutron port is updated according the the MAC of the PF on master0
Environment
===========
multinode devstack on recent master (nova on 033af94179)
Changed in neutron: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in nova: | |
assignee: | nobody → Balazs Gibizer (balazs-gibizer) |
Changed in neutron: | |
assignee: | nobody → Balazs Gibizer (balazs-gibizer) |
Nova updates the MAC during initial boot via https:/ /opendev. org/openstack/ nova/src/ commit/ d20c1926553a6dc c50597a4ad14fcf 93ad0b4b78/ nova/network/ neutron. py#L1173 but that code path is not called during cold migration