mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[OpenStack|compute] add zone awareness
Nova has a `ZoneScheduler` that can run instances on a particular set of hardware. This attribute hasn't been documented in the api spec, but is effective at setting the availability_zone and letting ZoneScheduler work.
This commit is contained in:
parent
87d07b7787
commit
7b664a9337
2 changed files with 6 additions and 1 deletions
|
@ -20,6 +20,7 @@ module Fog
|
|||
attribute :progress
|
||||
attribute :accessIPv4
|
||||
attribute :accessIPv6
|
||||
attribute :availability_zone
|
||||
attribute :state, :aliases => 'status'
|
||||
|
||||
attr_reader :password
|
||||
|
@ -152,7 +153,8 @@ module Fog
|
|||
'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)
|
||||
|
|
|
@ -30,6 +30,9 @@ module Fog
|
|||
}
|
||||
end
|
||||
end
|
||||
if options['availability_zone']
|
||||
data['server']['availability_zone'] = options['availability_zone']
|
||||
end
|
||||
request(
|
||||
:body => MultiJson.encode(data),
|
||||
:expects => [200, 202],
|
||||
|
|
Loading…
Reference in a new issue