def destroy(self, instance, network_info, block_device_info=None,
                destroy_disks=True):
        """Destroy VM instance.

        This is the method exposed by xenapi_conn.destroy(). The rest of the
        destroy_* methods are internal.

        """
        LOG.info(_LI("Destroying VM"), instance=instance)

        # We don't use _get_vm_opaque_ref because the instance may
        # truly not exist because of a failure during build. A valid
        # vm_ref is checked correctly where necessary.
        vm_ref = vm_utils.lookup(self._session, instance['name'])

        rescue_vm_ref = vm_utils.lookup(self._session,
                                        "%s-rescue" % instance['name'])
        if rescue_vm_ref:
            self._destroy_rescue_instance(rescue_vm_ref, vm_ref)

        # NOTE(sirp): information about which volumes should be detached is
        # determined by the VBD.other_config['osvol'] attribute
        # NOTE(alaski): `block_device_info` is used to efficiently determine if
        # there's a volume attached, or which volumes to cleanup if there is
        # no VM present.
        return self._destroy(instance, vm_ref, network_info=network_info,
                             destroy_disks=destroy_disks,
                             block_device_info=block_device_info)
dataset/ETHPy150Open openstack/nova/nova/virt/xenapi/vmops.py/VMOps.destroy/original