diff options
Diffstat (limited to 'nova/virt/ironic/driver.py')
-rw-r--r-- | nova/virt/ironic/driver.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/nova/virt/ironic/driver.py b/nova/virt/ironic/driver.py index 1bea9e55ff..bb88fca214 100644 --- a/nova/virt/ironic/driver.py +++ b/nova/virt/ironic/driver.py @@ -1688,13 +1688,21 @@ class IronicDriver(virt_driver.ComputeDriver): def plug_vifs(self, instance, network_info): """Plug VIFs into networks. + This method is present for compatability. Any call will result + in a DEBUG log entry being generated, and will otherwise be + ignored, as Ironic manages VIF attachments through a node + lifecycle. Please see ``attach_interface``, which is the + proper and current method to utilize. + :param instance: The instance object. :param network_info: Instance network information. """ - # instance.node is the ironic node's UUID. - node = self._get_node(instance.node) - self._plug_vifs(node, instance, network_info) + LOG.debug('VIF plug called for instance %(instance)s on node ' + '%(node)s, however Ironic manages VIF attachments ' + 'for nodes.', + {'instance': instance.uuid, + 'node': instance.node}) def unplug_vifs(self, instance, network_info): """Unplug VIFs from networks. @@ -1725,7 +1733,8 @@ class IronicDriver(virt_driver.ComputeDriver): # event from neutron or by _heal_instance_info_cache periodic task. In # both cases, this is done asynchronously, so the cache may not be up # to date immediately after attachment. - self.plug_vifs(instance, [vif]) + node = self._get_node(instance.node) + self._plug_vifs(node, instance, [vif]) def detach_interface(self, context, instance, vif): """Use hotunplug to remove a network interface from a running instance. @@ -2042,7 +2051,9 @@ class IronicDriver(virt_driver.ComputeDriver): """ try: - self.plug_vifs(instance, network_info) + node = self._get_node(instance.node) + self._plug_vifs(node, instance, network_info) + except Exception: with excutils.save_and_reraise_exception(): LOG.error("Error preparing deploy for instance " |