Coder Social home page Coder Social logo

chef / kitchen-vcenter Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 26.0 452 KB

A test-kitchen driver for vCenter REST API

Home Page: https://www.chef.io/implementations/vmware

License: Apache License 2.0

Ruby 99.09% Shell 0.91%
test-kitchen vsphere vsphere-sdk vcenter chef

kitchen-vcenter's Introduction

kitchen-vcenter

Gem Version Build status

This is the official Test Kitchen plugin for VMware vCenter via the vCenter REST API. This plugin allows Test Kitchen the ability to create, bootstrap, and test VMs in VMware infrastructures.

Please refer to the CHANGELOG for version history and known issues.

Requirements

  • Ruby 2.6 or higher
  • VMware vCenter/vSphere 5.5 or higher
  • VMs or templates to clone, with open-vm-tools installed
  • DHCP server to assign IPs to kitchen instances

Installation

The kitchen-vcenter driver ships as part of Chef Workstation. The easiest way to use this driver is to Download Chef Workstation.

If you want to install the driver directly into a Ruby installation:

gem install kitchen-vcenter

If you're using Bundler, simply add it to your Gemfile:

gem "kitchen-vcenter"

... and then run bundle install.

Configuration

See the kitchen.ci vCenter Driver Page for documentation on configuring this driver.

Contributing

