'Copies a VHD from one host machine to another, possibly
resizing filesystem beforehand.
:param instance: the instance that owns the VHD in question.
:param dest: the destination host machine.
:param flavor: flavor to resize to'

def migrate_disk_and_power_off(self, context, instance, dest, flavor, block_device_info):

    self._ensure_not_resize_down_ephemeral(instance, flavor)
    self._update_instance_progress(context, instance, step=0, total_steps=RESIZE_TOTAL_STEPS)
    old_gb = instance.flavor.root_gb
    new_gb = flavor.root_gb
    resize_down = (old_gb > new_gb)
    if ((new_gb == 0) and (old_gb != 0)):
        reason = _("Can't    resize    a    disk    to    0    GB.")
        raise exception.ResizeError(reason=reason)
    vm_ref = self._get_vm_opaque_ref(instance)
    sr_path = vm_utils.get_sr_path(self._session)
    if resize_down:
        self._migrate_disk_resizing_down(context, instance, dest, flavor, vm_ref, sr_path)
    else:
        self._migrate_disk_resizing_up(context, instance, dest, vm_ref, sr_path)
    self._detach_block_devices_from_orig_vm(instance, block_device_info)
    disk_info = {}
    return disk_info
