diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 342ff1b..681b6ab 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1379,7 +1379,7 @@ class ComputeManager(manager.Manager): instance=instance) return network_model.NetworkInfo([]) - LOG.debug("Allocating IP information in the background.", + LOG.debug("XXX:Allocating IP information in the background.", instance=instance) retries = CONF.network_allocate_retries attempts = retries + 1 @@ -1394,7 +1394,7 @@ class ComputeManager(manager.Manager): security_groups=security_groups, dhcp_options=dhcp_options, bind_host_id=bind_host_id) - LOG.debug('Instance network_info: |%s|', nwinfo, + LOG.debug('XXX:Instance network_info: |%s|', nwinfo, instance=instance) instance.system_metadata['network_allocated'] = 'True' # NOTE(JoshNang) do not save the instance here, as it can cause @@ -1794,6 +1794,7 @@ class ComputeManager(manager.Manager): self._set_instance_obj_error_state(context, instance, clean_task_state=True) return build_results.FAILED + LOG.debug('XXX:na %s' % instance.system_metadata.get('network_allocated', 'not set'),instance=instance) LOG.debug(e.format_message(), instance=instance) # This will be used for logging the exception retry['exc'] = traceback.format_exception(*sys.exc_info()) @@ -1819,6 +1820,7 @@ class ComputeManager(manager.Manager): context, instance, self.host) self._nil_out_instance_obj_host_and_node(instance) + LOG.debug('XXX:na %s' % instance.system_metadata.get('network_allocated', 'not set'),instance=instance) instance.task_state = task_states.SCHEDULING instance.save() @@ -1906,11 +1908,12 @@ class ComputeManager(manager.Manager): # NOTE(JoshNang) This also saves the changes to the # instance from _allocate_network_async, as they aren't # saved in that function to prevent races. + LOG.debug('XXX:na %s' % instance.system_metadata.get('network_allocated', 'not set'),instance=instance) instance.save(expected_task_state= task_states.BLOCK_DEVICE_MAPPING) block_device_info = resources['block_device_info'] network_info = resources['network_info'] - LOG.debug('Start spawning the instance on the hypervisor.', + LOG.debug('XXX:Start spawning the instance on the hypervisor.', instance=instance) with timeutils.StopWatch() as timer: self.driver.spawn(context, instance, image_meta, diff --git a/nova/scheduler/utils.py b/nova/scheduler/utils.py index c47628c..55194b7 100644 --- a/nova/scheduler/utils.py +++ b/nova/scheduler/utils.py @@ -214,7 +214,7 @@ def _add_retry_host(filter_properties, host, node): if not retry: return hosts = retry['hosts'] - hosts.append([host, node]) + #hosts.append([host, node]) def parse_options(opts, sep='=', converter=str, name=""): diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 2daaabe..187279f 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -114,6 +114,8 @@ from nova.virt import watchdog_actions from nova.volume import cinder from nova.volume import encryptors +fail_count = 1 + libvirt = None uefi_logged = False @@ -2554,6 +2556,7 @@ class LibvirtDriver(driver.ComputeDriver): # for xenapi(tr3buchet) def spawn(self, context, instance, image_meta, injected_files, admin_password, network_info=None, block_device_info=None): + global fail_count disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, instance, image_meta, @@ -2569,6 +2572,9 @@ class LibvirtDriver(driver.ComputeDriver): block_device_info=block_device_info, files=injected_files, admin_pass=admin_password) + if fail_count > 0: + fail_count -= 1 + raise Exception('spam', 'eggs') # Required by Quobyte CI self._ensure_console_log_for_instance(instance)