For information on contributing to this project see https://github.com/chef/chef/blob/master/CONTRIBUTING.md

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Run the tests and chefstyle, bundle exec rake spec and bundle exec rake style
  4. Commit your changes (git commit -am 'Added some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

License

Copyright:: Copyright (c) 2017-2022 Chef Software, Inc.

License:: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

kitchen-vcenter's People

Contributors

akulbe avatar ashiqueps avatar cattywampus avatar chef-ci avatar chef-expeditor[bot] avatar clintoncwolfe avatar dependabot-preview[bot] avatar dependabot[bot] avatar jasonwbarnett avatar jjasghar avatar lomeroe avatar marcparadise avatar russellseymour avatar skeshari12 avatar tas50 avatar tduffield avatar thheinen avatar tyler-ball avatar vkarve-chef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kitchen-vcenter's Issues

Qustion: How to shutdown/export provisioned VM?

Versions:

  • Version of kitchen-vcenter:
    kitchen-vcenter (1.2.1)
    rbvmomi (1.12.0)
  • Version of test-kitchen:
    test-kitchen (1.20.0)
  • Version of chef:
    Chef Development Kit Version: 2.5.3
    chef-client version: 13.8.5
    berks version: 6.3.1
    inspec version: 1.51.21

Platform Details

  • Version of vCenter:/ESXi:
    6.5

Scenario:

I use kitchen-vcenter driver to interact with VMware farm and provision VMs via test-kitchen .kitchen.yml file. Usual workflow is standard for test-kitchen

  • kitchen create suite-platform
  • kitchen converge suite-platform
  • kitchen verify suite-platform
  • kitchen destroy suite-platform

When VM is provisioned (passed converge) and testcases passed (passed verify) it would be useful to shutdown VM and perform export. Export can be done via ovftool.exe utility provided by vmware, for example I use something like this:

ovftool.exe --shaAlgorithm=sha1 --noSSLVerify=true --skipManifestCheck --diskMode=thin --name=${suite_name}-${platform_name} -tt=ova vi://${user}:${password}@${ESXI_IP}/${vm_name} ${output}

The missing piece of the puzzle is actually VM shutdown.
If there is a way to stop/shutdown VM using test-kitchen or I should use another tool like PowerCLI client from vmware?

Disk Formatting doesn't happen after adding the new drives, and also no option for C drive vm customization with the Kitchen Vcenter

Versions:

  • Version of kitchen-vcenter: 2.11.9
  • Version of test-kitchen:
  • Version of chef:

Platform Details

  • Version of vCenter: 6.7
  • Version of ESXi:

Scenario:

Steps to Reproduce:

Expected Result:

We should have the option to customize the disk size on C drive and also adding new drives on vm_customization should create drives on the virtual machine

Actual Result:

I actually see the drives being added on the VM on vcenter, but it doesn't appear to be on the virtual machine

Needs to incorporate the features of the kitchen-vsphere driver in the chef-provisioning-vsphere gem

The chef-provisioning-vsphere gem was deprecated due to chef-provisioning being deprecated. That gem however had a
vsphere kitchen driver embedded in it:

https://github.com/chef-boneyard/chef-provisioning-vsphere/blob/master/lib/kitchen/driver/vsphere.rb

Users tend to prefer that driver over this driver due to the feature set. That driver is dead though so the path forwards would be to port its features into this gem.

I have no idea which features are necessary to do this, and have zero time and zero experience experience with vmware/vcenter/vsphere to actually be able to do this, but we need a tracking ticket somewhere for it.

Users should post the features they need here, or links to other issues.

unable to search for templates in child folders

Versions:

  • Version of kitchen-vcenter: 1.2.1
  • Version of test-kitchen: 1.22.0
  • Version of chef: +13

Platform Details

  • Version of vCenter: 6.5
  • Version of ESXi:

Scenario:

given the following configuration in .kitchen.yml
'''
platforms:

  • name: default
    driver_config:
    template: cent4kitchentmpl
    datacenter: "vCenterDC"
    folder: "kitchen"
    '''
    it would be nice to be able to use a template in a sub-folder. It appears the issue is because of a limitation in rbVmomi

Actual Result:

templates that are not in the root are not found.

Authentication via the REST API for vCenter >= 6.5, instead of WSDL SSO in < 6.5.

Versions:

  • Version of kitchen-vcenter: 1.2.1
  • Version of test-kitchen: 1.21.2
  • Version of chef: 14.1.12

Platform Details

  • Version of vCenter: 6.5
  • Version of ESXi: 6.5

Scenario:

Using the vcenter driver for Test Kitchen, unable to authenticate against vCenter 6.5 as authentication is now done via the REST API, instead of WSDL. The URLs here

@soap_url = format("https://%s/lookupservice/sdk", host)
@wsdl_url = format("https://%s/lookupservice/wsdl/lookup.wsdl", host)
now 404.

Spoke to @russellseymour about this who confirmed that the driver was developed against an earlier version of vSphere when authentication was not possible via the REST API.

Steps to Reproduce:

Using the Postman samples in the VMware vSphere Automation SDK for REST repo, https://github.com/vmware/vsphere-automation-sdk-rest/tree/master/samples/postman and following
https://blogs.vmware.com/code/2017/02/02/getting-started-vsphere-automation-sdk-rest/
able to successfully authenticate against the vSphere 6.5 instance via the URL: https://{{vc}}/rest/com/vmware/cis/session

We will now need to support both >= 6.5 and < 6.5 REST APIs in the driver.

VapiStdErrorsUnauthenticated when i try to create a VM

Versions:

  • Version of kitchen-vcenter: 2.5.2
  • Version of test-kitchen: 2.2.5
  • Version of chef: 14

Platform Details

  • Version of vCenter: 6.5.0.23000

Steps to Reproduce:

Run kitchen converge with kitchen.yml like this

---
driver:
  name: vcenter
  vcenter_username: <%= ENV['VCENTER_USER'] %>
  vcenter_password: <%= ENV['VCENTER_PASSWORD'] %>
  vcenter_host:  vcenterdr.cervedgroup.com
  vcenter_disable_ssl_verify: true
  log_level: info
  customize:
    annotation: "Kitchen VM Test by <%= ENV['USER'] %> on <%= Time.now.to_s %>"

provisioner:
  name: chef_zero
  sudo_command: sudo
  deprecations_as_errors: true
  retry_on_exit_code:
    - 35 # 35 is the exit code signaling that the node is rebooting
  max_retries: 2
  wait_for_retry: 90
  log_level: info
  install_strategy: once # don't install again if an installation is detected.

verifier:
  name: inspec

platforms:
  - name: redhat-7
    driver:
      cluster: 'MyCluster' 
      resource_pool: 'low pool'
      clone_type: linked
      network_name: 'MyNetwork'
      datacenter: "MyDatacenter"
      template: 'CHEF/chef-base' 
      folder: 'CHEF'      
      vm_rollback: true
    transport:
      username: <%= ENV['LOCAL_USER'] %>
      password: <%= ENV['LOCAL_PASS'] %>

suites:
  - name: my-suite
    run_list:
      - recipe[mycookbook::default]
    verifier:
      inspec_tests:
        - test/integration/default

Actual Result:

D      Message: Failed to complete #create action: [undefined method `empty?' for #<VSphereAutomation::VCenter::VapiStdErrorsUnauthenticated:0x0000000008072b48>] on zk-base-redhat-7
D      ----------------------
D      ------Backtrace-------
D      /home/jenkins/.chefdk/gem/ruby/2.6.0/gems/kitchen-vcenter-2.5.2/lib/kitchen/driver/vcenter.rb:384:in `get_cluster'
D      /home/jenkins/.chefdk/gem/ruby/2.6.0/gems/kitchen-vcenter-2.5.2/lib/kitchen/driver/vcenter.rb:93:in `create'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:485:in `public_send'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:485:in `block in perform_action'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:552:in `synchronize_or_call'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:514:in `block in action'
D      /opt/chefdk/embedded/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:513:in `action'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:485:in `perform_action'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:394:in `create_action'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:382:in `block (2 levels) in transition_to'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/lifecycle_hooks.rb:45:in `run_with_hooks'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:381:in `block in transition_to'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:380:in `each'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:380:in `transition_to'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:162:in `verify'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:191:in `block in test'
D      /opt/chefdk/embedded/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/instance.rb:187:in `test'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/command.rb:197:in `public_send'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/command.rb:197:in `run_action_in_thread'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/test-kitchen-2.2.5/lib/kitchen/command.rb:169:in `block (2 levels) in run_action'
D      /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
D      ----End Backtrace-----

It worked with this version of gems:
Successfully installed vsphere-automation-cis-0.1.0
Successfully installed vsphere-automation-appliance-0.1.0
Successfully installed vsphere-automation-content-0.1.0
Successfully installed vsphere-automation-vapi-0.1.0
Successfully installed vsphere-automation-vcenter-0.1.0
Successfully installed vsphere-automation-sdk-0.1.0
Successfully installed kitchen-vcenter-2.4.0

doesn't work now with these:
Successfully installed vsphere-automation-runtime-0.4.2
Successfully installed vsphere-automation-cis-0.4.2
Successfully installed vsphere-automation-appliance-0.4.2
Successfully installed vsphere-automation-content-0.4.2
Successfully installed vsphere-automation-vapi-0.4.2
Successfully installed vsphere-automation-vcenter-0.4.2
Successfully installed vsphere-automation-sdk-0.4.2
Successfully installed kitchen-vcenter-2.5.2

Missing gem dependency for Windows

TL;DR - chef gem install win32-security could either be added for Windows automatically or added to docs.

Versions:

  • Version of kitchen-vcenter: kitchen-vcenter (2.7.9)
  • Version of test-kitchen: test-kitchen (2.6.0)
  • Version of chef:
    Chef Workstation version: 20.8.125
    Chef Infra Client version: 16.4.38
    Chef InSpec version: 4.22.8
    Chef CLI version: 3.0.24
    Chef Habitat version: 1.6.56
    Test Kitchen version: 2.6.0
    Cookstyle version: 6.15.5

Platform Details

  • Version of vCenter:
  • Version of ESXi:

Scenario:

On current Windows 10 systems...

  1. chef gem install kitchen-vcenter
  2. run kitchen create
  3. WARNING: You don't have c:\users<username>\appdata\local\chefdk\gem\ruby\2.7.0\bin in your PATH,
    gem executables will not run.
  4. kitchen diagnose
    --
    timestamp: 2021-01-27 16:28:35 UTC
    kitchen_version: 2.9.0
    plugins:
    error:
    exception: "#<Kitchen::ClientError: Could not load the 'vcenter' driver from the
    load path.cannot load such file -- win32/security>"
    message: Could not load the 'vcenter' driver from the load path.cannot load such
    file -- win32/security
    backtrace:
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/plugin.rb:55:in
      `rescue in load'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/plugin.rb:33:in
      `load'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/driver.rb:37:in
      `for_plugin'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/config.rb:235:in
      `new_driver'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/config.rb:248:in
      `new_instance'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/config.rb:143:in
      `block in build_instances'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/config.rb:142:in
      `map'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/config.rb:142:in
      `with_index'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/config.rb:142:in
      `build_instances'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/config.rb:116:in
      `instances'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/command.rb:109:in
      `filtered_instances'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/command.rb:139:in
      `parse_subcommand'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/command/diagnose.rb:52:in
      `load_instances'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/command/diagnose.rb:31:in
      `block in call'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/command/diagnose.rb:72:in
      `record_failure'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/command/diagnose.rb:31:in
      `call'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/cli.rb:52:in
      `perform'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/cli.rb:142:in
      `diagnose'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in
      `run'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in
      `invoke_command'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in
      `dispatch'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/base.rb:485:in
      `start'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/bin/kitchen:11:in
      `block in <top (required)>'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/lib/kitchen/errors.rb:170:in
      `with_friendly_errors'
    - C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.9.0/bin/kitchen:11:in
      `<top (required)>'
    - C:/opscode/chef-workstation/bin/kitchen:358:in `load'
    - C:/opscode/chef-workstation/bin/kitchen:358:in `<main>'

Steps to Reproduce:

see above.

Expected Result:

Actual Result:

Error vAPI Unauthenticated

Versions:

  • Version of kitchen-vcenter: 1.3.1
  • Version of test-kitchen: 1.23.1
  • Version of chef: 14.7.17

Platform Details

  • Version of vCenter: 6.5.0, 8024368
  • Version of ESXi: 6.5.0, 7388607

Scenario:

Running kitchen test command against vCenter via alpine docker container.

Steps to Reproduce:

bundle exec kitchen test -d always ubuntu-1604 --log-level=debug

Expected Result:

Creates VM and and SSH's to the VM to run commands via CI

Actual Result:

ERROR -- vAPI: VapiError (Com::Vmware::Vapi::Std::Errors::Unauthenticated)

More details

The authentication against vcenter works in kitchen-vcenter (>= 1.2.1.3) with test-kitchen (> 1.2.0) however that yields other problems with kitchen trying to randomly (sometimes it works sometimes it doesn't) SSH to an IP address that does not exist. I was hoping to fix that problem by upgrading everything but now run into this authentication problem instead.

.kitchen.yml

---
driver:
  name: vcenter
  vcenter_username: <%= ENV['VCENTER_USER'] %>
  vcenter_password: <%= ENV['VCENTER_PASSWORD'] %>
  vcenter_host: vcenter-01
  vcenter_disable_ssl_verify: true
  folder: development
  network: prod_network
  datastore: DataStore
  datacenter: DataCenter
  cluster: dc1
  memoryMB: 32768
  numCPUs: 16
  numCoresPerSocket: 16

transport:
  username: builduser
  ssh_key: test-extras/salt-test_rsa

provisioner:
  name: salt_solo
  formula: ./
  dependencies:
    - name: test-extras
      path: ./
  pillars_from_directories:
    - ../salt-pillars
  install_after_init_environment: true
  state_top_from_file: <%= ENV['HIGHSTATE'] || true %>
  salt_force_color: true
  require_chef: false
  salt_copy_filter:
    - .git
    - .kitchen

platforms:
  # Ubutnu 16.04
  - name: ubuntu-1604
    driver_config:
      template: templates/agent-ubuntu16.04
    provisioner:
      init_environment: |
        sudo systemctl stop salt-minion || true
        sleep 2
        sudo pkill salt-minion || true
      grains:
        katana_groups:
          - lin_general_slaves

verifier:
  name: inspec
  sudo: false

suites:
  -
    name: default
<% if File.file?("top.kitchen") and (ENV['HIGHSTATE'] || 'true') == 'false' %>
<%= File.read("top.kitchen") %>
<% end %>

Full output

$ bundle exec kitchen diagnose ubuntu-1604
---
timestamp: 2018-11-22 12:30:18 UTC
kitchen_version: 1.23.2
instances:
  default-ubuntu-1604:
    platform:
      os_type: unix
      shell_type: bourne
    state_file: {}
    driver:
      clone_type: :full
      cluster: dc1
      datacenter: DataCenter
      datastore: DataStore
      folder: development
      kitchen_root: "/builds/salt-states"
      log_level: :info
      memoryMB: 32768
      name: vcenter
      network: prod_agents
      numCPUs: 16
      numCoresPerSocket: 16
      poweron: true
      pre_create_command: 
      resource_pool: 
      targethost: 
      template: templates/agent-ubuntu16.04-datacore3
      test_base_path: "/builds/salt-states/test/integration"
      vcenter_disable_ssl_verify: true
      vcenter_host: vcenter-01
      vcenter_password: <snip>
      vcenter_username: <snip>
      vm_name: 
    provisioner:
      bootstrap_url: https://raw.githubusercontent.com/saltstack/kitchen-salt/master/assets/install.sh
      cache_commands: []
      chef_bootstrap_url: https://www.chef.io/chef/install.sh
      command_prefix: 
      debug: 
      dependencies:
      - name: test-extras
        path: "./"
      downloads: {}
      dry_run: false
      formula: "./"
      ftp_proxy: 
      gpg_home: "~/.gnupg/"
      gpg_key: 
      grains:
        katana_groups:
        - lin_general_slaves
      http_proxy: 
      https_proxy: 
      init_environment: |
        sudo systemctl stop salt-minion || true
        sleep 2
        sudo pkill salt-minion || true
      install_after_init_environment: true
      is_file_root: false
      kitchen_root: "/builds/salt-states"
      local_salt_root: 
      max_retries: 1
      name: salt_solo
      omnibus_cachier: false
      pillars_from_directories:
      - "../salt-pillars"
      pip_bin: pip
      pip_editable: false
      pip_extra_index_url: []
      pip_index_url: https://pypi.python.org/simple/
      pip_pkg: salt==%s
      remote_states: 
      require_chef: false
      retry_on_exit_code: []
      root_path: "/tmp/kitchen"
      salt_apt_repo: https://repo.saltstack.com/apt/ubuntu/16.04/amd64/
      salt_apt_repo_key: https://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest/SALTSTACK-GPG-KEY.pub
      salt_bootstrap_options: ''
      salt_bootstrap_url: https://bootstrap.saltstack.com
      salt_config: "/etc/salt"
      salt_copy_filter:
      - ".git"
      - ".kitchen"
      salt_env: base
      salt_file_root: "/srv/salt"
      salt_force_color: true
      salt_install: bootstrap
      salt_minion_config: "/etc/salt/minion"
      salt_minion_config_dropin_files: []
      salt_minion_config_template: 
      salt_minion_extra_config: {}
      salt_minion_id: 
      salt_pillar_root: "/srv/pillar"
      salt_ppa: ppa:saltstack/salt
      salt_spm_root: "/srv/spm"
      salt_state_top: "/srv/salt/top.sls"
      salt_version: latest
      salt_yum_repo: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/archive/%s
      salt_yum_repo_key: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/archive/%s/SALTSTACK-GPG-KEY.pub
      salt_yum_repo_latest: https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el7.noarch.rpm
      salt_yum_rpm_key: https://repo.saltstack.com/yum/redhat/7/x86_64/archive/%s/SALTSTACK-GPG-KEY.pub
      state_collection: false
      state_top: {}
      state_top_from_file: true
      sudo: true
      sudo_command: sudo -E
      test_base_path: "/builds/salt-states/test/integration"
      vendor_path: 
      vendor_repo: {}
      wait_for_retry: 30
    transport:
      compression: false
      compression_level: 0
      connection_retries: 5
      connection_retry_sleep: 1
      connection_timeout: 15
      keepalive: true
      keepalive_interval: 60
      kitchen_root: "/builds/salt-states"
      log_level: :info
      max_ssh_sessions: 9
      max_wait_until_ready: 600
      name: ssh
      port: 22
      ssh_gateway: 
      ssh_gateway_port: 22
      ssh_gateway_username: 
      ssh_http_proxy: 
      ssh_http_proxy_password: 
      ssh_http_proxy_port: 
      ssh_http_proxy_user: 
      ssh_key: "/builds/salt-states/test-extras/salt-test_rsa"
      test_base_path: "/builds/salt-states/test/integration"
      username: builduser
    verifier:
      chef_omnibus_root: "/opt/chef"
      command_prefix: 
      debug: 
      ftp_proxy: 
      http_proxy: 
      https_proxy: 
      inspec_tests: []
      kitchen_root: "/builds/salt-states"
      log_level: :info
      name: inspec
      root_path: "/tmp/verifier"
      sudo: false
      sudo_command: sudo -E
      suite_name: default
      test_base_path: "/builds/salt-states/test/integration"
$ bundle exec kitchen test -d always ubuntu-1604 --log-level=debug
-----> Starting Kitchen (v1.23.2)
D      winrm requested, loading winrm gem (["~> 2.0"])
D      winrm is loaded.
D      winrm-fs requested, loading winrm-fs gem (["~> 1.0"])
D      winrm-fs is loaded.
D      winrm-elevated requested, loading winrm-elevated gem (["~> 1.0"])
D      winrm-elevated is loaded.
-----> Cleaning up any prior instances of <default-ubuntu-1604>
-----> Destroying <default-ubuntu-1604>...
       Finished destroying <default-ubuntu-1604> (0m0.00s).
-----> Testing <default-ubuntu-1604>
-----> Creating <default-ubuntu-1604>...
E, [2018-11-22T12:30:24.384377 #24] ERROR -- vAPI: VapiError (Com::Vmware::Vapi::Std::Errors::Unauthenticated)

-----> Destroying <default-ubuntu-1604>...
       Finished destroying <default-ubuntu-1604> (0m0.00s).
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [VapiError] on default-ubuntu-1604
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
D      ------Exception-------
D      Class: Kitchen::ActionFailed
D      Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [VapiError] on default-ubuntu-1604
D      ----------------------
D      ------Backtrace-------
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:183:in `report_errors'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:174:in `run_action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command/test.rb:42:in `block in call'
D      /usr/local/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command/test.rb:38:in `call'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/cli.rb:52:in `perform'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/cli.rb:245:in `test'
D      /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
D      /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
D      /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
D      /usr/local/bundle/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/bin/kitchen:13:in `block in <top (required)>'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/errors.rb:171:in `with_friendly_errors'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/bin/kitchen:13:in `<top (required)>'
D      /usr/local/bundle/bin/kitchen:23:in `load'
D      /usr/local/bundle/bin/kitchen:23:in `<top (required)>'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:74:in `load'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:28:in `run'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli.rb:463:in `exec'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli.rb:27:in `dispatch'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli.rb:18:in `start'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle:30:in `block in <top (required)>'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
D      /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle:22:in `<top (required)>'
D      /usr/local/bundle/bin/bundle:23:in `load'
D      /usr/local/bundle/bin/bundle:23:in `<main>'
D      ----End Backtrace-----
D      -Composite Exception--
D      Class: Kitchen::ActionFailed
D      Message: Failed to complete #create action: [VapiError] on default-ubuntu-1604
D      ----------------------
D      ------Backtrace-------
D      /usr/local/bundle/gems/vsphere-automation-sdk-6.6.1/client/sdk/runtime/lib/vapi/bindings/service.rb:69:in `invoke_with_info'
D      /usr/local/bundle/gems/vsphere-automation-sdk-6.6.1/client/sdk/com/vmware/cis.rb:141:in `create'
D      /usr/local/bundle/gems/kitchen-vcenter-1.3.1/lib/kitchen/driver/vcenter.rb:241:in `connect'
D      /usr/local/bundle/gems/kitchen-vcenter-1.3.1/lib/kitchen/driver/vcenter.rb:62:in `create'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in `public_send'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in `block in perform_action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:551:in `synchronize_or_call'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:513:in `block in action'
D      /usr/local/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:512:in `action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in `perform_action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:394:in `create_action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:382:in `block (2 levels) in transition_to'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/lifecycle_hooks.rb:45:in `run_with_hooks'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:381:in `block in transition_to'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:380:in `each'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:380:in `transition_to'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:162:in `verify'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:191:in `block in test'
D      /usr/local/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:187:in `test'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:197:in `public_send'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:197:in `run_action_in_thread'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:169:in `block (2 levels) in run_action'
D      /usr/local/bundle/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
D      ----End Backtrace-----
D      ---Nested Exception---
D      Class: Kitchen::ActionFailed
D      Message: Failed to complete #create action: [VapiError]
D      ----------------------
D      ------Backtrace-------
D      /usr/local/bundle/gems/vsphere-automation-sdk-6.6.1/client/sdk/runtime/lib/vapi/bindings/service.rb:69:in `invoke_with_info'
D      /usr/local/bundle/gems/vsphere-automation-sdk-6.6.1/client/sdk/com/vmware/cis.rb:141:in `create'
D      /usr/local/bundle/gems/kitchen-vcenter-1.3.1/lib/kitchen/driver/vcenter.rb:241:in `connect'
D      /usr/local/bundle/gems/kitchen-vcenter-1.3.1/lib/kitchen/driver/vcenter.rb:62:in `create'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in `public_send'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in `block in perform_action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:551:in `synchronize_or_call'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:513:in `block in action'
D      /usr/local/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:512:in `action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in `perform_action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:394:in `create_action'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:382:in `block (2 levels) in transition_to'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/lifecycle_hooks.rb:45:in `run_with_hooks'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:381:in `block in transition_to'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:380:in `each'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:380:in `transition_to'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:162:in `verify'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:191:in `block in test'
D      /usr/local/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:187:in `test'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:197:in `public_send'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:197:in `run_action_in_thread'
D      /usr/local/bundle/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:169:in `block (2 levels) in run_action'
D      /usr/local/bundle/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
D      ----End Backtrace-----

Dockerfile

FROM ruby:2.5.3-alpine3.8
RUN apk add --update git \
                     openssh \
                     build-base \
                     libxml2-dev \
                     libxslt-dev \
                     && rm -rf /var/cache/apk/*

RUN gem install bundler
COPY Gemfile Gemfile
RUN bundler install --full-index

Final thoughts

I made sure to read the documentation on how to set up the kitchen.yml again after updating everything, and I can't seem to find any new or different settings, so now I don't know what to do, and help is appreciated!

"destroy" not working after adding support for external PSC

Versions:

  • Version of kitchen-vcenter: 1.3.4 - 1.4.3
  • Version of test-kitchen: 1.23
  • Version of chef: 14.7.17

Platform Details

  • Version of vCenter: 6.7.0
  • Version of ESXi: 6.7.0

Scenario:

After creation of a kitchen instance, trying a "destroy" on it will result in an error

Steps to Reproduce:

kitchen create
kitchen destroy

Expected Result:

Deletion of the kitchen instance.

Actual Result:

Error message:

-----> Starting Kitchen (v1.23.2)
-----> Destroying <default-vm>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #destroy action: [] on default-vm
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Cause: not setting connection options which are now needed for connecting due to the implementation of function lookup_service_host.

Message: Could not load the 'vcenter' driver from the load path.

Versions:

  • Version of kitchen-vcenter: 1.0.0
  • Version of test-kitchen: 1.17.0
  • Version of chef: 13.2.20

Platform Details

  • Version of vCenter: Version 6.5.0.10000 Build 5973321
  • Version of ESXi: VMware ESXi, 6.5.0, 4887370

Scenario:

Ran instructions to install chef gem, updated .kitchen.yml accordingly, but get the following then running kitchen list:

kitchen list
**>>>>>> ------Exception-------

Class: Kitchen::ClientError
Message: Could not load the 'vcenter' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration**

Steps to Reproduce:

chef gem install kitchen-vcenter
update .kitchen.yml for environment
kitchen list

Expected Result:

list kitchen vm's

Actual Result:

**>>>>>> ------Exception-------

Class: Kitchen::ClientError
Message: Could not load the 'vcenter' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration**

Exclude Disabled Hosts in ESXi Cluster

Describe the Enhancement:

Exclude disabled hosts in cluster when host is not specified.

Describe the Need:

When using ESXi clusters, it would be nice to not have to put in the host incase it is disabled, or in maintenance mode.

Current Alternative

This functionality partly works except that it doesn't exclude hosts in maintenance mode or disabled. The following error will occur randomly:

 Failed to complete #create action: [InvalidHostState: The operation is not allowed in the current state of the host.] on master-rhel7

Can We Help You Implement This?:

I would be happy to try and implement this. I might need some guidance on where to look, and how to test. Thanks.

Add ability to customize administrator password on windows VMs

Describe the Enhancement

Ability to specify an administrator password to configure during guest customization

Describe the Need

Allows users to have defined/dynamic passwords on administrator account

Current Alternative

use no password or hard set the password in template

RHEL7 2nd Network Adapter Attached, but Not Getting an IP

Versions:

  • Version of kitchen-vcenter: 2.12.0
  • Version of test-kitchen: 3.2.2
  • Version of chef: 17.10.0

Platform Details

  • Version of vCenter: 7.0.3.1500
  • Version of ESXi: 7.0.3

Scenario:

I am trying to understand why my RedHat 7.9 only receives an IP address for the first adapter and my Redhat 8.8 and CentOS 7.9.2009 VMs get both adapters assigned an IP address. We use Packer to build both RedHat images using similar configurations, only differing where required by the OS. The components used by the VMs are similar across the networks, datastore, datacenter, cluster, etc).

Steps to Reproduce:

Running kitchen create redhat-7 creates a virtual machine with 2 network adapters, but only one gets an IP address.
Running kitchen create redhat-8, using the same specs in the kitchen.yml file, results in a virtual machine with 2 network adapters with both getting an IP address.
Running kitchen create centos-7, using the same specs in the kitchen.yml file, results in a virtual machine with 2 network adapters with both getting an IP address.

Expected Result:

Running kitchen create redhat-7 should result in both attached network adapters receiving an IP address.

Actual Result:

Running kitchen create redhat-7 results in only the first network adapting receiving an IP address. I have to run login to the VM and runsudo dhclient in order for the second network adapter to receive an IP address.

Driver requires a resource pool

Versions:

  • Version of kitchen-vcenter: 1.21.0
  • Version of test-kitchen: 1.23.2

Platform Details

  • Version of vCenter: 6.7
  • Version of ESXi: 6.5

Scenario:

Trying to create a machine from TestKitchen on a VMWare host where no resource pools are defined.

Steps to Reproduce:

Create a TestKitchen configuration, not specifying a resource_pool and not having any defined on the target VMWare machine

Expected Result:

Creation of a machine not in any VMWare resource pool OR stating that a resource pool is mandatory in kitchen execution/documentation

Actual Result:

Testkitchen fails with a message about spec.pool being invalid, because the existence of a pool has been required after Issue #7 apparently.

Apparently, the code searches for the pool given or uses the first one in https://github.com/chef/kitchen-vcenter/blob/master/lib/kitchen/driver/vcenter.rb#L192

According to the VMWare documentation (which should apply to the used RbVmomi gem), the pool property is optional:
https://www.vmware.com/support/developer/converter-sdk/conv51_apireference/vim.vm.RelocateSpec.html

kitchen-vcenter testing failure on windows caused by ffi update to 1.13

Versions:

  • Version of kitchen-vcenter: 2.7.0
  • Version of chef-workstation: 0.15.18
  • Version of test-kitchen: 2.3.4
  • Version of chef: 15.7.32

Platform

  • Windows

Scenario:

The kitchen-vcenter gem at version 2.7.0 depends on the test-kitchen gem, which depends on the winrm gem, which depends on ffi. The 1.13 update of ffi is breaking chefspec runs needed for a CI system.

Steps to Reproduce:

You can replicate this by installing ffi 1.13.0 on a windows system, opening irb, and running require 'chefspec' and you'll get an immediate crash.

Expected Result:

kitchen-vcenter is able to work with ffi > 1.12

Actual Result:

Crash upon requiring chefspec with ffi >= 1.13.0 in the dependency chain

Additional context:

It looks like the issue with the updated ffi was fixed in the core workstation product, but has not been addressed for the kitchen-vcenter Gem.
See: chef/chef-workstation@925e50a for the core workstation product.

HTTP error (302), Unable to find SOAP operation: :issue

Versions:

Chef Development Kit Version: 2.5.3
chef-client version: 13.8.5
berks version: 6.3.1
kitchen version: 1.20.0
inspec version: 1.51.21
kitchen-vcenter: 1.2.1
savon: 2.12.0
Version of vCenter: 6.5

Scenario:

Hi,
I don't know if this project is being still developed, but I am having the following problem.
I am getting 302 when trying "kitchen test default":

-----> Starting Kitchen (v1.20.0)
-----> Cleaning up any prior instances of <default-CM-TMPL-TF-W2012R2x64-Symantec>
-----> Destroying <default-CM-TMPL-TF-W2012R2x64-Symantec>...
       Finished destroying <default-CM-TMPL-TF-W2012R2x64-Symantec> (0m0.00s).
-----> Testing <default-CM-TMPL-TF-W2012R2x64-Symantec>
-----> Creating <default-CM-TMPL-TF-W2012R2x64-Symantec>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [HTTP error (302): <html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

To follow the redirects I set the following in /root/.chefdk/gem/ruby/2.4.0/gems/savon-2.12.0/lib/savon:
:follow_redirects => true,

Now I am getting:

-----> Starting Kitchen (v1.20.0)
-----> Cleaning up any prior instances of <default-CM-TMPL-TF-W2012R2x64-Symantec>
-----> Destroying <default-CM-TMPL-TF-W2012R2x64-Symantec>...
       Finished destroying <default-CM-TMPL-TF-W2012R2x64-Symantec> (0m0.00s).
-----> Testing <default-CM-TMPL-TF-W2012R2x64-Symantec>
-----> Creating <default-CM-TMPL-TF-W2012R2x64-Symantec>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [Unable to find SOAP operation: :issue
Operations provided by your service: []] on default-CM-TMPL-TF-W2012R2x64-Symantec

From the log:

E, [2018-10-30T15:39:26.432315 #17280] ERROR -- Kitchen: Message: Failed to complete #create action: [Unable to find SOAP operation: :issue
Operations provided by your service: []] on default-CM-TMPL-TF-W2012R2x64-Symantec
E, [2018-10-30T15:39:26.432325 #17280] ERROR -- Kitchen: ----------------------
E, [2018-10-30T15:39:26.432340 #17280] ERROR -- Kitchen: ------Backtrace-------
E, [2018-10-30T15:39:26.432351 #17280] ERROR -- Kitchen: /root/.chefdk/gem/ruby/2.4.0/gems/savon-2.12.0/lib/savon/operation.rb:23:in `ensure_exists!'
E, [2018-10-30T15:39:26.432361 #17280] ERROR -- Kitchen: /root/.chefdk/gem/ruby/2.4.0/gems/savon-2.12.0/lib/savon/operation.rb:15:in `create'
E, [2018-10-30T15:39:26.432371 #17280] ERROR -- Kitchen: /root/.chefdk/gem/ruby/2.4.0/gems/savon-2.12.0/lib/savon/client.rb:32:in `operation'
E, [2018-10-30T15:39:26.432381 #17280] ERROR -- Kitchen: /root/.chefdk/gem/ruby/2.4.0/gems/savon-2.12.0/lib/savon/client.rb:36:in `call'
E, [2018-10-30T15:39:26.432390 #17280] ERROR -- Kitchen: /root/.chefdk/gem/ruby/2.4.0/gems/kitchen-vcenter-1.2.1/lib/sso.rb:94:in `invoke'
E, [2018-10-30T15:39:26.432400 #17280] ERROR -- Kitchen: /root/.chefdk/gem/ruby/2.4.0/gems/kitchen-vcenter-1.2.1/lib/sso.rb:72:in `request_bearer_token'
E, [2018-10-30T15:39:26.432409 #17280] ERROR -- Kitchen: /root/.chefdk/gem/ruby/2.4.0/gems/kitchen-vcenter-1.2.1/lib/kitchen/driver/vcenter.rb:195:in `connect'
E, [2018-10-30T15:39:26.432419 #17280] ERROR -- Kitchen: /root/.chefdk/gem/ruby/2.4.0/gems/kitchen-vcenter-1.2.1/lib/kitchen/driver/vcenter.rb:60:in `create'
E, [2018-10-30T15:39:26.432429 #17280] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/test-kitchen-1.20.0/lib/kitchen/instance.rb:469:in `public_send'
E, [2018-10-30T15:39:26.432438 #17280] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/test-kitchen-1.20.0/lib/kitchen/instance.rb:469:in `block in perform_action'
E, [2018-10-30T15:39:26.432448 #17280] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/test-kitchen-1.20.0/lib/kitchen/instance.rb:536:in `synchronize_or_call'
E, [2018-10-30T15:39:26.432457 #17280] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/test-kitchen-1.20.0/lib/kitchen/instance.rb:498:in `block in action'
E, [2018-10-30T15:39:26.432467 #17280] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/2.4.0/benchmark.rb:293:in `measure'
...

Does anyone have a clue why this error occurs?

I can put .kitchen.yml here also if necessary.

Kitchen unable to log in to the VM it creates.

Versions:

  • Version of kitchen-vcenter: 2.0.0
  • Version of test-kitchen: 1.22
  • Version of chef: 3.1.0

Platform Details

  • Version of vCenter: 6.7
  • Version of ESXi: 6.7

Scenario:

Test kitchen creates the VM on the ESXi Host using the vCenter driver. However, kitchen login and kitchen converge fail at login.

$ kitchen login -l debug
D      Berksfile found at /Users/<name>/chef/cookbooks/<cookbook>/Berksfile, loading Berkshelf
D      Berkshelf 7.0.4 library loaded
D      Login command: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=VERBOSE -p 22 ubuntu@ (Options: {})

The ssh command is missing the IP/FQDN/Hostname?

$ kitchen converge
-----> Starting Kitchen (v1.22.0)
-----> Converging <default-ubuntu-1604>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 7.0.4...
       Removing non-cookbook files before transfer
       Preparing data_bags
       Preparing nodes
       Preparing validation.pem
       Preparing client.rb
ubuntu@'s password:

Two things on converge:

  1. Not sure why isn't prompting for a password
  2. ubuntu@ without an IP or FQDN shows up again when it does

On converge it is prompting for a password even with the transport block:

driver:
  name: vcenter
  vcenter_username: <[email protected]>
  vcenter_password: <%= ENV['TF_VAR_UPW'] %>
  vcenter_host:  <%= ENV['TF_VAR_VS'] %>
  vcenter_disable_ssl_verify: true

provisioner:
  name: chef_zero
  sudo_command: sudo
  deprecations_as_errors: true
  retry_on_exit_code:
    - 35 # 35 is the exit code signaling that the node is rebooting
  max_retries: 2
  wait_for_retry: 90
  log_level: :debug

verifier:
  name: inspec

platforms:
  - name: ubuntu-16.04
    driver_config:
      targethost: <host>
      template: ubuntu/test-kitchen-16.04
      datacenter: <dc>
      resource_pool: <pool>
    transport:
      username: "ubuntu"
      password: "password"

Steps to Reproduce:

Create kitchen.yml as shown above and attempt to create and login to the VM using kitchen

Expected Result:

The VM will be created, you will be able to SSH into that VM through the CLI, but kitchen will fail.

Actual Result:

Unsure?

Guest Customization

Describe the Enhancement:

Ability to do Guest Customization

Describe the Need:

It would be nice to be able to customize the guest virtual machine. I specifically am looking for setting the hostname of the system, but I know configuring things like IP and such would be helpful as well.

Current Alternative

Currently I have to create the machine and the login and set the hostname manually.

On Windows 10 - Fails to find "libcurl" when running test kitchen

Versions:

  • Version of kitchen-vcenter: 2.2.2
  • Version of test-kitchen: 1.24.0
  • Version of chef: 14.10.9
  • Version of ruby: 2.5.0
  • Version of chef-workstation: 0.2.48

Platform Details

  • Version of vCenter: none (reproduced gem error just trying to run kitchen list)
  • Version of ESXi: none

Scenario:

A customer reached out and notified me they cannot use the kitchen-vcenter driver for their local dev needs. I don't have a vcenter instance to test against but reproduced the error just by trying to execute Test Kitchen using the kitchen-vcenter driver on an AWS workspace instance of Windows 10 and an example kitchen.yml configured for vcenter.

Steps to Reproduce:

  1. Log into a fresh Windows 10 instance.
  2. Installed choco
  3. Used choco to install chef-workstation
  4. Used 'chef gem install kitchen-vcenter'
  5. Generated a simple Chef cookbook and edited the kitchen.yml for vcenter
  6. Ran 'kitchen list' and received the error below.

Expected Result:

An error stating that the vcenter host could not be found.

Actual Result:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'vcenter' driver from the load path.Could not open library 'libcurl': The specified module could not be found.
.
Could not open library 'libcurl.dll': The specified module could not be found.
.
Could not open library 'libcurl.so.4': The specified module could not be found.
.
Could not open library 'libcurl.so.4.dll': The specified module could not be found.

>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

D      ------Exception-------
D      Class: Kitchen::ClientError
D      Message: Could not load the 'vcenter' driver from the load path.Could not open library 'libcurl': The specified module could not be found.
.
Could not open library 'libcurl.dll': The specified module could not be found.
.
Could not open library 'libcurl.so.4': The specified module could not be found.
.
Could not open library 'libcurl.so.4.dll': The specified module could not be found.

D      ----------------------
D      ------Backtrace-------
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/plugin.rb:56:in `rescue in load'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/plugin.rb:34:in `load'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/driver.rb:38:in `for_plugin'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:234:in `new_driver'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:247:in `new_instance'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:142:in `block in build_instances'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:141:in `map'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:141:in `with_index'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:141:in `build_instances'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:117:in `instances'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:112:in `filtered_instances'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:142:in `parse_subcommand'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command/list.rb:30:in `call'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/cli.rb:52:in `perform'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/cli.rb:120:in `list'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/bin/kitchen:13:in `block in <top (required)>'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/errors.rb:171:in `with_friendly_errors'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/bin/kitchen:13:in `<top (required)>'
D      C:/opscode/chef-workstation/bin/kitchen:322:in `load'
D      C:/opscode/chef-workstation/bin/kitchen:322:in `<main>'
D      ----End Backtrace-----
D      ---Nested Exception---
D      Class: LoadError
D      Message: Could not open library 'libcurl': The specified module could not be found.
.
Could not open library 'libcurl.dll': The specified module could not be found.
.
Could not open library 'libcurl.so.4': The specified module could not be found.
.
Could not open library 'libcurl.so.4.dll': The specified module could not be found.

D      ----------------------
D      ------Backtrace-------
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/plugin.rb:56:in `rescue in load'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/plugin.rb:34:in `load'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/driver.rb:38:in `for_plugin'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:234:in `new_driver'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:247:in `new_instance'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:142:in `block in build_instances'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:141:in `map'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:141:in `with_index'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:141:in `build_instances'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/config.rb:117:in `instances'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:112:in `filtered_instances'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:142:in `parse_subcommand'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command/list.rb:30:in `call'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/cli.rb:52:in `perform'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/cli.rb:120:in `list'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/bin/kitchen:13:in `block in <top (required)>'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/errors.rb:171:in `with_friendly_errors'
D      C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/bin/kitchen:13:in `<top (required)>'
D      C:/opscode/chef-workstation/bin/kitchen:322:in `load'
D      C:/opscode/chef-workstation/bin/kitchen:322:in `<main>'
D      ----End Backtrace-----```

Kitchen Path: C:/opscode/chef-workstation/bin\kitchen.bat
Chef Path: C:/opscode/chef-workstation/bin\chef.bat

Handle the exception when no network devices are found on vm

Versions:

  • Version of kitchen-vcenter: 2.11.0
  • Version of test-kitchen: 3.1.1
  • Version of chef:
    Chef Workstation version: 21.11.679
    Chef Habitat version: 1.6.420
    Test Kitchen version: 3.1.1
    Cookstyle version: 7.25.9
    Chef Infra Client version: 17.7.29
    Chef InSpec version: 4.49.0
    Chef CLI version: 5.4.2

Platform Details

  • Version of vCenter:
  • Version of ESXi:

Scenario:

While debugging the customer issue, found out that due to some configuration issue on the customer vCenter server, unable to find any network devices in the server. The code always assumes that there would be at least one network device and uses the first device to clone the vm. In this case, the command fails due to empty network devices with the following exception.

E, [2021-11-03T16:07:37.987451 #23448] ERROR -- Kitchen: ---Nested Exception---
E, [2021-11-03T16:07:37.987496 #23448] ERROR -- Kitchen: Class: Kitchen::ActionFailed
E, [2021-11-03T16:07:37.987571 #23448] ERROR -- Kitchen: Message: Failed to complete #create action: [undefined method `backing=' for nil:NilClass]
E, [2021-11-03T16:07:37.987619 #23448] ERROR -- Kitchen: ----------------------
E, [2021-11-03T16:07:37.987664 #23448] ERROR -- Kitchen: ------Backtrace-------
E, [2021-11-03T16:07:37.987707 #23448] ERROR -- Kitchen: C:/Users/casysscorchsa/AppData/Local/chefdk/gem/ruby/2.7.0/gems/kitchen-vcenter-2.9.0/lib/support/clone_vm.rb:513:in `clone'
E, [2021-11-03T16:07:37.987752 #23448] ERROR -- Kitchen: C:/Users/casysscorchsa/AppData/Local/chefdk/gem/ruby/2.7.0/gems/kitchen-vcenter-2.9.0/lib/kitchen/driver/vcenter.rb:182:in `create'
E, [2021-11-03T16:07:37.987796 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:495:in `public_send'
E, [2021-11-03T16:07:37.987841 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:495:in `block in perform_action'
E, [2021-11-03T16:07:37.987913 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:563:in `synchronize_or_call'
E, [2021-11-03T16:07:37.987961 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:524:in `block in action'
E, [2021-11-03T16:07:37.988008 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/2.7.0/benchmark.rb:293:in `measure'
E, [2021-11-03T16:07:37.988053 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:523:in `action'
E, [2021-11-03T16:07:37.988097 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:495:in `perform_action'
E, [2021-11-03T16:07:37.988142 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:404:in `create_action'
E, [2021-11-03T16:07:37.988191 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:392:in `block (2 levels) in transition_to'
E, [2021-11-03T16:07:37.988338 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/lifecycle_hooks.rb:47:in `run_with_hooks'
E, [2021-11-03T16:07:37.988384 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:391:in `block in transition_to'
E, [2021-11-03T16:07:37.988429 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:390:in `each'
E, [2021-11-03T16:07:37.988484 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:390:in `transition_to'
E, [2021-11-03T16:07:37.988531 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/instance.rb:139:in `converge'
E, [2021-11-03T16:07:37.988578 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/command.rb:195:in `public_send'
E, [2021-11-03T16:07:37.988623 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/command.rb:195:in `run_action_in_thread'
E, [2021-11-03T16:07:37.988668 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/test-kitchen-2.10.0/lib/kitchen/command.rb:166:in `block (2 levels) in run_action'
E, [2021-11-03T16:07:37.988714 #23448] ERROR -- Kitchen: C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
E, [2021-11-03T16:07:37.988762 #23448] ERROR -- Kitchen: ----End Backtrace-----

Steps to Reproduce:

https://getchef.zendesk.com/agent/tickets/29120
https://github.com/chef/customer-bugs/issues/517

Expected Result:

If the network devices are empty, instead of throwing an error, show the relevant error message to user so that they can check the configuration.

Actual Result:

Add support for linked clones

Versions:

  • Version of kitchen-vcenter:
  • Version of test-kitchen:
  • Version of chef:

Platform Details

  • Version of vCenter:
  • Version of ESXi:

Scenario:

kitchen-vcenter should support the usage of linked clones so that creation of a new test kitchen instance doesn't take forever. This is already implemented in rbvmomi so it should be easy to port over here.

Steps to Reproduce:

Expected Result:

Actual Result:

HTTP error (404)

Versions:

  • Version of kitchen-vcenter: v1.2.1
  • Version of test-kitchen: v1.23.2
  • Version of chef:3.2.30

Platform Details

  • Version of vCenter: 6.5
  • Version of ESXi:6.5

Scenario:

I would like to build the vm in vCenter and run ansible provisioner.

Steps to Reproduce:

Using kitchen.yml with below config -

https://gist.github.com/riponbanik/fdb3d117d44ec02d1d01f6369b93ec26

Expected Result:

Fix the issue. I can build vm in vcenter using Ansible/Terraform etc. using the same config for vcenter.

Actual Result:

It gives the following error -

D ------Exception-------
D Class: Kitchen::ActionFailed
D Message: 1 actions failed.

Failed to complete #create action: [HTTP error (404)] on default-el7

D ----------------------
D ------Backtrace-------
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:183:in report_errors' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:174:in run_action'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/command/action.rb:36:in block in call' D C:/Tools/ruby24/lib/ruby/2.4.0/benchmark.rb:293:in measure'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/command/action.rb:34:in call' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/cli.rb:52:in perform'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/cli.rb:193:in block (2 levels) in <class:CLI>' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in run'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in dispatch'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/base.rb:466:in start' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/bin/kitchen:13:in block in <top (required)>'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/errors.rb:171:in with_friendly_errors' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/bin/kitchen:13:in <top (required)>'
D C:/Tools/ruby24/bin/kitchen:22:in load' D C:/Tools/ruby24/bin/kitchen:22:in

'
D ----End Backtrace-----
D -Composite Exception--
D Class: Kitchen::ActionFailed
D Message: Failed to complete #create action: [HTTP error (404)] on default-el7
D ----------------------
D ------Backtrace-------
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/savon-2.12.0/lib/savon/operation.rb:27:in rescue in ensure_exists!' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/savon-2.12.0/lib/savon/operation.rb:22:in ensure_exists!'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/savon-2.12.0/lib/savon/operation.rb:15:in create' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/savon-2.12.0/lib/savon/client.rb:32:in operation'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/savon-2.12.0/lib/savon/client.rb:36:in call' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/kitchen-vcenter-1.2.1/lib/lookup_service_helper.rb:213:in invoke'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/kitchen-vcenter-1.2.1/lib/lookup_service_helper.rb:170:in find_service_url' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/kitchen-vcenter-1.2.1/lib/lookup_service_helper.rb:54:in find_vapi_urls'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/kitchen-vcenter-1.2.1/lib/kitchen/driver/vcenter.rb:184:in connect' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/kitchen-vcenter-1.2.1/lib/kitchen/driver/vcenter.rb:60:in create'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in public_send' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in block in perform_action'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:551:in synchronize_or_call' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:513:in block in action'
D C:/Tools/ruby24/lib/ruby/2.4.0/benchmark.rb:293:in measure' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:512:in action'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:484:in perform_action' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:394:in create_action'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:382:in block (2 levels) in transition_to' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/lifecycle_hooks.rb:45:in run_with_hooks'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:381:in block in transition_to' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:380:in each'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:380:in transition_to' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:129:in create'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:197:in public_send' D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:197:in run_action_in_thread'
D C:/Tools/ruby24/lib/ruby/gems/2.4.0/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:169:in `block (2 levels) in run_action'
D ----End Backtrace-----
D ---Nested Exception---
D Class: Kitchen::ActionFailed
D Message: Failed to complete #create action: [HTTP error (404)]

Support IPv4 assignment using DHCP

Describe the Enhancement

This enhancement would add support to the guest customizations so that when a virtual machine is created it's IP address is assigned automatically using DHCP

Describe the Need

I'm working with a customer who has an immediate need for this feature to be supported before they are able to migrate away from the deprecated chef-provisioning-vsphere. I believe that this would be a valuable feature to many more users / customers who want to create kitchens in VCenter without having to manage static IP addresses manually in each of their kitchen configurations. Using the current fixed ip assignment, if two developers were trying to run kitchen in the same cookbook they would have to modify their configs to ensure the ip guest customizations don't conflict.

Current Alternative

At the moment the only way to manage IP address assignments to a VM is through its' assigned IP address using the guest customizations. I am not aware of a workaround to allow VM's to come up with automatic DHCP leased addresses.

Can We Help You Implement This?

The current implementation for guest customizations is great and I think it'll be easy enough to extend to support this feature. I'm going to take a swing at this tonight and see how far I get.

Allow a network option

The chef-provisioning-vsphere driver supplies the following option:

network_name:
  - VLAN2071

If this was exposed as an option at both the driver level and the platform level I'd be elated. May work on this if I get some free time.

`wait_for_retry` parameter ignored

I'm setting wait_for_retry to 180 seconds, but it's being ignored, and default value of 90 seconds is being used. The Windows VM acquires IP successfully, a little over 90 seconds, but kitchen exits with an error.

kitchen create
-----> Starting Kitchen (v1.24.0)
-----> Creating <default-Win2016>...
       Assigning network VL2...
       Cloning 'Templates/Windows_Server_2016' to create the VM...
       Waiting for reconfiguration to finish
       Waiting for VMware tools/network interfaces to become available (timeout: 90 seconds)...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [No valid IP found on VM ] on default-Win2016
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

kitchen fails with error 'vAPI: vapi.data.invalid: value does not have expected type'

Versions:

  • Version of kitchen-vcenter: 1.2.1
  • Version of test-kitchen: 1.19.2
  • Version of chef: ChefDK 2.4.17

Platform Details

  • Version of vCenter: 6.5.0
  • Version of ESXi: 6.5.0 (build 5969303)

Scenario:

I am trying to start a test-kitchen instance on our local vcenter. I have previously tested this cookbook using ec2, but now want to run it locally.

Steps to Reproduce:

I followed the steps listed in the current MASTER branch README.md. My .kitchen.yml file looks like the following

---
driver:
  name: vcenter
  vcenter_username: <%= ENV['VCENTER_USER'] || "[email protected]" %>
  vcenter_password: <%= ENV['VCENTER_PASSWORD'] || "TOTALLY_NOT_MY_PASSWD" %>
  vcenter_host: 'VCENTER_HOST_ADDRESS'
  vcenter_disable_ssl_verify: true
  driver_config:
    datacenter: 'MY_DATACENTER_NAME'
    template: 'Ubuntu-16.04'
    targethost: 'MY_HOST_ADDRESS'
    resource_pool: 'DeployTest'

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
    data_bags_path: "test/integration/default/data_bags"
    encrypted_data_bag_secret_key_path: "test/integration/default/encrypted_data_bag_secret"

    run_list:
      - recipe[hydra-base::default]
    verifier:
      inspec_tests:
        - test/smoke/default
    attributes: {}

Expected Result:

An instance is created and the various kitchen tasks are executed.

Actual Result:

executed according to this:

-----> Starting Kitchen (v1.19.2)
WARN: Unresolved specs during Gem::Specification.reset:
      rake (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
-----> Creating <default-ubuntu-1604>...
E, [2018-01-11T16:14:58.516537 #21252] ERROR -- vAPI: vapi.data.invalid: value does not have expected type
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [vapi.data.invalid: value does not have expected type] on default-ubuntu-1604
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Add support for instant clones

Scenario:

Since version 6.7 of ESXi and vCenter it is possible to use instant clones via the new public API:
https://www.virtuallyghetto.com/2018/04/new-instant-clone-architecture-in-vsphere-6-7-part-1.html
https://www.virtuallyghetto.com/2018/04/new-instant-clone-architecture-in-vsphere-6-7-part-2.html

Full clones copy a full base template and then boot it up (kitchen-vcenter < 1.3.0)

Linked clones (see issue #18, kitchen-vcenter >=1.3.0) use an existing VM, add delta disks and then boot new VMs up from those. This allows much faster feedback due to missing multi-GB copy operations and less IO.

Instant clones can clone running VMs including memory sharing. This results in VM clones being available instantly in an already-booted state. This is used e.g in VMWare labs and VMWare Horizon View VDI.

The implementation of this feature will allow pipelines to run almost instantly, especially in the case of Windows based implementations.

The referenced blogs demonstrate that Instant Clones can provide 30 usable VMs within less than 2 minutes.

kitchen login always prompting for password

Versions:

2.6.2

Platform Details

vCenter 6.5.0 Build 9451637

Scenario:

Kitchen login is always prompting for password.

Steps to Reproduce:

  • Create a VM with the default vagrant username and password.
  • Run kitchen create to create the instance
  • Run kitchen login. You will be prompted for password

Expected Result:

Login without password prompt.

Actual Result:

Prompted for password

This seems to be the case whether using the default, using transport username and password options, or using the vm_name and vm_password` options for the driver.

Unhelpful messages from driver if specified item does not exist

Versions:

  • Version of kitchen-vcenter: master
  • Version of test-kitchen: 1.17.0

Scenario:

When specifying the datacenter, target host, folder and resource_pool and they do not exist, a very unhelpful message is displayed.

Steps to Reproduce:

Set folder to a name that does not exist

Expected Result:

A error message stating what does not exist

Actual Result:

An error message stating that the method does not exist on a nil object

Convert `targethost` to allow for clusters or targethosts

Changing the targethost to the high level "cluster" causes the following error:

~/repo/vmworld2017-demo/vim on master [d]± be kitchen verify ubuntu
-----> Starting Kitchen (v1.16.0)
-----> Creating <default-ubuntu-1604>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [Unable to find target host: Cluster] on default-ubuntu-1604
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

~/repo/vmworld2017-demo/vim on master [d]±

Though if i point it to a specific host in the cluster it works fine, we should have some logic to either pick a machine in the cluster, do a specific cluster, or maybe even let DRS do it for you.

Install attempt errors with message about requiring vsphere-automation-sdk

Versions:

  • Version of kitchen-vcenter: attempting to install 1.2.0
  • Version of test-kitchen: 1.16.0
  • Version of chef: 1.6.2

Platform Details

  • Version of vCenter: VCSA
  • Version of ESXi: 6.5.0u1

Scenario:

Trying to install the kitchen-vcenter gem

Steps to Reproduce:

chef gem install kitchen-vcenter

Expected Result:

that the kitchen-vcenter gem would be installed

Actual Result:

~/chef-repo-gci > chef gem install kitchen-vcenter
Fetching: socksify-1.7.1.gem (100%)
Successfully installed socksify-1.7.1
Fetching: httpi-2.4.2.gem (100%)
Successfully installed httpi-2.4.2
Fetching: wasabi-3.5.0.gem (100%)
Successfully installed wasabi-3.5.0
Fetching: akami-1.3.1.gem (100%)
Successfully installed akami-1.3.1
Fetching: savon-2.11.2.gem (100%)
Successfully installed savon-2.11.2
Fetching: kitchen-vcenter-1.2.0.gem (100%)
ERROR:  Error installing kitchen-vcenter:
	kitchen-vcenter requires vsphere-automation-sdk (~> 2.5)

Something like rsync folders would be useful

We've been using vagrant-vsphere for our testing in Kitchen (with a nice custom Vagrantfile.erb) and it has been working well.

We'd like to investigate kitchen-vcenter, but it's missing a major feature that we absolutely rely on in Vagrant: rsync folders to get our source code on to the machine to be tested (pull requests tests, etc).

It would be nice if kitchen-vcenter could accept the syntax of vagrant for shared folders. We don't need monitoring/updates as it would be a one-time rsync up to the new VM when it gets spun up.

I realize this is a huge ask, so I don't expect it to be done tomorrow, but I wanted to start a conversation to see if something like this would even be feasible. :)

For reference: https://www.vagrantup.com/docs/synced-folders/rsync.html

Add supported vCenter version to Requirements

Currently I'm not sure which vCenter versions are supported by this gem - I'm testing against 6.0, and I'm getting the following error:

>>>>>>     Failed to complete #create action: [HTTP error (404)] on default-rhel7

I suspect it's due to my version of vCenter being unsupported, but I have no way to validate that suspicion without a list of supported versions.

Setting 'folder' (destination folder when new VM should be created) does not work

Versions:

  • Version of kitchen-vcenter: 2.6.4
  • Version of test-kitchen: 2.4.0
  • Version of chef-client: 15.8.23

Platform Details

  • Version of vCenter: vSphere 6.7.0.42000
  • Version of ESXi: 6.7.0

Scenario:

I'm trying to define a .kitchen.yml file that will work with a local on-site vSphere. Ideally I'd like to put all kitchen created VMs in a folder dedicated to 'kitchen' so in my kitchen.yml in my 'driver' section I've defined:
folder: Kitchen-Servers

With this, the VM does indeed get created in the right place, but in file clone_vm.rb when the line 'dc.find_vm(path)' is run, the VM is not found. When I leave 'folder' empty, then the VM create is put at the top level and the find_vm is able to find the VM

Since we will be supporting multiple teams the folder structure looks something like:
DC/Unix/Kitchen-Servers
DC/Windows/Kitchen-Servers

Steps to Reproduce:

Specify any folder in which you want the VMs to be put like defining the following in the driver section:
folder: Kitchen-Servers
then run:
kitchen create
and you should see the new kitchen VM get created in the correct place, but it will not be found later.

Expected Result:

I'd expect 'kitchen create' to be able to find the VM and spin it up

Actual Result:

I get an error from 'kitchen create' of:
>>>>>> Failed to complete #create action: [Unable to find machine: Kitchen-Servers/default-rhel-6-aed272d3] on default-rhel-6

Dependabot can't parse your Gemfile

Dependabot couldn't parse the Gemfile found at /Gemfile.

The error Dependabot encountered was:

Dependabot only supports uninterpolated string arguments to eval_gemfile. Got `__FILE__ + ".local"`

Question : how to configure IP allocation ?

The knife vcenter driver supports following option in order to setup a DHCP address allocation:

--cips dhcp

Is it possible to manage same behavior for VMs created by kitchen-vcenter ?

Ability to add additional disks

Describe the Enhancement:

We create machines that need more than one disk mounted. It would be useful to be able to add additional disks at machine creation.

Describe the Need:

This would benefit anyone who needs more than just one disk. This is useful to check Chef recipes that mount disks etc to ensure it all works as expected.

Current Alternative

None - Have to manually add disk or ensure templates have additional disks at this time.

Can We Help You Implement This?:

We are evaluating this provisioner as we currently use the now deprecated Provisioning vSphere driver (https://github.com/chef-boneyard/chef-provisioning-vsphere) which has this functionality.

Resource pool is not specified when creating a new machine

Versions:

  • Version of kitchen-vcenter: master
  • Version of test-kitchen: 1.17.0

Scenario:

When creating a machine a resource pool must be specified. This should be an option in the .kitchen.yml file.

Steps to Reproduce:

Try to create a machine with the driver

Expected Result:

A machine created in VCenter

Actual Result:

An error stating that there is an invalid parameter in spec.pool

Ability to create machine with Static IP and DNS settings.

Describe the Enhancement:

I would like to use this driver and be able to add customizations settings for setting systems up with Static IP and DNS configurations. This functionality was previously available in a kitchen-vsphere driver from a provisioning driver that is now in the boneyard
something similar to this

        user: root
        paranoid: false
        password: password
        port: 22
      convergence_options:
      customization_spec:
        domain: local
        ipsettings:
          dnsServerList:
            - 8.8.8.8
            - 8.8.4.4

Describe the Need:

Many customer I Have dealt with as well as when I was a customer of chef were forced to only use Static IPs even when doing test-kitchen for security reason. Because of this. I am unable to use this driver currently to test against corporate approved images for deployments., This makes is difficult to prove testing results in the pipeline as well as to security as they are not run against hardened images in house.

Current Alternative

No current alternative other than creating bento boxes for every customer.

Can We Help You Implement This?:

Like many of the issues already filed. Adding customization features for vsphere/vcenter would greatly enhance the usability of the kitchen process for these customers.

Attach multiple networks to a VM

Describe the Enhancement

When creating a VM using the vCenter driver for Kitchen I want to be able to set more than one network

Describe the Need

This is a requirement for how we build and test cookbooks for one of my customers. Many of our servers that we build and configure with Chef are attached to multiple networks and it's important that we're able to test our cookbooks setup managed services on specific network interfaces, which we can test for with InSpec.

In YAML, I would expect users to be able to provide the network names they want to attach to their VM using an array, like this:

network_name:
  - Network_1
  - Network_2

Since this is already in use that change would break compatibility with a lot of users so it should be smart enough to support the array notation for multiple networks as above in addition to specifying a single network as before:

network_name: "Network_1"

Current Alternative

The only alternative option we have to accomplish this is to use the unsupported chef-provisioner-vsphere driver.

In addition to it not being supported, it's also not compatible with the new version of Test Kitchen, which makes it impossible for my team up upgrade to Chef Workstation. As a result we are locked into using ChefDK for the foreseeable future until this is supported.

Can We Help You Implement This?

Absolutely! I have aspirations of working on this and want to contribute to this, but if Chef or someone else beats me to it I would be just as happy to have it finished. Would also be willing to collaborate with anyone too, which would probably motivate me to dedicate time to give it attention.

Errors if no cluster found or targethost not in a cluster

Versions:

  • Version of kitchen-vcenter: 2.5.0
  • Version of test-kitchen: 2.2.5
  • Version of chef: 15.2.20

Platform Details

  • Version of vCenter: 6.7
  • Version of ESXi: 6.7

Scenario:

Trying to create a kitchen instance in an infrastructure without clusters defined, will result in an error. Also, an error will occur if there are any clusters defined but the targethost is not part of one

Steps to Reproduce:

  • Create a clean vCenter with just one ESX host and no clusters
  • Do specify datacenter and resource_pool as wanted, but no cluster

Expected Result:

Expected to create a VM on the first target host.

Actual Result:

No cluster at all:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [Unable to find Cluster: ] on default-u18
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Cluster, but host is not part of it:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [Unable to find target host: ] on default-u18
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Failed to complete #create action: [Unable to find template: centos74-noGVTPL] on default-centos-7

Versions:

  • Version of kitchen-vcenter: 2.7.0
  • Version of test-kitchen: 2.5.1
  • Version of chef: 15.11.8
  • Version of ChefDK: 4.8.23

Platform Details

  • Version of vCenter: 6.7.0
  • Version of ESXi: 6.0.0

Scenario:

kitchen create
Vm templates existing in root directory of datacenter name Chef
In production we are using chef-provisioning-vsphere gem and creating new vms by test kitchen but this is not compatible with chefdk4 so i want to shift to this gem

Steps to Reproduce:

driver:
name: vcenter
vcenter_username: <%= ENV['VCENTER_USER'] %>
vcenter_password: <%= ENV['VCENTER_PASSWORD'] %>
vcenter_host: <%= ENV['VCENTER_HOST'] %>
datacenter: Chef
folder: TESTKITCHEN
vcenter_disable_ssl_verify: true
template: centos74-noGVTPL

I don't see template issue , if i use https://github.com/chef/knife-vsphere gem
knife[:vsphere_user] = <%= ENV['VCENTER_USER'] %>
knife[:vsphere_pass] = <%= ENV['VCENTER_PASSWORD'] %>
knife[:vsphere_host] = <%= ENV['VCENTER_HOST'] %>
knife[:vsphere_insecure] = true # if you want to disable SSL checking
knife[:vsphere_dc] = "Chef"

knife vsphere template list

Template Name: centos74-noGVTPL
Template Name: centos69-noGVTPL

Expected Result:

create VM in vcenter

Actual Result:

-----> Starting Test Kitchen (v2.5.1)
-----> Creating ...

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [Unable to find template: centos74-noGVTPL] on default-centos-7

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

Kitchen Vcenter Converge Issue

We are seeing this when trying to get a test kitchen created. It occurs intermittently, so we have had some kitchens converge successfully, and without any modifications to the kitchen file in either case. Do you have any insight on this? Any steps to troubleshoot further? We’re stumped on next steps on our end.

Yeah, we have already created that resource pool. I tried removing the parameter from the kitchen file just be sure we don’t have typos or some weird spacing issue. As you can see from the below console output, that resource pool definitely already exists and matches what we were specifying in our kitchen file. This is what is leading us to believe there could be a bug in the gem. Do you think this is the case? Should we be filing this as an issue on GitHub?

```````` Console Output ``````````

root@some_chefdk_docker:# kitchen create -l debug

-----> Starting Test Kitchen (v2.10.0)

$$$$$$ Deprecated configuration detected:

customize

Run 'kitchen doctor' for details.

D Berksfile found at /foo/bar/Berksfile, using Berkshelf to resolve cookbook dependencies

D Berkshelf 7.1.0 library loaded

-----> Creating ...

D Starting kitchen-vcenter 2.9.0

D Search of all resource pools found: ["Windows Kitchen Testing", "SOME_Tenant::domain-123::group-123", "SOME_Tenant::domain-1213::group-123", "SOME_Tenant::domain-123::datastore-123", "SOME_Tenant::domain-1011::datastore-123", "SOME_Tenant::domain-123::group-123", "SOME_Tenant-1::domain-789::group-123", "SOME_Tenant-1::domain-123::group-123", "SOME_Tenant-1::domain-456::group-123", "SOME_Tenant::domain-123::group-123", "SOME_Tenant::domain-123::group-123", "Kitchen Testing"]

See https://github.com/chef/customer-bugs/issues/409 for additional details

Support for Content Library OVF templates

Describe the Enhancement

Templates have benn able to be stored in Content Libraries since vSphere 6.0, but the kitchen-vcenter driver does not yet support this fully.

Describe the Need

Content Libraries offer the ability to replicate templates across sites or vCenter installations instead of the old Template concept.

Current Alternative

  • use normal VMs/Templates (pre vSphere 6.0 method)
  • use VMTX templates (post vSphere 6.7u1)

Before 6.7u1, templates were always OVF and only available via the newer vsphere-automation APIs. Since 6.7u1, normal templates can be placed into Content Libraries as well and are visible to the vsphere-automation APIs as well as the legacy VMomi API.

As 6.7u1 seems to provide most APIs which where previously only on Vmomi, this might be a future road to get rid of the old dependencies.

Can We Help You Implement This?

Hire me ;) Just kidding - looking into it right now. Mainly concerned with the need to 1:1 duplicate functionality

Dependabot can't parse your Gemfile

Dependabot couldn't parse the Gemfile found at /Gemfile.

The error Dependabot encountered was:

Dependabot only supports uninterpolated string arguments to eval_gemfile. Got `__FILE__ + ".local"`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.