nova/virt/libvirt/guest.py
===========
def launch(self, pause=False):
"""Starts a created guest.
:param pause: Indicates whether to start and pause the guest
"""
flags = pause and libvirt.VIR_DOMAIN_START_PAUSED or 0
try:
return self._domain.createWithFlags(flags)
except Exception:
with excutils.save_and_reraise_exception(): LOG.error('Error launching a defined domain ' 'with XML: %s', self._encoded_xml, errors='ignore')
===========
This bubbles up any exceptions from libvirt, the function that calls it..
Either domain or xml must be passed in. If both are passed, then
the domain definition is overwritten from the xml.
:returns guest.Guest: Guest just created
"""
if xml:
guest = libvirt_guest.Guest.create(xml, self._host)
if post_xml_callback is not None: post_xml_callback()
else:
guest = libvirt_guest.Guest(domain)
if power_on or pause: guest.launch(pause=pause)
if not utils.is_neutron(): guest.enable_hairpin()
return guest
===========
This also handles no exceptions, so it goes up to _create_domain_and_network() which has a case to grab all generic exceptions
===========
except Exception:
# Any other error, be sure to clean up LOG.error('Failed to start libvirt guest', instance=instance)
with excutils.save_and_reraise_exception(): self._cleanup_failed_start(context, instance, network_info, block_device_info, guest, destroy_disks_on_failure)
===========
but that still bubbles up.. in this case, up to _hard_reboot() which has no exception handling, which is called by reboot() that has no exception handling, which means at this point, we've sent a *libvirt* exception up to the compute manager.. more specifically reboot_instance() which is decorated by the following:
- wrap_exception: this seems to emit notifications on exceptions
- reverts_task_state: pretty self explanitory
- wrap_instance_event: this seems like it adds an instance action to the log
- wrap_instance_fault:L
So:
nova/virt/ libvirt/ guest.py
===========
def launch(self, pause=False):
"""Starts a created guest.
:param pause: Indicates whether to start and pause the guest VIR_DOMAIN_ START_PAUSED or 0 createWithFlags (flags) save_and_ reraise_ exception( ):
LOG.error( 'Error launching a defined domain '
'with XML: %s',
self. _encoded_ xml, errors='ignore')
"""
flags = pause and libvirt.
try:
return self._domain.
except Exception:
with excutils.
===========
This bubbles up any exceptions from libvirt, the function that calls it..
nova/virt/ libvirt/ guest.py domain( self, xml=None, domain=None,
power_ on=True, pause=False, post_xml_ callback= None):
===========
def _create_
"""Create a domain.
Either domain or xml must be passed in. If both are passed, then
the domain definition is overwritten from the xml.
:returns guest.Guest: Guest just created guest.Guest. create( xml, self._host)
post_ xml_callback( ) guest.Guest( domain)
"""
if xml:
guest = libvirt_
if post_xml_callback is not None:
else:
guest = libvirt_
if power_on or pause:
guest. launch( pause=pause)
if not utils.is_neutron():
guest. enable_ hairpin( )
return guest
===========
This also handles no exceptions, so it goes up to _create_ domain_ and_network( ) which has a case to grab all generic exceptions
===========
LOG. error(' Failed to start libvirt guest', instance=instance) save_and_ reraise_ exception( ):
self. _cleanup_ failed_ start(context, instance, network_info,
block_ device_ info, guest,
destroy_ disks_on_ failure)
except Exception:
# Any other error, be sure to clean up
with excutils.
===========
but that still bubbles up.. in this case, up to _hard_reboot() which has no exception handling, which is called by reboot() that has no exception handling, which means at this point, we've sent a *libvirt* exception up to the compute manager.. more specifically reboot_instance() which is decorated by the following:
=========== exception( ) task_state instance_ event(prefix= 'compute' ) instance_ fault
@wrap_
@reverts_
@wrap_
@wrap_
===========
- wrap_exception: this seems to emit notifications on exceptions event: this seems like it adds an instance action to the log fault:L
- reverts_task_state: pretty self explanitory
- wrap_instance_
- wrap_instance_