test-kitchen / kitchen-openstack

OpenStack Compute driver for Test-Kitchen
Other
56 stars 77 forks source link

kitchen-openstack failing to get 201, receiving 400 agaisnt OpenStack v3 #180

Closed FilBot3 closed 4 years ago

FilBot3 commented 6 years ago

Using Rake to kick off Test-Kitchen and load my environment variables so I don't have to keep re-exporting them all the time, I run into bad request errors.

My .kitchen.yml

---
driver:
  name: openstack
  openstack_username: <%= ENV['OPENSTACK_USER_NAME'] %>
  openstack_api_key: <%= ENV['OPENSTACK_USER_PASS'] %>
  openstack_auth_url: <%= ENV['OPENSTACK_AUTH_URL'] %>
  openstack_domain_name: <%= ENV['OPENSTACK_DOMAIN_NAME'] %>
  openstack_project_name: <%= ENV['OPENSTACK_PROJECT_NAME'] %>
  openstack_tenant: <%= ENV['OPENSTACK_TENANT_NAME'] %>
  require_chef_omnibus: <%= ENV['OPENSTACK_REQUIRE_CHEF_OMNIBUS'] %>
  image_ref: <%= ENV['OPENSTACK_IMAGE_ID'] %>
  flavor_ref: <%= ENV['OPENSTACK_IMAGE_FLAVOR'] %>
  key_name: <%= ENV['OPENSTACK_KEY_NAME'] %>
  network_id: 
    - <%= ENV['OPENSTACK_NETWORD_IDS'] %>
  security_groups:
    - <%= ENV['OPENSTACK_SECURITY_GROUPS'] %>

#transport:
  #ssh_key: <%= ENV['OPENSTACK_KEY_LOCATION'] %>

platforms:
  - name: redhat-6
    image_ref: <%= ENV['OPENSTACK_IMAGE_ID'] %>
    flavor_ref: <%= ENV['OPENSTACK_IMAGE_FLAVOR'] %>

suites:
  - name: default

Inside my rakelib/config.rake

# encoding: utf-8
# frozen_string_literal: true

ENV['OPENSTACK_AUTH_URL'] = 'https://aaa.aaa.aaa.aaa:5000/v3/auth/tokens'
ENV['OPENSTACK_DOMAIN_NAME'] = 'development-domain'
ENV['OPENSTACK_TENANT_NAME'] = 'HadoopTest'
ENV['OPENSTACK_PROJECT_NAME'] = 'HadoopTest'
ENV['OPENSTACK_FLOATING_IP_POOL'] = 'ext-net'
ENV['OPENSTACK_IMAGE_FLAVOR'] = '17'
ENV['OPENSTACK_IMAGE_ID'] = '96575f23-4ee3-4c99-847f-af0417e33a65'
ENV['OPENSTACK_NETWORK_IDS'] = 'a5d4a8cb-d11a-4456-8e5e-3c7595bab639'
ENV['OPENSTACK_SSH_USER'] = 'cloud-user'
ENV['OPENSTACK_KEY_NAME'] = 'user01_openstack'
ENV['OPENSTACK_SECURITY_GROUPS'] = 'os_sg_splunk'
ENV['OPENSTACK_REQUIRE_CHEF_OMNIBUS'] = true

Inside my rakelib/secrets.rake

# encoding: utf-8

ENV['OPENSTACK_USER_NAME'] = 'user01'
ENV['OPENSTACK_USER_PASS'] = 'password'
$ bundle exec rake integration['default-redhat-6','create']
Unable to load RuboCop RubyGem
Unable to load FoodCritic RubyGem
-----> Creating <default-redhat-6>...
rake aborted!
Kitchen::InstanceFailure: Create failed on instance <default-redhat-6>.  Please see .kitchen/logs/default-redhat-6.log for more details
/Users/user01/.rbenv/versions/2.4.1/bin/bundle:23:in `load'
/Users/user01/.rbenv/versions/2.4.1/bin/bundle:23:in `<main>'

Caused by:
Kitchen::ActionFailed: Expected([200, 202]) <=> Actual(400 Bad Request)
excon.error.response
  :body          => "{\"badRequest\": {\"message\": \"Bad network format: missing 'uuid'\", \"code\": 400}}"
  :cookies       => [
  ]
  :headers       => {
    "Content-Length"       => "78"
    "Content-Type"         => "application/json; charset=UTF-8"
    "Date"                 => "Tue, 13 Feb 2018 19:33:36 GMT"
    "X-Compute-Request-Id" => "req-34419c3b-5b64-41d1-8e70-29a71e85a71d"
  }
  :host          => "xxx.xxx.xxx.xxx"
  :local_address => "yyy.yyy.yyy.yyy"
  :local_port    => 50723
  :path          => "/v2/b8222d8f44ff41efaae1a125c30bd4f0/servers"
  :port          => 8774
  :reason_phrase => "Bad Request"
  :remote_ip     => "xxx.xxx.xxx.xxx"
  :status        => 400
  :status_line   => "HTTP/1.1 400 Bad Request\r\n"
/Users/user01/.rbenv/versions/2.4.1/bin/bundle:23:in `load'
/Users/user01/.rbenv/versions/2.4.1/bin/bundle:23:in `<main>'

Caused by:
Excon::Error::BadRequest: Expected([200, 202]) <=> Actual(400 Bad Request)
excon.error.response
  :body          => "{\"badRequest\": {\"message\": \"Bad network format: missing 'uuid'\", \"code\": 400}}"
  :cookies       => [
  ]
  :headers       => {
    "Content-Length"       => "78"
    "Content-Type"         => "application/json; charset=UTF-8"
    "Date"                 => "Tue, 13 Feb 2018 19:33:36 GMT"
    "X-Compute-Request-Id" => "req-34419c3b-5b64-41d1-8e70-29a71e85a71d"
  }
  :host          => "xxx.xxx.xxx.xxx"
  :local_address => "yyy.yyy.yyy.yyy"
  :local_port    => 50723
  :path          => "/v2/b8222d8f44ff41efaae1a125c30bd4f0/servers"
  :port          => 8774
  :reason_phrase => "Bad Request"
  :remote_ip     => "xxx.xxx.xxx.xxx"
  :status        => 400
  :status_line   => "HTTP/1.1 400 Bad Request\r\n"
/Users/user01/.rbenv/versions/2.4.1/bin/bundle:23:in `load'
/Users/user01/.rbenv/versions/2.4.1/bin/bundle:23:in `<main>'
Tasks: TOP => integration => integration:vagrant
(See full trace by running task with --trace)
user01@computer01 [13:33:36] ~/Documents/development/OpenStack/splunk_vagrant_openstack  [master !?]
$
ramereth commented 4 years ago

Is this still happening with the latest release? I believe this might be already fixed.

FilBot3 commented 4 years ago

I am not sure. My new place of employment does not have OpenStack. So I cannot provide any more assistance. This can be closed since I cannot help.