mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
mgr/cephadm: When create osd which include db, _create_daemon will be executed twice. So we should filter the db type
Signed-off-by: jianglong01 <jianglong01@qianxin.com>
This commit is contained in:
parent
7fc07dd728
commit
ca52b49351
@ -112,6 +112,8 @@ class OSDService(CephService):
|
||||
created = []
|
||||
for osd_id, osds in osds_elems.items():
|
||||
for osd in osds:
|
||||
if osd['type'] == 'db':
|
||||
continue
|
||||
if osd['tags']['ceph.cluster_fsid'] != fsid:
|
||||
logger.debug('mismatched fsid, skipping %s' % osd)
|
||||
continue
|
||||
|
@ -1221,7 +1221,7 @@ Traceback (most recent call last):
|
||||
]
|
||||
|
||||
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
|
||||
def test_osd_activate(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
|
||||
def test_osd_activate_datadevice(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
|
||||
_run_cephadm.return_value = ('{}', '', 0)
|
||||
with with_host(cephadm_module, 'test', refresh_hosts=False):
|
||||
cephadm_module.mock_store_set('_ceph_get', 'osd_map', {
|
||||
@ -1239,7 +1239,41 @@ Traceback (most recent call last):
|
||||
'tags': {
|
||||
'ceph.cluster_fsid': cephadm_module._cluster_fsid,
|
||||
'ceph.osd_fsid': 'uuid'
|
||||
}
|
||||
},
|
||||
'type': 'data'
|
||||
}]
|
||||
}
|
||||
_run_cephadm.return_value = (json.dumps(ceph_volume_lvm_list), '', 0)
|
||||
assert cephadm_module._osd_activate(
|
||||
['test']).stdout == "Created osd(s) 1 on host 'test'"
|
||||
|
||||
@mock.patch("cephadm.serve.CephadmServe._run_cephadm")
|
||||
def test_osd_activate_datadevice_dbdevice(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
|
||||
_run_cephadm.return_value = ('{}', '', 0)
|
||||
with with_host(cephadm_module, 'test', refresh_hosts=False):
|
||||
cephadm_module.mock_store_set('_ceph_get', 'osd_map', {
|
||||
'osds': [
|
||||
{
|
||||
'osd': 1,
|
||||
'up_from': 0,
|
||||
'uuid': 'uuid'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
ceph_volume_lvm_list = {
|
||||
'1': [{
|
||||
'tags': {
|
||||
'ceph.cluster_fsid': cephadm_module._cluster_fsid,
|
||||
'ceph.osd_fsid': 'uuid'
|
||||
},
|
||||
'type': 'data'
|
||||
}, {
|
||||
'tags': {
|
||||
'ceph.cluster_fsid': cephadm_module._cluster_fsid,
|
||||
'ceph.osd_fsid': 'uuid'
|
||||
},
|
||||
'type': 'db'
|
||||
}]
|
||||
}
|
||||
_run_cephadm.return_value = (json.dumps(ceph_volume_lvm_list), '', 0)
|
||||
|
Loading…
Reference in New Issue
Block a user