Skip to content

Commit

Permalink
Adds availability_zone option to specify instance zone
Browse files Browse the repository at this point in the history
  • Loading branch information
antoviaque committed Jul 24, 2013
1 parent 7c9509b commit 4c01db6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/vagrant-openstack-plugin/action/create_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def call(env)
:metadata => config.metadata,
:user_data => config.user_data,
:security_groups => config.security_groups,
:os_scheduler_hints => config.scheduler_hints
:os_scheduler_hints => config.scheduler_hints,
:availability_zone => config.availability_zone
}

# Find a network if provided
Expand Down
5 changes: 5 additions & 0 deletions lib/vagrant-openstack-plugin/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class Config < Vagrant.plugin("2", :config)
# Pass hints to the OpenStack scheduler, e.g. { "cell": "some cell name" }
attr_accessor :scheduler_hints

# Specify the availability zone in which to create the instance
attr_accessor :availability_zone

# List of strings representing the security groups to apply.
# e.g. ['ssh', 'http']
#
Expand Down Expand Up @@ -94,6 +97,7 @@ def initialize
@network = UNSET_VALUE
@address_id = UNSET_VALUE
@scheduler_hints = UNSET_VALUE
@availability_zone = UNSET_VALUE
@security_groups = UNSET_VALUE
@ssh_username = UNSET_VALUE
@tenant = UNSET_VALUE
Expand All @@ -116,6 +120,7 @@ def finalize!
@keypair_name = nil if @keypair_name == UNSET_VALUE

@scheduler_hints = nil if @scheduler_hints == UNSET_VALUE
@availability_zone = nil if @availability_zone == UNSET_VALUE
@security_groups = nil if @security_groups == UNSET_VALUE

# The SSH values by default are nil, and the top-level config
Expand Down

0 comments on commit 4c01db6

Please sign in to comment.