code: def rbd_exists(service, pool, rbd_img):
      
      try:
          out = check_output(['rbd', 'list', '--id',
                              service, '--pool', pool])
          if six.PY3:
              out = out.decode('UTF-8')
      except CalledProcessError:
          return False
  
      return rbd_img in out
docs: Check to see if a RADOS block device exists.