0

I have a chef cookbook that works when using kitchen to test it on aws. I want to instead have it test with our vsphere cluster. I can't seem to find any MODERN documentation on how to make this work. Currently, kitchen create seems to work, and then it moves on to the converge phase.

      Finished creating <default-ubuntu-1604> (1m12.66s).
-----> Converging <default-ubuntu-1604>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 6.3.1...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb

Unfortunately, it just hangs at the 'preparing client.rb' line. I don't know if it ever comes back or times out, but it hangs for at least 45 minutes.

If I do kitchen converge -l debug, I also get

D      Creating client.rb from {:node_name=>"default-ubuntu-1604", 
:checksum_path=>"/tmp/kitchen/checksums", 
:file_cache_path=>"/tmp/kitchen/cache", 
:file_backup_path=>"/tmp/kitchen/backup", :cookbook_path=>
["/tmp/kitchen/cookbooks", "/tmp/kitchen/site-cookbooks"], 
:data_bag_path=>"/tmp/kitchen/data_bags", 
:environment_path=>"/tmp/kitchen/environments", 
:node_path=>"/tmp/kitchen/nodes", :role_path=>"/tmp/kitchen/roles", 
:client_path=>"/tmp/kitchen/clients", 
:user_path=>"/tmp/kitchen/users", 
:validation_key=>"/tmp/kitchen/validation.pem", 
:client_key=>"/tmp/kitchen/client.pem", 
:chef_server_url=>"http://127.0.0.1:8889", 
:encrypted_data_bag_secret=>"/tmp/kitchen/encrypted_data_bag_secret", 
:treat_deprecation_warnings_as_errors=>false, :named_run_list=>{}}

D      [SSH] 
ubuntu@192.168.21.123<{:user_known_hosts_file=>"/dev/null", 
:paranoid=>false, :port=>22, :compression=>false, 
:compression_level=>0, :keepalive=>true, :keepalive_interval=>60, 
:timeout=>15, :password=>"password"}> (sudo sh -c '

chef_omnibus_root="/opt/chef"
chef_omnibus_url="https://omnitruck.chef.io/install.sh"
install_flags=""
pretty_version="install only if missing"
sudo_sh="sudo sh"
version="true"

<snip a whole bunch of shell script>

main
')

D      [SSH] opening connection to 
ubuntu@192.168.21.123<{:user_known_hosts_file=>"/dev/null", 
:paranoid=>false, :port=>22, :compression=>false, 
:compression_level=>0, :keepalive=>true, :keepalive_interval=>60, 
:timeout=>15, :password=>"password"}>

after which point it appears to hang on the ssh call.

Here is my .kitchen.yml file:

---
driver:
  name: vsphere
  driver_options:
    host: '<redacted>'
    user: '<redacted>'
    password: '<redacted>'
    insecure: true
  machine_options:
    start_timeout: 600
    create_timeout: 600
    ready_timeout: 90
    bootstrap_options:
      use_linked_clone: true
      datacenter: '<redacted>'
      template_name: 'Ubuntu-16.04'
      num_cpus: 2,
      network_name:
        - 'VMNetwork 1'
      memory_mb: 4096
      resource_pool: '<redacted>/DeployTest'
      ssh:
        user: ubuntu
        paranoid: false
        password: password
        port: 22
      convergence_options:
      customization_spec:
        domain: local
        ipsettings:
          dnsServerList:
            - <redacted>
            - 8.8.8.8
            - 8.8.4.4
provisioner:
  name: chef_zero
  # You may wish to disable always updating cookbooks in CI or other testing environments.
  # For example:
  #   always_update_cookbooks: <%= !ENV['CI'] %>
  always_update_cookbooks: false
  sudo_command: sudo

verifier:
  name: inspec

transport:
  user: ubuntu
  password: password

platforms:
  - name: ubuntu-16.04

suites:
  - name: default
    run_list:
      - recipe[hydra-base::default]
    verifier:
      inspec_tests:
        - test/smoke/default
    #attributes:

So what can I do to get past this problem? Thanks! *edit: I don't know how to type

Kevin Milner
  • 821
  • 2
  • 14
  • 30

1 Answers1

0

Not really an answer per se, but hopefully it might help someone else who has this same problem.

According to the help I received on slack, the driver I was using has (probably) been deprecated. Instead, it was suggested I use this driver However, there are a couple of known issues currently with this driver. The first can be worked around according to this wiki entry. There is another issue with vSphere 6.5. I filed a bug report and the author is on the case!

Kevin Milner
  • 821
  • 2
  • 14
  • 30