'Clear residual snapshot support resources from LUN.
:raises:
VolumeBackendAPIException: If snapshots still exist on the LUN.'

def _delete_lun_snapshot_bookkeeping(self, volume_id):

    try:
        snaps = self.vmem_mg.snapshot.get_snapshots(volume_id)
        if (len(snaps) > 0):
            msg = (_('Cannot    delete    LUN    %s    while    snapshots    exist.') % volume_id)
            raise exception.VolumeBackendAPIException(data=msg)
    except vmemclient.core.error.NoMatchingObjectIdError:
        pass
    except vmemclient.core.error.MissingParameterError:
        pass
    try:
        res = self.vmem_mg.snapshot.delete_snapshot_policy(lun=volume_id)
        if (not res['success']):
            if ('TimeMark    is    disabled' in res['msg']):
                LOG.debug('Verified    no    snapshot    policy    is    on    volume    %s.', volume_id)
            else:
                msg = (_('Unable    to    delete    snapshot    policy    on    volume    %s.') % volume_id)
                raise exception.VolumeBackendAPIException(data=msg)
        else:
            LOG.debug('Deleted    snapshot    policy    on    volume    %(vol)s,    result    %(res)s.', {'vol': volume_id, 'res': res})
    except vmemclient.core.error.NoMatchingObjectIdError:
        LOG.debug('Verified    no    snapshot    policy    present    on    volume    %s.', volume_id)
        pass
    try:
        res = self.vmem_mg.snapshot.delete_snapshot_resource(lun=volume_id)
        LOG.debug('Deleted    snapshot    resource    area    on    volume    %(vol)s,    result    %(res)s.', {'vol': volume_id, 'res': res})
    except vmemclient.core.error.NoMatchingObjectIdError:
        LOG.debug('Verified    no    snapshot    resource    area    present    on    volume    %s.', volume_id)
        pass
