【问题标题】:kitchen openstack steps/example厨房 openstack 步骤/示例
【发布时间】:2014-06-22 03:32:00
【问题描述】:

我正在尝试使用 kitchen-openstack 使其成为工具测试厨房,以对我们拥有的一些 Chef 食谱执行一些集成/功能测试。

但我无法让它工作:( 我有一个包含以下内容的 .kitchen.yml:

driver:
  name: openstack
  openstack_username: test
  openstack_api_key: test
  openstack_auth_url: http://<openstackServerIp>:35357/v2.0/
  require_chef_omnibus: latest
  image_ref: CentOS-6.5-Template
  flavor_ref: cloud.tiny
  openstack_tenant: test

provisioner:
  name: chef_solo

platforms:
  - name: centos-6.5

suites:
  - name: default
    run_list:
      - recipe[myTestChef::default]

到目前为止,当我执行 kitchen create default-centos-65 时,我收到的是:

Message: Expected([200, 204]) <=> Actual(400 Bad Request)
  response => #<Excon::Response:0x00000001eed698 @data={:body=>"{\"error\": {\"message\": \"get_version_v2() got an unexpected keyword argument 'auth'\", \"code\": 400, \"title\": \"Bad Request\"}}", :headers=>{"Vary"=>"X-Auth-Token", "Content-Type"=>"application/json", "Content-Length"=>"121", "Date"=>"Mon, 05 May 2014 18:02:15 GMT"}, :status=>400, :remote_ip=>"<openstackServerIp>", :local_port=>34592, :local_address=>"192.168.10.32"}, @body="{\"error\": {\"message\": \"get_version_v2() got an unexpected keyword argument 'auth'\", \"code\": 400, \"title\": \"Bad Request\"}}", @headers={"Vary"=>"X-Auth-Token", "Content-Type"=>"application/json", "Content-Length"=>"121", "Date"=>"Mon, 05 May 2014 18:02:15 GMT"}, @status=400, @remote_ip="<openstackServerIp>", @local_port=34592, @local_address="192.168.10.32">

当我运行厨房清单时,我得到:

Instance           Driver     Provisioner  Last Action
default-centos-65  Openstack  ChefSolo     <Not Created>

我做错了什么?谁能分享一些如何设置的步骤或示例?

我从在 OpenStack 的同一项目中创建的 VM 运行它。

【问题讨论】:

  • 请在以后格式化您的代码
  • 对不起,我不太清楚如何使用这个格式,我在这里是全新的发帖问题。

标签: chef-infra openstack test-kitchen


【解决方案1】:

我发现了问题。我还必须指定:

  • 服务器名称:&lt;VMName to create&gt;
  • network_ref:&lt;the name of the network where the VM will be created&gt;
  • public_key_path:/home/&lt;some local user&gt;/.ssh/id_rsa.pub
  • private_key_path:/home/&lt;some local user&gt;/.ssh/id_rsa
  • 用户名:&lt;user to login into the VM that will be created&gt;

public_key_pathprivate_key_path 必须与将要创建虚拟机的 autorized_key 相关。

需要最后 3 个 SSH 值,以便 Kitchen 可以连接到创建的虚拟机,以便在那里应用厨师食谱。

【讨论】:

    【解决方案2】:

    你从 OpenStack 得到的错误:

    "get_version_v2() 得到了一个意外的关键字参数 'auth'\"

    这是因为身份验证 URL。我在使用 libcloud 连接到 OpenStack API 时遇到了同样的问题。

    我在尝试什么:

    http://localhost:5000/v2.0/
    

    解决办法:

    http://localhost:5000/
    http://localhost:5000/v2.0/tokens/
    

    来源:Connecting to the OpenStack installation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-06
      • 1970-01-01
      • 1970-01-01
      • 2015-06-28
      • 1970-01-01
      • 1970-01-01
      • 2017-06-10
      相关资源
      最近更新 更多