'Reboot a virtual machine, given an instance reference.'

def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None):

    if (reboot_type == 'SOFT'):
        try:
            soft_reboot_success = self._soft_reboot(instance)
        except libvirt.libvirtError as e:
            LOG.debug('Instance    soft    reboot    failed:    %s', e, instance=instance)
            soft_reboot_success = False
        if soft_reboot_success:
            LOG.info('Instance    soft    rebooted    successfully.', instance=instance)
            return
        else:
            LOG.warning('Failed    to    soft    reboot    instance.    Trying    hard    reboot.', instance=instance)
    return self._hard_reboot(context, instance, network_info, block_device_info)
