'Perform a soft shutdown on the VM.
:return: True if the instance was shutdown within time limit,
False otherwise.'

def _soft_shutdown(self, instance, timeout=CONF.hyperv.wait_soft_reboot_seconds, retry_interval=SHUTDOWN_TIME_INCREMENT):

    LOG.debug('Performing    Soft    shutdown    on    instance', instance=instance)
    while (timeout > 0):
        wait_time = min(retry_interval, timeout)
        try:
            LOG.debug('Soft    shutdown    instance,    timeout    remaining:    %d', timeout, instance=instance)
            self._vmutils.soft_shutdown_vm(instance.name)
            if self._wait_for_power_off(instance.name, wait_time):
                LOG.info('Soft    shutdown    succeeded.', instance=instance)
                return True
        except os_win_exc.HyperVException as e:
            LOG.debug('Soft    shutdown    failed:    %s', e, instance=instance)
            time.sleep(wait_time)
        timeout -= retry_interval
    LOG.warning('Timed    out    while    waiting    for    soft    shutdown.', instance=instance)
    return False
