-1

I am trying to make it work the tool test kitchen with kitchen-openstack to perform some integration/functional test of some Chef recipes we have.

But I cannot get it work :( I have a .kitchen.yml with following content:

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]

What I receive til now when I do kitchen create default-centos-65 is:

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

When I run kitchen list, I get:

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

What am I doing wrong? Can anybody share some steps or examples how to set it up?

I am running this from a VM created in the same project of OpenStack.

sethvargo
  • 26,739
  • 10
  • 86
  • 156
user2620348
  • 309
  • 4
  • 15

2 Answers2

1

I found the issue. I have to specify also the:

  • server_name: <VMName to create>
  • network_ref: <the name of the network where the VM will be created>
  • public_key_path: /home/<some local user>/.ssh/id_rsa.pub
  • private_key_path: /home/<some local user>/.ssh/id_rsa
  • username: <user to login into the VM that will be created>

The public_key_path and private_key_path must be related with the autorized_key that will have the virtual machine to be created.

These last 3 SSH values are needed so Kitchen can connect into the created virtual machine so it can apply the chef recipes there.

David Guyon
  • 2,759
  • 1
  • 28
  • 40
user2620348
  • 309
  • 4
  • 15
1

The error you get from OpenStack:

"get_version_v2() got an unexpected keyword argument 'auth'\"

This is because of the authentication URL. I had the same problem while using libcloud to connect to the OpenStack API.

What I was trying:

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

The solution:

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

Source: Connecting to the OpenStack installation

David Guyon
  • 2,759
  • 1
  • 28
  • 40