chef/kitchen-vcenter

Errors if no cluster found or targethost not in a cluster

thheinen opened this issue · 1 comments

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

Fixed with version 2.5.1