Skip to content

Commit

Permalink
vSphere: Do cold power off in node restart scnenarios instead of grac…
Browse files Browse the repository at this point in the history
…eful OS shutdown (#2921)

* vSphere: Do cold power off in node restart scnenarios instead of graceful OS shutdown

Signed-off-by: Elad Ben Aharon <[email protected]>

* Fix

Signed-off-by: Elad Ben Aharon <[email protected]>

* Fix

Signed-off-by: Elad Ben Aharon <[email protected]>
  • Loading branch information
ebenahar authored Sep 11, 2020
1 parent 21e8536 commit cc113ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions ocs_ci/ocs/platform_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def start_nodes(self, nodes, wait=True):
)
self.vsphere.start_vms(vms)

def restart_nodes(self, nodes, force=False, timeout=300, wait=True):
def restart_nodes(self, nodes, force=True, timeout=300, wait=True):
"""
Restart vSphere VMs
Expand Down Expand Up @@ -289,16 +289,10 @@ def restart_nodes(self, nodes, force=False, timeout=300, wait=True):
OCP node reaches status Ready.
"""
nodes_names = [n.name for n in nodes]
logger.info(
f"Waiting for nodes: {nodes_names} to reach not ready state"
)
wait_for_nodes_status(
node_names=nodes_names, status=constants.NODE_NOT_READY,
timeout=timeout
)
logger.info(
f"Waiting for nodes: {nodes_names} to reach ready state"
)
wait_for_nodes_status(
node_names=nodes_names, status=constants.NODE_READY,
timeout=timeout
Expand Down
4 changes: 2 additions & 2 deletions tests/manage/z_cluster/nodes/test_nodes_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def test_rolling_nodes_restart(self, nodes, pvc_factory, pod_factory):
"""
ocp_nodes = get_node_objs()
for node in ocp_nodes:
nodes.restart_nodes(nodes=[node])
self.sanity_helpers.health_check(cluster_check=False)
nodes.restart_nodes(nodes=[node], wait=False)
self.sanity_helpers.health_check(cluster_check=False, tries=60)
self.sanity_helpers.create_resources(pvc_factory, pod_factory)

@pytest.mark.parametrize(
Expand Down

0 comments on commit cc113ae

Please sign in to comment.