'Attach a volume to an instance.'

@wrap_exception()
@wrap_instance_fault
def attach_volume(self, context, instance, bdm):

    driver_bdm = driver_block_device.convert_volume(bdm)
    @utils.synchronized(instance.uuid)
    def do_attach_volume(context, instance, driver_bdm):
        try:
            return self._attach_volume(context, instance, driver_bdm)
        except Exception:
            with excutils.save_and_reraise_exception():
                bdm.destroy()
    do_attach_volume(context, instance, driver_bdm)
