Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1687601

Summary: Get mac address is in use ERROR when using a flat network
Product: Red Hat OpenStack Reporter: Bob Fournier <bfournie>
Component: openstack-ironicAssignee: Harald Jensås <hjensas>
Status: CLOSED DUPLICATE QA Contact: mlammon
Severity: medium Docs Contact:
Priority: medium    
Version: 14.0 (Rocky)CC: bfournie, hjensas, mburns, mlammon
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1687599 Environment:
Last Closed: 2019-03-12 13:56:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1668858, 1687599    
Bug Blocks:    

Description Bob Fournier 2019-03-11 21:03:46 UTC
+++ This bug was initially created as a clone of Bug #1687599 +++

Openstack Ironic need to set the mac address of neutron port to the actual mac address of the hardware for DHCP/PXE deployment to work. When using pre-created neutron ports there is an issue where previously used ports cause a conflict when a new instance is scheduled onto the same baremetal hosts.

The same thing can happen when an error occur while spawning an instance. Nova will re-schedule, and the neutron port will end up with the mac address of the Ironic node last attempted to use. When a user tries to create another instance the same Ironic node can be selected, when it is the new instance will fail to build because Ironic tries to update the new instance's neutron port with the mac address of the neutron port associated with the instance that failed to build.

Example:

openstack port create --network private test-port1
openstack port create --network private test-port2
openstack server create \
   --image cirros-0.3.5-x86_64-disk \
   --port test-port1\
   --flavor baremetal \
   test-server
  openstack server delete test-server
openstack server create \
   --image cirros-0.3.5-x86_64-disk \
   --port test-port2 \
   --flavor baremetal \
   test-server
The second server create command fails with:
fault:
code: 500
created: '2018-04-29T12:21:37Z'
< .. snip .. >
message: 'Build of instance 5982f29a-3d48-4eb8-88ca-cf794c8f31dd aborted: Failure prepping block device.'

And in conductor log:
Apr 29 14:21:35 ironic-devstack.lab.example.com ironic-conductor[445]: ERROR ironic.common.neutron MacAddressInUseClient: Unable to complete operation for network 52497681-18f4-47de-b48e-1265799caea9. The mac address 52:54:00:53:b5:b9 is in use.

Comment 1 Bob Fournier 2019-03-12 13:56:13 UTC
We already of a bug tracking this, moving to DUP.

*** This bug has been marked as a duplicate of bug 1668860 ***