VMware: fix exception when using multiple compute nodes

When there is more than one compute node running and one of the
nodes restarts it terminates on an exception that the resource is
not found.

The cause of the issue is that a vif plug was being attempted for
a resource that did not exist. The vif plug should have raised an
"NotImplemented" exception.

Change-Id: I5a3f1cc73a981173b6c2fa493de3aad10a7e97fd
Closes-bug: #1272286
(cherry picked from commit d46f4a5b6d)
This commit is contained in:
Gary Kotton 2014-01-26 08:57:14 -08:00 committed by Tracy Jones
parent fec6bc0bec
commit 2885173947
2 changed files with 0 additions and 28 deletions

View File

@ -372,14 +372,6 @@ class VMwareESXDriver(driver.ComputeDriver):
"""inject network info for specified instance."""
self._vmops.inject_network_info(instance, network_info)
def plug_vifs(self, instance, network_info):
"""Plug VIFs into networks."""
self._vmops.plug_vifs(instance, network_info)
def unplug_vifs(self, instance, network_info):
"""Unplug VIFs from networks."""
self._vmops.unplug_vifs(instance, network_info)
def list_instance_uuids(self):
"""List VM instance UUIDs."""
uuids = self._vmops.list_instances()
@ -733,16 +725,6 @@ class VMwareVCDriver(VMwareESXDriver):
_vmops = self._get_vmops_for_compute_node(instance['node'])
_vmops.inject_network_info(instance, network_info)
def plug_vifs(self, instance, network_info):
"""Plug VIFs into networks."""
_vmops = self._get_vmops_for_compute_node(instance['node'])
_vmops.plug_vifs(instance, network_info)
def unplug_vifs(self, instance, network_info):
"""Unplug VIFs from networks."""
_vmops = self._get_vmops_for_compute_node(instance['node'])
_vmops.unplug_vifs(instance, network_info)
class VMwareAPISession(object):
"""

View File

@ -1584,16 +1584,6 @@ class VMwareVMOps(object):
client_factory = self._session._get_vim().client.factory
self._set_machine_id(client_factory, instance, network_info)
def plug_vifs(self, instance, network_info):
"""Plug VIFs into networks."""
msg = _("VIF plugging is not supported by the VMware driver.")
raise NotImplementedError(msg)
def unplug_vifs(self, instance, network_info):
"""Unplug VIFs from networks."""
msg = _("VIF unplugging is not supported by the VMware driver.")
raise NotImplementedError(msg)
class VMwareVCVMOps(VMwareVMOps):
"""Management class for VM-related tasks.