'Reboot a virtual machine, given an instance reference.
Performs a Libvirt reset (if supported) on the domain.
If Libvirt reset is unavailable this method actually destroys and
re-creates the domain to ensure the reboot happens, as the guest
OS cannot ignore this action.'

def _hard_reboot(self, context, instance, network_info, block_device_info=None):

    self._destroy(instance)
    self._undefine_domain(instance)
    instance_dir = libvirt_utils.get_instance_path(instance)
    fileutils.ensure_tree(instance_dir)
    disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, instance, instance.image_meta, block_device_info)
    xml = self._get_guest_xml(context, instance, network_info, disk_info, instance.image_meta, block_device_info=block_device_info)
    if (context.auth_token is not None):
        config = vconfig.LibvirtConfigGuest()
        config.parse_str(xml)
        backing_disk_info = self._get_instance_disk_info_from_config(config, block_device_info)
        self._create_images_and_backing(context, instance, instance_dir, backing_disk_info)
    self._create_domain_and_network(context, xml, instance, network_info, block_device_info=block_device_info, reboot=True, vifs_already_plugged=True)
    self._prepare_pci_devices_for_use(pci_manager.get_instance_pci_devs(instance, 'all'))
    def _wait_for_reboot():
        'Called    at    an    interval    until    the    VM    is    running    again.'
        state = self.get_info(instance).state
        if (state == power_state.RUNNING):
            LOG.info('Instance    rebooted    successfully.', instance=instance)
            raise loopingcall.LoopingCallDone()
    timer = loopingcall.FixedIntervalLoopingCall(_wait_for_reboot)
    timer.start(interval=0.5).wait()
