Fix bug rook-ceph provision with multi osd on one host

Test case:
1, deploy simplex system
2, apply rook-ceph with below override value
value.yaml
cluster:
  storage:
    nodes:
    - name: controller-0
      devices:
      - name: sdb
      - name: sdc
3, reboot

Without this fix, only osd pod could launch successfully after boot
as vg start with ceph could not correctly add in sysinv-database

Closes-bug: 1929511

Change-Id: Ia5be599cd168d13d2aab7b5e5890376c3c8a0019
Signed-off-by: Chen, Haochuan Z <haochuan.z.chen@intel.com>
This commit is contained in:
Chen, Haochuan Z 2021-05-25 16:16:29 +08:00
parent a485980a36
commit 7ef3724dad

View File

@ -86,6 +86,7 @@ class LVGOperator(object):
vgdisplay_output = "" vgdisplay_output = ""
# parse the output 1 vg/row # parse the output 1 vg/row
rook_vgs = []
for row in vgdisplay_output.split('\n'): for row in vgdisplay_output.split('\n'):
if row.strip().startswith("ceph"): if row.strip().startswith("ceph"):
@ -100,9 +101,9 @@ class LVGOperator(object):
if k in attr.keys(): if k in attr.keys():
attr[k] = int(attr[k]) attr[k] = int(attr[k])
return attr rook_vgs.append(attr)
return None return rook_vgs
def ilvg_get(self, cinder_device=None): def ilvg_get(self, cinder_device=None):
'''Enumerate physical volume topology based on: '''Enumerate physical volume topology based on:
@ -178,9 +179,10 @@ class LVGOperator(object):
if attr: if attr:
ilvg.append(attr) ilvg.append(attr)
rook_vg = self.ilvg_rook_get() rook_vgs = self.ilvg_rook_get()
if (rook_vg and (rook_vg not in ilvg)): for vg in rook_vgs:
ilvg.append(rook_vg) if vg and vg not in ilvg:
ilvg.append(vg)
LOG.debug("ilvg= %s" % ilvg) LOG.debug("ilvg= %s" % ilvg)