From: David Lutterkort <[email protected]>
---
server/lib/cimi/models/machine_create.rb | 2 ++
server/lib/cimi/models/machine_template.rb | 1 +
2 files changed, 3 insertions(+)
diff --git a/server/lib/cimi/models/machine_create.rb
b/server/lib/cimi/models/machine_create.rb
index c0b107c..0f04c01 100644
--- a/server/lib/cimi/models/machine_create.rb
+++ b/server/lib/cimi/models/machine_create.rb
@@ -22,11 +22,13 @@ class CIMI::Model::MachineCreate < CIMI::Model::Base
if machine_template.href
template = machine_template.find(ctx)
params[:hwp_id] = template.machine_config.ref_id(ctx)
+ params[:initial_state] = template.initial_state
image_id = template.machine_image.ref_id(ctx)
else
# FIXME: What if either of these href's isn't there ? What if the user
# tries to override some aspect of the machine_config/machine_image ?
params[:hwp_id] = machine_template.machine_config.href.split('/').last
+ params[:initial_state] = machine_template.initial_state
image_id = machine_template.machine_image.href.split('/').last
if machine_template.credential.href
params[:keyname] = machine_template.credential.href.split('/').last
diff --git a/server/lib/cimi/models/machine_template.rb
b/server/lib/cimi/models/machine_template.rb
index faecc5c..69578b1 100644
--- a/server/lib/cimi/models/machine_template.rb
+++ b/server/lib/cimi/models/machine_template.rb
@@ -17,6 +17,7 @@ class CIMI::Model::MachineTemplate < CIMI::Model::Base
acts_as_root_entity
+ text :initial_state
ref :machine_config
ref :machine_image
ref :credential
--
1.8.1.2