'Delete/Detach the specified attachment.
Notifies the backend device that we\'re detaching the specified
attachment instance.
param: vref: Volume object associated with the attachment
param: attachment: Attachment reference object to remove
NOTE if the attachment reference is None, we remove all existing
attachments for the specified volume object.'

def attachment_delete(self, context, attachment_id, vref):

    attachment_ref = objects.VolumeAttachment.get_by_id(context, attachment_id)
    if (not attachment_ref):
        for attachment in VA_LIST.get_all_by_volume_id(context, vref.id):
            self._do_attachment_delete(context, vref, attachment)
    else:
        self._do_attachment_delete(context, vref, attachment_ref)
