'Attach an existing volume to an instance in shelved offloaded state.
Attaching a volume for an instance in shelved offloaded state requires
to perform the regular check to see if we can attach and reserve the
volume then we need to call the attach method on the volume API
to mark the volume as \'in-use\'.
The instance at this stage is not managed by a compute manager
therefore the actual attachment will be performed once the
instance will be unshelved.'

def _attach_volume_shelved_offloaded(self, context, instance, volume_id, device, disk_bus, device_type):

    volume_bdm = self._create_volume_bdm(context, instance, device, volume_id, disk_bus=disk_bus, device_type=device_type, is_local_creation=True)
    try:
        self._check_attach_and_reserve_volume(context, volume_id, instance)
        self.volume_api.attach(context, volume_id, instance.uuid, device)
    except Exception:
        with excutils.save_and_reraise_exception():
            volume_bdm.destroy()
    return volume_bdm.device_name
