'Deletes a logical volume.'

def delete_volume(self, volume):

    volume_name = utils.convert_str(volume.name)
    with RADOSClient(self) as client:
        try:
            rbd_image = self.rbd.Image(client.ioctx, volume_name)
        except self.rbd.ImageNotFound:
            LOG.info('volume    %s    no    longer    exists    in    backend', volume_name)
            return
        clone_snap = None
        parent = None
        self._delete_backup_snaps(rbd_image)
        try:
            snaps = rbd_image.list_snaps()
            for snap in snaps:
                if snap['name'].endswith('.clone_snap'):
                    LOG.debug('volume    has    clone    snapshot(s)')
                    clone_snap = snap['name']
                    break
                raise exception.VolumeIsBusy(volume_name=volume_name)
            (_pool, parent, parent_snap) = self._get_clone_info(rbd_image, volume_name, clone_snap)
        finally:
            rbd_image.close()
        @utils.retry(self.rbd.ImageBusy, self.configuration.rados_connection_interval, self.configuration.rados_connection_retries)
        def _try_remove_volume(client, volume_name):
            self.RBDProxy().remove(client.ioctx, volume_name)
        if (clone_snap is None):
            LOG.debug('deleting    rbd    volume    %s', volume_name)
            try:
                _try_remove_volume(client, volume_name)
            except self.rbd.ImageBusy:
                msg = _('ImageBusy    error    raised    while    deleting    rbd    volume.    This    may    have    been    caused    by    a    connection    from    a    client    that    has    crashed    and,    if    so,    may    be    resolved    by    retrying    the    delete    after    30    seconds    has    elapsed.')
                LOG.warning(msg)
                raise exception.VolumeIsBusy(msg, volume_name=volume_name)
            except self.rbd.ImageNotFound:
                LOG.info('RBD    volume    %s    not    found,    allowing    delete    operation    to    proceed.', volume_name)
                return
            if parent:
                LOG.debug('volume    is    a    clone    so    cleaning    references')
                self._delete_clone_parent_refs(client, parent, parent_snap)
        else:
            new_name = ('%s.deleted' % volume_name)
            self.RBDProxy().rename(client.ioctx, volume_name, new_name)
