Merge "rbd: Warn if ceph udev rules are not configured" into stable/train
This commit is contained in:
commit
b31a611781
|
@ -186,20 +186,34 @@ class RBDConnector(base.BaseLinuxConnector):
|
||||||
# via the rbd kernel module.
|
# via the rbd kernel module.
|
||||||
pool, volume = connection_properties['name'].split('/')
|
pool, volume = connection_properties['name'].split('/')
|
||||||
rbd_dev_path = RBDConnector.get_rbd_device_name(pool, volume)
|
rbd_dev_path = RBDConnector.get_rbd_device_name(pool, volume)
|
||||||
if (not os.path.islink(rbd_dev_path) or
|
|
||||||
not os.path.exists(os.path.realpath(rbd_dev_path))):
|
if (
|
||||||
|
not os.path.islink(rbd_dev_path) or
|
||||||
|
not os.path.exists(os.path.realpath(rbd_dev_path))
|
||||||
|
):
|
||||||
cmd = ['rbd', 'map', volume, '--pool', pool]
|
cmd = ['rbd', 'map', volume, '--pool', pool]
|
||||||
cmd += self._get_rbd_args(connection_properties)
|
cmd += self._get_rbd_args(connection_properties)
|
||||||
self._execute(*cmd, root_helper=self._root_helper,
|
self._execute(*cmd, root_helper=self._root_helper,
|
||||||
run_as_root=True)
|
run_as_root=True)
|
||||||
else:
|
else:
|
||||||
LOG.debug('volume %(vol)s is already mapped to local'
|
LOG.debug(
|
||||||
' device %(dev)s',
|
'Volume %(vol)s is already mapped to local device %(dev)s',
|
||||||
{'vol': volume,
|
{'vol': volume, 'dev': os.path.realpath(rbd_dev_path)}
|
||||||
'dev': os.path.realpath(rbd_dev_path)})
|
)
|
||||||
|
|
||||||
return {'path': rbd_dev_path,
|
if (
|
||||||
'type': 'block'}
|
not os.path.islink(rbd_dev_path) or
|
||||||
|
not os.path.exists(os.path.realpath(rbd_dev_path))
|
||||||
|
):
|
||||||
|
LOG.warning(
|
||||||
|
'Volume %(vol)s has not been mapped to local device '
|
||||||
|
'%(dev)s; is the udev daemon running and are the '
|
||||||
|
'ceph-renamer udev rules configured? See bug #1884114 for '
|
||||||
|
'more information.',
|
||||||
|
{'vol': volume, 'dev': rbd_dev_path},
|
||||||
|
)
|
||||||
|
|
||||||
|
return {'path': rbd_dev_path, 'type': 'block'}
|
||||||
|
|
||||||
rbd_handle = self._get_rbd_handle(connection_properties)
|
rbd_handle = self._get_rbd_handle(connection_properties)
|
||||||
return {'path': rbd_handle}
|
return {'path': rbd_handle}
|
||||||
|
|
Loading…
Reference in New Issue