'Detach a volume from an instance.
:param context: security context
:param volume_id: the volume id
:param instance: the Instance object to detach the volume from
:param attachment_id: The volume attachment_id for the given instance
and volume.'

@wrap_exception()
@wrap_instance_fault
def detach_volume(self, context, volume_id, instance, attachment_id=None):

    bdm = objects.BlockDeviceMapping.get_by_volume_and_instance(context, volume_id, instance.uuid)
    self._detach_volume(context, bdm, instance, attachment_id=attachment_id)
