'Handle cases where the virt-layer had to detach non-working volumes
in order to complete an operation.'

def _handle_bad_volumes_detached(self, context, instance, bad_devices, block_device_info):

    for bdm in block_device_info['block_device_mapping']:
        if (bdm.get('mount_device') in bad_devices):
            try:
                volume_id = bdm['connection_info']['data']['volume_id']
            except KeyError:
                continue
            LOG.info('Detaching    from    volume    api:    %s', volume_id)
            self.volume_api.begin_detaching(context, volume_id)
            self.detach_volume(context, volume_id, instance)
