test-kitchen / kitchen-vra

A Test Kitchen driver for VMware vRealize Automation
Apache License 2.0
13 stars 22 forks source link

Custom properties not being read from kitchen.yml #30

Closed bender-the-greatest closed 5 years ago

bender-the-greatest commented 6 years ago

Versions:

Platform Details

Scenario:

Extra parameters are not being applied to the VM request when I run kitchen create. Not sure if it's relevant but I am specifying an alternate kitchen file by setting $env:KITCHEN_YAML. Test Kitchen is being executed from Powershell 5.1 on Windows 10.

Steps to Reproduce:

Here is the platform portion of my kitchen file in regards to setting the custom property values (generalized to remove company specific data but the structure is the same):

platforms:
  - name: platform-windows-2012r2
    driver:
      cpus: 2
      memory: 4096
      catalog_name: Windows2012R2
      subtenant_name: 'cloud_dev'
      extra_parameters:
        provider-My.Property.Name:
          type: string
          value: 'Some value goes here'

There are about 15 properties i'm setting in this way under extra_parameters. It is also unclear whether machine properties need to be nested specially as well.

Expected Result:

All custom properties I am passing in are recognized.

Actual Result:

For required properties, the request fails with the error "The data specified within the request is invalid., Field with id My.Property.Name is required." In reality the error is extended with every required property that is not being picked up from my kitchen file.

PopPopDevOps commented 5 years ago

Seeing the same issue, not sure if it is kitchen-vra or vmware-vra gem that is the issue.

bender-the-greatest commented 5 years ago

It's been a while since I looked at this, I think vmware-vra gem changed and kitchen-vra needs to be updated. But then I got pulled into some other stuff and haven't been able to work on a fix yet.

PopPopDevOps commented 5 years ago

I am testing on the following: Test Kitchen version 1.24.0 kitchen-vra (2.6.0) vmware-vra (2.6.1)

mcascone commented 5 years ago

Also seeing this right now, on:

kitchen-vra 2.6.0
vmware-vra (2.6.1, 2.3.0, 1.5.2)

Platform: Windows
vmware vRealize Automation 7.0.1

These props are not being set:

cpus: 2
memory: 8192
lease_days: 7
notes: 'a note'
description: 'a description'
bender-the-greatest commented 5 years ago

I'm hoping my plate clears in the next couple weeks and I can look into this again, but it would be nice if someone from chef-partners could weigh in.

stuartpreston commented 5 years ago

We have been researching a similar issue in https://github.com/chef-partners/kitchen-vra/issues/33

I note the extra_parameters appears to be a tilde-delimited field, rather than a hyphen as per the OP - maybe the combination of the workaround in #33 and using the tilde would solve the problem here. Please let us know any feedback you have which would help us, we do not have easy access to all the specific VRA versions being mentioned here.

bender-the-greatest commented 5 years ago

I should at least be able to give this another go later this week, if not, next week, if a potential workaround has been identified.

bender-the-greatest commented 5 years ago

Actually now that I read #33 I'm fairly certain I had run into the ~ issue when I was trying to solve this on my own, and did fix it by to_sing at the split_key line, but still found that the extra parameters were not getting supplied with the request. However, I'll give this a shot again when I get some time in case I'm mistaken, it's been several months since I worked on this.

stuartpreston commented 5 years ago

This should be fixed by the release that was just made to the vmware-vra gem (2.7.0) - as kitchen-vra pins to any 2.0 release you should be able to update your chef/ruby installation using chef gem install vmware-vra. The kitchen-vra gem has not been modified.

Please note the provider- prefix on the parameter name should not be required and you should see all parameters included nested parameters in the inputs when you deploy a Blueprint.

bender-the-greatest commented 5 years ago

Sweet! I'll try to give this a go soon.