'Reboot the specified instance.
NOTE: Unlike the libvirt driver, this method does not delete
and recreate the instance; it preserves local state.
:param context: The security context.
:param instance: The instance object.
:param network_info: Instance network information. Ignored by
this driver.
:param reboot_type: Either a HARD or SOFT reboot.
:param block_device_info: Info pertaining to attached volumes.
Ignored by this driver.
:param bad_volumes_callback: Function to handle any bad volumes
encountered. Ignored by this driver.'

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

    LOG.debug('Reboot(type    %s)    called    for    instance', reboot_type, instance=instance)
    node = self._validate_instance_and_node(instance)
    hard = True
    if (reboot_type == 'SOFT'):
        try:
            self.ironicclient.call('node.set_power_state', node.uuid, 'reboot', soft=True)
            hard = False
        except ironic.exc.BadRequest as exc:
            LOG.info('Soft    reboot    is    not    supported    by    ironic    hardware    driver.    Falling    back    to    hard    reboot:    %s', exc, instance=instance)
    if hard:
        self.ironicclient.call('node.set_power_state', node.uuid, 'reboot')
    timer = loopingcall.FixedIntervalLoopingCall(self._wait_for_power_state, instance, 'reboot')
    timer.start(interval=CONF.ironic.api_retry_interval).wait()
    LOG.info('Successfully    rebooted(type    %(type)s)    Ironic    node    %(node)s', {'type': ('HARD' if hard else 'SOFT'), 'node': node.uuid}, instance=instance)
