Rework task state machine for storage backend provision replication
Remove SB_TASK_RECONFIG_CONTROLLER since it is no needed, it is previously used to define the process between LVM and CEPH backend, but currently no longer have LVM. By default task is SB_TASK_PROVISION_STORAGE in replace of SB_TASK_RECONFIG_CONTROLLER, and after add ceph, task change to None as already provisioned. Closes-Bug: 1827529 Change-Id: I050eda8203e881907e7f338b71848f6e3cd5e16f Signed-off-by: Chen, Tingjie <tingjie.chen@intel.com>
This commit is contained in:
parent
5f7dd06e68
commit
843abd6958
|
@ -43,7 +43,6 @@ SB_STATE_CONFIGURING = 'configuring'
|
|||
|
||||
# Storage backend tasks
|
||||
SB_TASK_NONE = None
|
||||
SB_TASK_RECONFIG_CONTROLLER = 'reconfig-controller'
|
||||
SB_TASK_PROVISION_STORAGE = 'provision-storage'
|
||||
SB_TASK_RECONFIG_WORKER = 'reconfig-worker'
|
||||
SB_TASK_RESIZE_CEPH_MON_LV = 'resize-ceph-mon-lv'
|
||||
|
|
|
@ -4039,7 +4039,7 @@ class HostController(rest.RestController):
|
|||
if bk['state'] != constants.SB_STATE_CONFIGURED:
|
||||
# TODO(oponcea): Remove once sm supports in-service configuration
|
||||
if (bk['backend'] != constants.SB_TYPE_CEPH or
|
||||
bk['task'] != constants.SB_TASK_RECONFIG_CONTROLLER or
|
||||
bk['task'] != constants.SB_TASK_PROVISION_STORAGE or
|
||||
ihost['personality'] != constants.CONTROLLER):
|
||||
msg = _("%(backend)s is %(notok)s. All storage backends must "
|
||||
"be %(ok)s before operation "
|
||||
|
@ -4565,7 +4565,7 @@ class HostController(rest.RestController):
|
|||
return
|
||||
|
||||
# check if customer needs to install storage nodes
|
||||
if backend.task == constants.SB_TASK_RECONFIG_CONTROLLER:
|
||||
if backend.task == constants.SB_TASK_PROVISION_STORAGE:
|
||||
stor_model = ceph.get_ceph_storage_model()
|
||||
if (HostController._check_provisioned_storage_hosts() or
|
||||
stor_model == constants.CEPH_CONTROLLER_MODEL):
|
||||
|
|
|
@ -791,7 +791,7 @@ def _set_defaults(storage_ceph):
|
|||
if utils.is_aio_simplex_system(pecan.request.dbapi):
|
||||
sc['task'] = None
|
||||
else:
|
||||
sc['task'] = constants.SB_TASK_RECONFIG_CONTROLLER
|
||||
sc['task'] = constants.SB_TASK_PROVISION_STORAGE
|
||||
|
||||
return sc
|
||||
|
||||
|
|
|
@ -455,7 +455,6 @@ SB_STATE_CONFIGURING_ON_UNLOCK = 'configuring-on-unlock'
|
|||
SB_TASK_NONE = None
|
||||
SB_TASK_APPLY_MANIFESTS = 'applying-manifests'
|
||||
SB_TASK_APPLY_CONFIG_FILE = 'applying-config-file'
|
||||
SB_TASK_RECONFIG_CONTROLLER = 'reconfig-controller'
|
||||
SB_TASK_PROVISION_STORAGE = 'provision-storage'
|
||||
SB_TASK_PROVISION_SERVICES = 'provision-services'
|
||||
SB_TASK_RECONFIG_WORKER = 'reconfig-worker'
|
||||
|
|
|
@ -6467,7 +6467,7 @@ class ConductorManager(service.PeriodicService):
|
|||
|
||||
if ceph_conf.state != constants.SB_STATE_CONFIG_ERR:
|
||||
if config_success:
|
||||
values = {'task': constants.SB_TASK_RECONFIG_CONTROLLER}
|
||||
values = {'task': constants.SB_TASK_PROVISION_STORAGE}
|
||||
else:
|
||||
values = {'task': str(tasks)}
|
||||
self.dbapi.storage_backend_update(ceph_conf.uuid, values)
|
||||
|
|
Loading…
Reference in New Issue