From 924084b4ddde31b07ceb8b789bebc31db8903d08 Mon Sep 17 00:00:00 2001 From: Lance Bragstad Date: Thu, 29 Nov 2012 19:00:37 +0000 Subject: Add POWERVM_STARTING state to powervm driver In current implementation in powervm driver, the 'Starting' state of an instance is not supported. This patch adds this to the powervm driver and allows execution to continue until the instance is in a 'Running' state instead of failing out. This patch fixes Bug #1084641 blueprint powervm-compute-enhancements Change-Id: Ieb17b215547e77ee8d13b18496ba4090fc45757b --- nova/virt/powervm/constants.py | 2 ++ nova/virt/powervm/operator.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nova/virt/powervm/constants.py b/nova/virt/powervm/constants.py index 1990ec5a5..f1d091586 100644 --- a/nova/virt/powervm/constants.py +++ b/nova/virt/powervm/constants.py @@ -18,11 +18,13 @@ from nova.compute import power_state POWERVM_NOSTATE = '' POWERVM_RUNNING = 'Running' +POWERVM_STARTING = 'Starting' POWERVM_SHUTDOWN = 'Not Activated' POWERVM_POWER_STATE = { POWERVM_NOSTATE: power_state.NOSTATE, POWERVM_RUNNING: power_state.RUNNING, POWERVM_SHUTDOWN: power_state.SHUTDOWN, + POWERVM_STARTING: power_state.RUNNING } POWERVM_CPU_INFO = ('ppc64', 'powervm', '3940') diff --git a/nova/virt/powervm/operator.py b/nova/virt/powervm/operator.py index adc7bf7d0..c977f7687 100644 --- a/nova/virt/powervm/operator.py +++ b/nova/virt/powervm/operator.py @@ -74,7 +74,8 @@ class PowerVMOperator(object): """ lpar_instance = self._get_instance(instance_name) - state = constants.POWERVM_POWER_STATE[lpar_instance['state']] + state = constants.POWERVM_POWER_STATE.get( + lpar_instance['state'], power_state.NOSTATE) return {'state': state, 'max_mem': lpar_instance['max_mem'], 'mem': lpar_instance['desired_mem'], -- cgit