'Destroys VM instance by performing:
1. A shutdown
2. Destroying associated VDIs.
3. Destroying kernel and ramdisk files (if necessary).
4. Destroying that actual VM record.'

def _destroy(self, instance, vm_ref, network_info=None, destroy_disks=True, block_device_info=None):

    if (vm_ref is None):
        LOG.warning('VM    is    not    present,    skipping    destroy...', instance=instance)
        bdms = (block_device_info['block_device_mapping'] or [])
        if (not bdms):
            return
        for bdm in bdms:
            volume_id = bdm['connection_info']['data']['volume_id']
            sr_uuid = ('FA15E-D15C-%s' % volume_id)
            sr_ref = None
            try:
                sr_ref = volume_utils.find_sr_by_uuid(self._session, sr_uuid)
                if (not sr_ref):
                    connection_data = bdm['connection_info']['data']
                    (sr_uuid, unused, unused) = volume_utils.parse_sr_info(connection_data)
                    sr_ref = volume_utils.find_sr_by_uuid(self._session, sr_uuid)
            except Exception:
                LOG.exception(_('Failed    to    find    an    SR    for    volume    %s'), volume_id, instance=instance)
            try:
                if sr_ref:
                    volume_utils.forget_sr(self._session, sr_ref)
                else:
                    LOG.error('Volume    %s    is    associated    with    the    instance    but    no    SR    was    found    for    it', volume_id, instance=instance)
            except Exception:
                LOG.exception(_('Failed    to    forget    the    SR    for    volume    %s'), volume_id, instance=instance)
        return
    if (block_device_info and block_device_info['block_device_mapping']):
        if (not vm_utils.clean_shutdown_vm(self._session, instance, vm_ref)):
            LOG.debug('Clean    shutdown    did    not    complete    successfully,    trying    hard    shutdown.', instance=instance)
            vm_utils.hard_shutdown_vm(self._session, instance, vm_ref)
    else:
        vm_utils.hard_shutdown_vm(self._session, instance, vm_ref)
    if destroy_disks:
        self._volumeops.detach_all(vm_ref)
        self._destroy_vdis(instance, vm_ref)
        self._destroy_kernel_ramdisk(instance, vm_ref)
    self.unplug_vifs(instance, network_info, vm_ref)
    self.firewall_driver.unfilter_instance(instance, network_info=network_info)
    vm_utils.destroy_vm(self._session, instance, vm_ref)
