self.cfg = mock.Mock(spec=conf.Configuration)
self.cfg.volume_tmp_dir = None
self.cfg.image_conversion_dir = None
+ self.cfg.rbd_cluster_name = 'nondefault'
self.cfg.rbd_pool = 'rbd'
self.cfg.rbd_ceph_conf = None
self.cfg.rbd_secret_uuid = None
LOG = logging.getLogger(__name__)
rbd_opts = [
+ cfg.StrOpt('rbd_cluster_name',
+ default='ceph',
+ help='The name of ceph cluster'),
cfg.StrOpt('rbd_pool',
default='rbd',
help='The RADOS pool where rbd volumes are stored'),
# All string args used with librbd must be None or utf-8 otherwise
# librbd will break.
- for attr in ['rbd_user', 'rbd_ceph_conf', 'rbd_pool']:
+ for attr in ['rbd_cluster_name', 'rbd_user',
+ 'rbd_ceph_conf', 'rbd_pool']:
val = getattr(self.configuration, attr)
if val is not None:
setattr(self.configuration, attr, encodeutils.safe_encode(val))
LOG.debug("opening connection to ceph cluster (timeout=%s)." %
(self.configuration.rados_connect_timeout))
- client = self.rados.Rados(rados_id=self.configuration.rbd_user,
- conffile=self.configuration.rbd_ceph_conf)
+ client = self.rados.Rados(
+ rados_id=self.configuration.rbd_user,
+ clustername=self.configuration.rbd_cluster_name,
+ conffile=self.configuration.rbd_ceph_conf)
if pool is not None:
pool = encodeutils.safe_encode(pool)
else: