Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network configuration is lost when machine definition overrides provider's configuration #146

Closed
ggiamarchi opened this issue Nov 1, 2014 · 0 comments · Fixed by #150
Closed
Assignees
Labels
Milestone

Comments

@ggiamarchi
Copy link
Owner

When network configuration is defined in a provider block outside of a machine definition, it is not taken into account if the provider configuration is overridden inside a machine definition.

For instance, in my tenant i have two networks net1 and net2. The following Vagrantfile fails on vagrant up

Vagrant.configure('2') do |config|

  config.ssh.username = ENV['OS_SSH_USERNAME']

  config.vm.provider :openstack do |os|
    os.openstack_auth_url    = ENV['OS_AUTH_URL']
    os.tenant_name           = ENV['OS_TENANT_NAME']
    os.username              = ENV['OS_USERNAME']
    os.password              = ENV['OS_PASSWORD']
    os.floating_ip_pool      = ENV['OS_FLOATING_IP_POOL']
    os.flavor                = ENV['OS_FLAVOR']
    os.image                 = ENV['OS_IMAGE']
    os.networks             << 'net1'
  end

  config.vm.define 'server' do |s|
    s.vm.provider :openstack do

    end
  end
end

with the error

Multiple possible networks found, use a Network ID to be more specific.

because the network configuration had not been included in the query sent to nova to create the machine.

If i define machines without override provider's configuration it works. For instance,

config.vm.define 'server-1' do |s|
  s.vm.provider :openstack
end

config.vm.define 'server-2'

works correctly.

@ggiamarchi ggiamarchi added the bug label Nov 1, 2014
@julienvey julienvey added this to the 0.6 milestone Nov 5, 2014
@julienvey julienvey self-assigned this Nov 5, 2014
julienvey added a commit that referenced this issue Nov 5, 2014
For config values of type Array, we don't check for UNSET_VALUE
but only if the array is empty or not

Fix #146
julienvey added a commit that referenced this issue Nov 7, 2014
For config values of type Array, we don't check for UNSET_VALUE
but only if the array is empty or not

Fix #146
Sharpie pushed a commit to Sharpie/vagrant-openstack-provider that referenced this issue Jan 18, 2016
For config values of type Array, we don't check for UNSET_VALUE
but only if the array is empty or not

Fix ggiamarchi#146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants