mitchellh / vagrant-rackspace

Use Vagrant to manage Rackspace Cloud instances.
MIT License
236 stars 155 forks source link

README Error Regarding Networks #145

Closed derks closed 8 years ago

derks commented 8 years ago

The README references rs.network = 'some-network-uuid':

However this throws the error:

There are errors in the configuration of this machine. Please fix
the following errors and try again:

RackSpace Provider:
* The following settings shouldn't exist: network

Looking at the code:

It appears this should actually be rs.networks and takes an Array:

rs.networks = [
  'some-network-uuid',
  'some-other-network-uuid',
]
derks commented 8 years ago

I was going to make a pull-request, but realized that I do not know how the situation is (or isn't) handled regarding:

rs.network :service_net, :attached => false

?

FWIW, using the following did attached the cloud network in question:

rs.networks = [
  'some-network-uuid',
  'some-other-network-uuid',
]
derks commented 8 years ago

Sorry... BIG CORRECTION:

Using the above infact does not work... unless I specify all networks including PublicNet and ServiceNet. The box I just built only had my custom network, and no PrivateNet/ServiceNet. This does work:

rs.networks = [
  '00000000-0000-0000-0000-000000000000',
  '11111111-1111-1111-1111-111111111111',
  'some-network-uuid',
]

Apologies for all the noise.

DavidWittman commented 8 years ago

@derks Here's the example directly from the README:

config.vm.provider :rackspace do |rs|
  rs.username = ENV['RAX_USERNAME']
  rs.api_key  = ENV['RAX_API_KEY']
  rs.network '443aff42-be57-effb-ad30-c097c1e4503f'
  rs.network '5e738e11-def2-4a75-ad1e-05bbe3b49efe'
  rs.network :service_net, :attached => false
end

Notice that rs.network is calling a method and not setting a value with =. This is akin to using the Virtualbox provider and defining additional networks. Behind the scenes this just manipulates the rs.networks attribute, which you've found that you can define directly from the provider config as well.

derks commented 8 years ago

Of course! Not the first time this oversight has bit me in the ass. Many apologies for the noise, and thanks for the quick response.