'Destroys evacuated instances.
While nova-compute was down, the instances running on it could be
evacuated to another host. Check that the instances reported
by the driver are still associated with this host.  If they are
not, destroy them, with the exception of instances which are in
the MIGRATING, RESIZE_MIGRATING, RESIZE_MIGRATED, RESIZE_FINISH
task state or RESIZED vm state.'

def _destroy_evacuated_instances(self, context):

    filters = {'source_compute': self.host, 'status': ['accepted', 'done'], 'migration_type': 'evacuation'}
    with utils.temporary_mutation(context, read_deleted='yes'):
        evacuations = objects.MigrationList.get_by_filters(context, filters)
    if (not evacuations):
        return
    evacuations = {mig.instance_uuid: mig for mig in evacuations}
    local_instances = self._get_instances_on_driver(context)
    evacuated = [inst for inst in local_instances if (inst.uuid in evacuations)]
    for instance in evacuated:
        migration = evacuations[instance.uuid]
        LOG.info('Deleting    instance    as    it    has    been    evacuated    from    this    host', instance=instance)
        try:
            network_info = self.network_api.get_instance_nw_info(context, instance)
            bdi = self._get_instance_block_device_info(context, instance)
            destroy_disks = (not self._is_instance_storage_shared(context, instance))
        except exception.InstanceNotFound:
            network_info = network_model.NetworkInfo()
            bdi = {}
            LOG.info('Instance    has    been    marked    deleted    already,    removing    it    from    the    hypervisor.', instance=instance)
            destroy_disks = True
        self.driver.destroy(context, instance, network_info, bdi, destroy_disks)
        migration.status = 'completed'
        migration.save()
