Fix controller swact error caused by drbd resizing

Add check to prevent 'system host-swact' to be executed while drbd
filesytems are being resized.

Story: 2002990
Task: 23004

Change-Id: Id69309042672577435fbc4c743c65f38d4c2edb5
Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
This commit is contained in:
Kristine Bujold 2018-08-15 12:27:59 -04:00
parent 4340414bb5
commit d175f7784e
2 changed files with 12 additions and 1 deletions

View File

@ -1,2 +1,2 @@
SRC_DIR="sysinv"
TIS_PATCH_VER=277
TIS_PATCH_VER=278

View File

@ -5372,6 +5372,17 @@ class HostController(rest.RestController):
if utils.get_https_enabled():
self._semantic_check_tpm_config(ihost_ctr)
# Check: If DRBD is resizing
controller_fs_list = pecan.request.dbapi.controller_fs_get_list()
for controller_fs in controller_fs_list:
if controller_fs['replicated']:
if (controller_fs.get('state') ==
constants.CONTROLLER_FS_RESIZING_IN_PROGRESS):
raise wsme.exc.ClientSideError(
_("drbd '%s' is resizing. Wait for the resizing to "
"complete before issuing Swact") %
(controller_fs['name']))
# Check: Valid Swact action: Pre-Swact Check
response = sm_api.swact_pre_check(hostupdate.ihost_orig['hostname'],
timeout=30)