【问题标题】:Fog and Openstack can't specify network by nameFog 和 Openstack 无法按名称指定网络
【发布时间】:2014-07-01 16:36:45
【问题描述】:

我正在为 Chef 尝试一项名为 Chef-Metal 的新功能,它使用 Fog 作为连接到 Openstack 的驱动程序。我很难获得正确的语法来通过名称而不是:net_id来识别我想要的网络。这是我迄今为止一直在玩的:

: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)
  }
]

我不断得到(清理)的错误是:

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">

如果有人知道使用 Fog 在 Openstack 中通过名称而不是 ID 识别网络所需的正确语法,我们将不胜感激。谢谢。

【问题讨论】:

    标签: chef-infra openstack fog


    【解决方案1】:

    不幸的是,Chef Metal,更准确地说是 Fog gem,只允许您通过 id 指定网络。 Fog中的相关代码可以找到here

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

    这有点烦人,我明白。

    但这是开源的!您始终可以为 Fog gem 编写拉取请求,以从名称中查找网络 ID。好消息是,如果 Fog 支持它,那么 Chef Metal 会支持它!

    【讨论】:

      猜你喜欢
      • 2018-06-06
      • 1970-01-01
      • 2013-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-24
      • 1970-01-01
      • 2016-01-13
      相关资源
      最近更新 更多