Skip to content

Commit

Permalink
Merge pull request #560 from xtoddx/oszones
Browse files Browse the repository at this point in the history
[OpenStack|compute] add zone awareness
  • Loading branch information
geemus committed Oct 11, 2011
2 parents 2acb300 + 7b664a9 commit 3f00d86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fog/openstack/models/compute/server.rb
Expand Up @@ -20,6 +20,7 @@ class Server < Fog::Compute::Server
attribute :progress
attribute :accessIPv4
attribute :accessIPv6
attribute :availability_zone
attribute :state, :aliases => 'status'

attr_reader :password
Expand Down Expand Up @@ -153,7 +154,8 @@ def save
'metadata' => meta_hash,
'personality' => personality,
'accessIPv4' => accessIPv4,
'accessIPv6' => accessIPv6
'accessIPv6' => accessIPv6,
'availability_zone' => availability_zone
}
options = options.reject {|key, value| value.nil?}
data = connection.create_server(name, image_ref, flavor_ref, options)
Expand Down
3 changes: 3 additions & 0 deletions lib/fog/openstack/requests/compute/create_server.rb
Expand Up @@ -30,6 +30,9 @@ def create_server(name, image_ref, flavor_ref, options = {})
}
end
end
if options['availability_zone']
data['server']['availability_zone'] = options['availability_zone']
end
request(
:body => MultiJson.encode(data),
:expects => [200, 202],
Expand Down

0 comments on commit 3f00d86

Please sign in to comment.