0

I am trying out a new feature for chef called Chef-Metal and it uses Fog as the driver to connect to Openstack. I am having a lot of trouble getting the correct syntax to identify the network I want by name and not :net_id. This is what I have been playing with so far:

:nics => [
  {
    :network => 'net-shared-vlan-25'                     # Doesn't Work
    # :name => 'net-shared-vlan-25'                      # Original Test (didn't work)
    # :net_id => '84685c12-ce9b-4056-8dcb-bfa2283e97bf'  # Works! (but need name)
  }
]

The Error that I keep getting (cleaned up) is:

Expected([200, 202]) <=> Actual(500 InternalServerError)
response => #<Excon::Response:0x0000000421c830
@data = {
  :body => "{\"computeFault\": {\"message\": \"The server has either erred or is incapable of performing the requested operation.\", \"code\": 500}}",
  :headers => {"Content-Length"=>"128", "Content-Type"=>"application/json; charset=UTF-8", "X-Compute-Request-Id"=>"req-eb48b850-0449-4a02-ae96-f6374b047b37", "Date"=>"Tue, 01 Jul 2014 16:08:55 GMT"},
  :status => 500,
  :remote_ip => "10.129.10.250",
  :local_port => 54683,
  :local_address => "10.129.17.41"},
@body = "{\"computeFault\": {\"message\": \"The server has either erred or is incapable of performing the requested operation.\", \"code\": 500}}",
@headers = {"Content-Length"=>"128", "Content-Type"=>"application/json; charset=UTF-8", "X-Compute-Request-Id"=>"req-eb48b850-0449-4a02-ae96-f6374b047b37", "Date"=>"Tue, 01 Jul 2014 16:08:55 GMT"},
@status = 500,
@remote_ip = "10.129.10.250",
@local_port = 54683,
@local_address = "10.129.17.41">

If anyone knows the correct syntax that is needed to identify a network by name instead of ID in Openstack using Fog, your help would be greatly appreciated. Thanks.

jarsever
  • 690
  • 1
  • 7
  • 15

1 Answers1

0

Unfortunately, Chef Metal, and more accurately, the Fog gem, only allows you to specify a network by its id. The relevant code in Fog can be found here:

data['server']['networks'] = options[:networks] || [
  { :uuid => '00000000-0000-0000-0000-000000000000' },
  { :uuid => '11111111-1111-1111-1111-111111111111' }
]

Which is a little bit annoying, I understand.

But this is Open Source! You can always write a pull request for the Fog gem to look up the ID of the network from the name. And the great news is, if Fog supports it, then Chef Metal will!