def service_get_all_volume_sorted(context):
session = get_session()
with session.begin():
- topic = 'volume'
+ topic = FLAGS.volume_topic
label = 'volume_gigabytes'
subq = model_query(context, models.Volume.host,
func.sum(models.Volume.size).label(label),
help='A list of the glance api servers available to cinder '
'([hostname|ip]:port)'),
cfg.StrOpt('scheduler_topic',
- default='scheduler',
+ default='cinder-scheduler',
help='the topic scheduler nodes listen on'),
cfg.StrOpt('volume_topic',
- default='volume',
+ default='cinder-volume',
help='the topic volume nodes listen on'),
cfg.StrOpt('rabbit_host',
default='localhost',
db.volume_update(context, volume_id,
{'host': host, 'scheduled_at': now})
rpc.cast(context,
- db.queue_get_for(context, 'volume', host),
+ db.queue_get_for(context, FLAGS.volume_topic, host),
{"method": method, "args": kwargs})
- LOG.debug(_("Casted '%(method)s' to volume '%(host)s'") % locals())
+ LOG.debug(_("Casted '%(method)s' to host '%(host)s'") % locals())
def cast_to_host(context, topic, host, method, update_db=True, **kwargs):
if not binary:
binary = os.path.basename(inspect.stack()[-1][1])
if not topic:
- topic = binary.rpartition('cinder-')[2]
+ topic = binary
if not manager:
- manager = FLAGS.get('%s_manager' % topic, None)
+ subtopic = topic.rpartition('cinder-')[2]
+ manager = FLAGS.get('%s_manager' % subtopic, None)
if report_interval is None:
report_interval = FLAGS.report_interval
if periodic_interval is None:
utils.utcnow().AndReturn('fake-now')
db.volume_update(self.context, 31337,
{'host': host, 'scheduled_at': 'fake-now'})
- db.queue_get_for(self.context, 'volume', host).AndReturn(queue)
+ db.queue_get_for(self.context,
+ FLAGS.volume_topic, host).AndReturn(queue)
rpc.cast(self.context, queue,
{'method': method,
'args': fake_kwargs})
self.mox.StubOutWithMock(db, 'queue_get_for')
self.mox.StubOutWithMock(rpc, 'cast')
- db.queue_get_for(self.context, 'volume', host).AndReturn(queue)
+ db.queue_get_for(self.context,
+ FLAGS.volume_topic, host).AndReturn(queue)
rpc.cast(self.context, queue,
{'method': method,
'args': fake_kwargs})
self.mox.StubOutWithMock(db, 'queue_get_for')
self.mox.StubOutWithMock(rpc, 'cast')
- db.queue_get_for(self.context, 'volume', host).AndReturn(queue)
+ db.queue_get_for(self.context,
+ FLAGS.volume_topic, host).AndReturn(queue)
rpc.cast(self.context, queue,
{'method': method,
'args': fake_kwargs})
**Related Flags**
-:volume_topic: What :mod:`rpc` topic to listen to (default: `volume`).
+:volume_topic: What :mod:`rpc` topic to listen to (default: `cinder-volume`).
:volume_manager: The module name of a class derived from
:class:`manager.Manager` (default:
:class:`cinder.volume.manager.Manager`).