'Destroy an RBD volume, retrying as needed.'

def _destroy_volume(self, client, volume, pool=None):

    def _cleanup_vol(ioctx, volume, retryctx):
        try:
            RbdProxy().remove(ioctx, volume)
            raise loopingcall.LoopingCallDone(retvalue=False)
        except rbd.ImageHasSnapshots:
            self.remove_snap(volume, libvirt_utils.RESIZE_SNAPSHOT_NAME, ignore_errors=True)
        except (rbd.ImageBusy, rbd.ImageHasSnapshots):
            LOG.warning('rbd    remove    %(volume)s    in    pool    %(pool)s    failed', {'volume': volume, 'pool': self.pool})
        retryctx['retries'] -= 1
        if (retryctx['retries'] <= 0):
            raise loopingcall.LoopingCallDone()
    retryctx = {'retries': 10}
    timer = loopingcall.FixedIntervalLoopingCall(_cleanup_vol, client.ioctx, volume, retryctx)
    timed_out = timer.start(interval=1).wait()
    if timed_out:
        try:
            _cleanup_vol(client.ioctx, volume, retryctx)
        except loopingcall.LoopingCallDone:
            pass
