Skip to content

Commit

Permalink
Add POWERVM_STARTING state to powervm driver
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Lance Bragstad committed Nov 29, 2012
1 parent 0a8491f commit 924084b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions nova/virt/powervm/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

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')
Expand Down
3 changes: 2 additions & 1 deletion nova/virt/powervm/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def get_info(self, instance_name):
"""
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'],
Expand Down

0 comments on commit 924084b

Please sign in to comment.