You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Oved Ourfali <oo...@redhat.com> on 2013/02/07 14:20:18 UTC
[PATCH] passing realm option when creating a new VM
---
server/lib/cimi/models/machine.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/server/lib/cimi/models/machine.rb b/server/lib/cimi/models/machine.rb
index 6e075e8..9164847 100644
--- a/server/lib/cimi/models/machine.rb
+++ b/server/lib/cimi/models/machine.rb
@@ -70,6 +70,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
additional_params[:initial_state] = machine_template["initialState"].strip
end
additional_params[:name] = json['name'] if json['name']
+ additional_params[:realm_id] = json['realm'] if json['realm']
instance = context.driver.create_instance(context.credentials, image_id, {
:hwp_id => hardware_profile_id
}.merge(additional_params))
@@ -99,6 +100,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
additional_params[:initial_state] = xml["machineTemplate"][0]["initialState"].first.strip
end
additional_params[:name] = xml['name'][0] if xml['name']
+ additional_params[:realm_id] = xml['realm'][0] if xml['realm']
instance = context.driver.create_instance(context.credentials, image_id, {
:hwp_id => hardware_profile_id
}.merge(additional_params))
--
1.7.11.2
Re: [PATCH] passing realm option when creating a new VM
Posted by David Lutterkort <lu...@redhat.com>.
On Thu, 2013-02-07 at 14:43 +0100, Michal Fojtik wrote:
> On 02/07, Oved Ourfali wrote:
>
> ACK.
>
> One thought, we do have 'realm' defined for the Machine entity as
> resourceMetadata. Is this element supposed to work also for the
> MachineCreate entity?
Since it's something people should be able to specify for new machines,
yes, we need that. Which raises the question: how do clients know which
extension attributes can be passed in on creation, and which ones can
not ? Or is the assumption that anything can be passed in on creation ?
If the latter, this implies that machine creation also needs to support
fun stuff like attaching volumes.
David
Re: [PATCH] passing realm option when creating a new VM
Posted by Michal Fojtik <mf...@redhat.com>.
On 02/07, Oved Ourfali wrote:
ACK.
One thought, we do have 'realm' defined for the Machine entity as
resourceMetadata. Is this element supposed to work also for the
MachineCreate entity?
-- Michal
> ---
> server/lib/cimi/models/machine.rb | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/server/lib/cimi/models/machine.rb b/server/lib/cimi/models/machine.rb
> index 6e075e8..9164847 100644
> --- a/server/lib/cimi/models/machine.rb
> +++ b/server/lib/cimi/models/machine.rb
> @@ -70,6 +70,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
> additional_params[:initial_state] = machine_template["initialState"].strip
> end
> additional_params[:name] = json['name'] if json['name']
> + additional_params[:realm_id] = json['realm'] if json['realm']
> instance = context.driver.create_instance(context.credentials, image_id, {
> :hwp_id => hardware_profile_id
> }.merge(additional_params))
> @@ -99,6 +100,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
> additional_params[:initial_state] = xml["machineTemplate"][0]["initialState"].first.strip
> end
> additional_params[:name] = xml['name'][0] if xml['name']
> + additional_params[:realm_id] = xml['realm'][0] if xml['realm']
> instance = context.driver.create_instance(context.credentials, image_id, {
> :hwp_id => hardware_profile_id
> }.merge(additional_params))
> --
> 1.7.11.2
>
--
Michal Fojtik <mf...@redhat.com>
Deltacloud API, CloudForms