def resume_state_on_host_boot(self, context, instance, network_info, block_device_info=None):
    'resume guest state when a host is booted.'
    try:
        domain = self._lookup_by_name(instance['name'])
        state = LIBVIRT_POWER_STATE[domain.info()[0]]
        ignored_states = (power_state.RUNNING, power_state.SUSPENDED, power_state.NOSTATE, power_state.PAUSED)
        if (state in ignored_states):
            return
    except exception.NovaException:
        pass
    self._hard_reboot(context, instance, network_info, block_device_info)
resume guest state when a host is booted.
def resume_state_on_host_boot(self, context, instance, network_info, block_device_info=None):
    
    try:
        domain = self._lookup_by_name(instance['name'])
        state = LIBVIRT_POWER_STATE[domain.info()[0]]
        ignored_states = (power_state.RUNNING, power_state.SUSPENDED, power_state.NOSTATE, power_state.PAUSED)
        if (state in ignored_states):
            return
    except exception.NovaException:
        pass
    self._hard_reboot(context, instance, network_info, block_device_info)