ip locked causes boot failed

Nova booting a vm and neutron creating new port would race the port.
If the neutron creates the port before booting vm,
the booting process would be failed as ip/port locked.

Change-Id: Ib5dbbb0b2fbcca17961cddcf983d70779a4dfecd
Closes-Bug: #1505952
This commit is contained in:
Qing Wu Wang 2015-10-19 02:30:27 -05:00
parent 6478bd1764
commit 1408dfd931
1 changed files with 10 additions and 1 deletions

View File

@ -524,7 +524,16 @@ class PowerVCNeutronAgent(object):
# If HyperV/KVM or Lock Port, reserve IP address in PowerVC
if device_id == constants.POWERVC_LOCKDEVICE_ID\
or not self.local.is_instance_on_power(device_id):
new_port = self.pvc.create_port(port)
# RTC 211682 - ip locked issue.
# Nova booting a vm and neutron creating new port would race the port.
# If the neutron creates the port before booting vm,
# the booting process would be failed as ip/port locked.
time.sleep(15)
try:
new_port = self.pvc.create_port(port)
except Exception, msg:
LOG.warn(_("Try to create a port which has been used in booting vm. %s"), msg)
# RTC 211682 - end
if new_port:
self.db.set_port_pvc_id(db_port, new_port.get('id'))