vulk-archive / kitchen-vcair

A vCloud Air driver for Test Kitchen
Other
0 stars 1 forks source link

Issues creating instance #3

Open cstewart87 opened 9 years ago

cstewart87 commented 9 years ago

I'm currently unable to create an instance using the kitchen-vcair driver.

.kitchen.yml:


---
driver_plugin: vcair
driver_config:
  vcair_username: USERNAME
  vcair_password: USER_PWD
  vcair_api_host: us-california-1-3.vchs.vmware.com
  vcair_vm_password: VM_PWD
  vcair_org: ORG_ID

provisioner:
  name: chef_zero

platforms:
  - name: centos-6.4

suites:
  - name: default
    run_list:
      - recipe[hello_world::default]
    attributes:

Stacktrace:

$ kitchen converge default
-----> Starting Kitchen (v1.4.0)
-----> Creating <default-centos-64>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [<html><head><title>VMware vFabric tc Runtime 2.9.5.SR1/7.0.50.C.RELEASE - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - unauthorized.header.malformed</h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u>unauthorized.header.malformed</u></p><p><b>description</b> <u>The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.springframework.security.web.authentication.preauth.PreAuthenticatedCredentialsNotFoundException: unauthorized.header.malformed
    com.vmware.vchs.iam.security.ApiAuthenticationFilter.getPreAuthenticatedPrincipal(ApiAuthenticationFilter.java:49)
    org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doAuthenticate(AbstractPreAuthenticatedProcessingFilter.java:103)
    org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:91)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the VMware vFabric tc Runtime 2.9.5.SR1/7.0.50.C.RELEASE logs.</u></p><HR size="1" noshade="noshade"><h3>VMware vFabric tc Runtime 2.9.5.SR1/7.0.50.C.RELEASE</h3></body></html>]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

I should also note that when using the vca-cli I have to pass in a subscription/instance id, but I don't see that option provided in the kitchen-vcair driver configs

hh commented 9 years ago

I haven't used the vca-cli myself, but haven't found a subscription/instance id necessary.

Try starting with a known working yaml from the a walkthu and apply it to a cookbook: https://www.youtube.com/watch?v=5srDko69XJ0

git clone git@github.com:chef-cookbooks/httpd.git
cd httpd
cat <<EOF>.kitchen.vcair.yml
---
driver_config:
  vcair_username: <%= ENV['VCAIR_USERNAME'] %>
  vcair_password: <%= ENV['VCAIR_PASSWORD'] %>
  vcair_api_host: <%= ENV['VCAIR_API_HOST'] %>
  vcair_org: <%= ENV['VCAIR_ORG'] %>

provisioner:
  name: chef_zero
  require_chef_omnibus: latest

platforms:
- name: centos-6.4
  driver_plugin: vcair
  driver_config:
    size: 2gb
    image: centos-6-4-x64
    vcair_ssh_password: <%= ENV['VCAIR_SSH_PASSWORD'] %>

suites:
  #
  # hello_world_test
  #
  - name: hello_world_test
    run_list:
    - recipe[hello_world_test]
EOF

$ KITCHEN_YAML=".kitchen.vcair.yml" kitchen converge hello-world-test-centos-64
-----> Starting Kitchen (v1.4.1)
-----> Creating <hello-world-test-centos-64>...
    100/100  |**************************************************|  
    100/100  |**************************************************|  
    100/100  |**************************************************|  
    100/100  |**************************************************|  
       vCloud Air instance <vm-1a6066e7-ef3c-4953-9672-bc95c99f04b2> created.
       (server ready)
      (ssh ready)
       Finished creating <hello-world-test-centos-64> (5m21.04s).
-----> Converging <hello-world-test-centos-64>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 3.2.4...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
-----> Installing Chef Omnibus (always install latest version)
       Downloading https://www.chef.io/chef/install.sh to file /tmp/install.sh
       Trying curl...
       Download complete.
       Downloading Chef  for el...
       downloading https://www.chef.io/chef/metadata?v=&prerelease=false&nightlies=false&p=el&pv=6&m=x86_64
         to file /tmp/install.sh.1621/metadata.txt
       trying curl...
       url      https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chef-12.4.1-1.el6.x86_64.rpm
       md5      f09a9ae589bb9040232c600b008ef812
       sha256   95150a4b3c3b2313bd206876e09e2fcf742f2fa4611951d52c79225becb32928
       downloaded metadata file looks valid...
       downloading https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chef-12.4.1-1.el6.x86_64.rpm
         to file /tmp/install.sh.1621/chef-12.4.1-1.el6.x86_64.rpm
       trying curl...
       Comparing checksum with sha256sum...

       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

       You are installing an omnibus package without a version pin.  If you are installing
       on production servers via an automated process this is DANGEROUS and you will
       be upgraded without warning on new releases, even to new major releases.
       Letting the version float is only appropriate in desktop, test, development or
       CI/CD environments.

       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

       Installing Chef 
       installing with rpm...
       warning: /tmp/install.sh.1621/chef-12.4.1-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
       Preparing...                ########################################### [100%]
          1:chef                   ########################################### [100%]
       Thank you for installing Chef!
       Transferring files to <hello-world-test-centos-64>
       Starting Chef Client, version 12.4.1
       Creating a new client identity for hello-world-test-centos-64 using the validator key.
       [2015-08-03T11:29:10-05:00] WARN: Child with name 'dna.json' found in multiple directories: /tmp/kitchen/dna.json and /tmp/kitchen/dna.json
       [2015-08-03T11:29:10-05:00] WARN: Child with name 'dna.json' found in multiple directories: /tmp/kitchen/dna.json and /tmp/kitchen/dna.json
       resolving cookbooks for run list: ["hello_world_test"]
       [2015-08-03T11:29:10-05:00] WARN: Child with name 'dna.json' found in multiple directories: /tmp/kitchen/dna.json and /tmp/kitchen/dna.json
       Synchronizing Cookbooks:
         - hello_world_test
         - httpd
       Compiling Cookbooks...
       Converging 3 resources
       Recipe: hello_world_test::default

### ommitting heaps of converged resources ###

      Running handlers:
       Running handlers complete
       Chef Client finished, 63/106 resources updated in 17.943300364 seconds
       Finished converging <hello-world-test-centos-64> (0m34.02s).
-----> Kitchen is finished. (6m57.85s)
hh commented 9 years ago

I tried this simpler config and it also worked. Can you push a repo that I can use to replicate the issue?

---
driver_plugin: vcair
driver_config:
  vcair_username: <%= ENV['VCAIR_USERNAMEX'] %>
  vcair_password: <%= ENV['VCAIR_PASSWORDX'] %>
  vcair_api_host: <%= ENV['VCAIR_API_HOSTX'] %>
  vcair_org: <%= ENV['VCAIR_ORGX'] %>
  vcair_ssh_password: <%= ENV['VCAIR_SSH_PASSWORDX'] %>
  size: 2gb

provisioner:
  name: chef_zero
  require_chef_omnibus: latest

platforms:
- name: centos-6.4

suites:
  - name: default
    run_list:
    - recipe[hello_world_test]
cstewart87 commented 9 years ago

Do you know if the API host you're using is subscription based or on demand?

hh commented 9 years ago

Subscription