diff options
| author | Brent Eagles <beagles@redhat.com> | 2013-06-06 15:33:42 -0230 |
|---|---|---|
| committer | Brent Eagles <beagles@redhat.com> | 2013-06-25 15:43:27 -0230 |
| commit | db3989586a8d5bbbcf857b9294a124ecc5fc57e8 (patch) | |
| tree | ca857e6ef4dbd6074a54259b6e94543e29e88372 /nova/compute | |
| parent | 9331c5c1115c7d8cc5bcab71b1100eeea1ce72fe (diff) | |
| download | nova-db3989586a8d5bbbcf857b9294a124ecc5fc57e8.tar.gz nova-db3989586a8d5bbbcf857b9294a124ecc5fc57e8.tar.xz nova-db3989586a8d5bbbcf857b9294a124ecc5fc57e8.zip | |
Refresh volume connections when starting instances
This patches adds network and block device information to the signature
of the power_on method on the virtualization driver. The relevant call
sites are also modified to provide the required information. The libvirt
implementation of power_on has been altered to re-establish network and
volume related connections.
Fixes bug: 1188326
Change-Id: If617b570e082e3aa321414a2680a3aa0754f6153
Diffstat (limited to 'nova/compute')
| -rwxr-xr-x | nova/compute/manager.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 22881f5bd..a242a121d 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1540,7 +1540,14 @@ class ComputeManager(manager.SchedulerDependentManager): def start_instance(self, context, instance): """Starting an instance on this host.""" self._notify_about_instance_usage(context, instance, "power_on.start") - self.driver.power_on(instance) + + network_info = self._get_instance_nw_info(context, instance) + block_device_info = self._get_instance_volume_block_device_info( + context, instance) + self.driver.power_on(context, instance, + self._legacy_nw_info(network_info), + block_device_info) + current_power_state = self._get_power_state(context, instance) instance.power_state = current_power_state instance.vm_state = vm_states.ACTIVE @@ -1595,7 +1602,12 @@ class ComputeManager(manager.SchedulerDependentManager): except NotImplementedError: # Fallback to just powering on the instance if the hypervisor # doesn't implement the restore method - self.driver.power_on(instance) + network_info = self._get_instance_nw_info(context, instance) + block_device_info = self._get_instance_volume_block_device_info( + context, instance) + self.driver.power_on(context, instance, + self._legacy_nw_info(network_info), + block_device_info) current_power_state = self._get_power_state(context, instance) instance = self._instance_update(context, instance['uuid'], power_state=current_power_state, |
