Comment 2 for bug 1773800

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

From the cinder perspective "host" option is a global option.

cinder/common/config.py
    cfg.HostAddressOpt('host',
                       default=socket.gethostname(),
                       help='Name of this node. This can be an opaque '
                            'identifier. It is not necessarily a host name, '
                            'FQDN, or IP address.'),

However, it can be overridden on a per-backend basis via backend_host option:

https://github.com/openstack/cinder/blob/stable/queens/cinder/cmd/volume.py#L61-L62
host_opt = cfg.StrOpt('backend_host', help='Backend override of host value.')
CONF.register_cli_opt(host_opt)

https://github.com/openstack/cinder/blob/stable/queens/cinder/cmd/volume.py#L88-L91

def _launch_service(launcher, backend):
    CONF.register_opt(host_opt, group=backend)
    backend_host = getattr(CONF, backend).backend_host
    host = "%s@%s" % (backend_host or CONF.host, backend)

The current charm implementation relies on cinder-ceph charm populating a context and sending it to cinder via relation data. The cinder charm then renders sections received from a subordinate in a generic way - this could be utilized to properly set backend_host config in the cinder-ceph charm without modifying the cinder charm.