commit 2261302ed27c8d0fd43d42f567641b8f1e15636b Author: Julia Kreger Date: Fri Oct 9 07:26:09 2020 -0700 Log the ports we bind in flat While trying to troubelshoot the standalone job's rescue failures, I noticed we didn't log the VIF port ID of the port we use for rescue. Which makes it far more difficult to backtrack and try and figure out where things went sideways. So it seems clear we should log the ports we succeed at binding, and thus the flat driver now keeps a quick list of ports bound and will log that as a result. Change-Id: Id66e5398ee3a1e1630262a229ee6c706b7e62a08 diff --git a/ironic/drivers/modules/network/flat.py b/ironic/drivers/modules/network/flat.py index b5fd9fb..7e54bd9 100644 --- a/ironic/drivers/modules/network/flat.py +++ b/ironic/drivers/modules/network/flat.py @@ -55,6 +55,7 @@ class FlatNetwork(common.NeutronVIFPortIDMixin, def _bind_flat_ports(self, task): LOG.debug("Binding flat network ports") + bound_ports = [] for port_like_obj in task.ports + task.portgroups: vif_port_id = ( port_like_obj.internal_info.get(common.TENANT_VIF_KEY) @@ -68,12 +69,15 @@ class FlatNetwork(common.NeutronVIFPortIDMixin, try: neutron.update_neutron_port(task.context, vif_port_id, port_attrs) + bound_ports.append(vif_port_id) except openstack_exc.OpenStackCloudException as e: msg = (_('Unable to set binding:host_id for ' 'neutron port %(port_id)s. Error: ' '%(err)s') % {'port_id': vif_port_id, 'err': e}) LOG.exception(msg) raise exception.NetworkError(msg) + LOG.debug("Finished binding flat network ports, attached: %s", + ' '.join(bound_ports)) def _unbind_flat_ports(self, task): node = task.node