def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None): container_id = self._get_container_id(instance) if not container_id: return self._stop(container_id, instance) try: network.teardown_network(container_id) if network_info: self.unplug_vifs(instance, network_info) except Exception as e: LOG.warning(_('Cannot destroy the container network' ' during reboot {0}').format(e), exc_info=True) return self.docker.start(container_id) try: if network_info: self.plug_vifs(instance, network_info) self._attach_vifs(instance, network_info) except Exception as e: LOG.warning(_('Cannot setup network on reboot: {0}'), e, exc_info=True) return
def cleanup(self, context, instance, network_info, block_device_info=None, destroy_disks=True, migrate_data=None, destroy_vifs=True): """Cleanup after instance being destroyed by Hypervisor.""" container_id = self._get_container_id(instance) if not container_id: self.unplug_vifs(instance, network_info) return network.teardown_network(container_id) self.unplug_vifs(instance, network_info) self._cleanup_instance_file(instance['uuid'])
def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None): container_id = self._get_container_id(instance) if not container_id: return self._stop(container_id, instance) try: network.teardown_network(container_id) if network_info: self.unplug_vifs(instance, network_info) except Exception as e: LOG.warning('Cannot destroy the container network' ' during reboot {0}'.format(e), exc_info=True) return self.docker.start(container_id) try: if network_info: self.plug_vifs(instance, network_info) self._attach_vifs(instance, network_info) except Exception as e: LOG.warning('Cannot setup network on reboot: {0}', e, exc_info=True) return