From 8dfa83747d1801efd40b76d750b459d2bb5ac773 Mon Sep 17 00:00:00 2001 From: Andreas Scheuring Date: Tue, 27 Mar 2018 14:45:09 +0200 Subject: [PATCH] Use status_timeout when starting a partition We now specify the status timeout when starting a partition. The zhmcclient will wait that amount of seconds for the partition to become active (or another valid start status). Without explicitly setting it, the zhmcclient will wait for 900 seconds. In the past we waited that 900 seconds + the 60 extra seconds, as we were calling partition.wait_for_completion right after the start of the partition again. Change-Id: I483efc5808c1a91993dbde936c27b82302640f9e --- nova_dpm/virt/dpm/vm.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/nova_dpm/virt/dpm/vm.py b/nova_dpm/virt/dpm/vm.py index 1e3145e..f7337cb 100644 --- a/nova_dpm/virt/dpm/vm.py +++ b/nova_dpm/virt/dpm/vm.py @@ -406,9 +406,7 @@ class PartitionInstance(object): status=utils.PartitionState.STOPPED, status_timeout=60) if self.partition.get_property('status') not in STARTED_STATUSES: - self.partition.start(True) - self.partition.wait_for_status( - status=STARTED_STATUSES, status_timeout=60) + self.partition.start(True, status_timeout=STATUS_TIMEOUT) def _ensure_status_transitioned(self): partition_state = self.partition.get_property('status') @@ -438,12 +436,7 @@ class PartitionInstance(object): status=utils.PartitionState.STOPPED, status_timeout=STATUS_TIMEOUT) - self.partition.start(True) - # TODO(preethipy): The below method to be removed once the bug - # on DPM(701894) is fixed to return correct status on API return - self.partition.wait_for_status( - status=utils.PartitionState.RUNNING, - status_timeout=STATUS_TIMEOUT) + self.partition.start(True, status_timeout=STATUS_TIMEOUT) def get_partition(self): """Get the zhmcclient partition object for this PartitionInstance