Closed RoinGrindwald closed 5 years ago
Hi @RoinGrindwald - we sat down and had a look at this and it appears to be the way that the specified key from your kitchen.yml file is sent through to an external library (vmware-vra gem). We would appreciate your help trying our workaround first and then we can work out how to push out a fix:
Please could you try editing your local copy of the following file: C:/Users/username/AppData/Local/chefdk/gem/ruby/2.5.0/gems/vmware-vra-2.6.1/lib/vra/request_parameters.rb
On line 54, change
split_key = key.split("~")
to
split_key = key.to_s.split("~")
If that solves the problem, then let us know and we'll figure out how to get the changes into the vmware-vra-gem projectand push out the changes in a future ChefDK/Chef Workstation.
Stuart /cc @russellseymour
I just attempted this and still not passing my extra parameters through. I am having the same issue as this https://github.com/chef-partners/vmware-vra-gem/issues/73. Trying to pass in a RHEL version or an SSH key.
I have just tested this and it fixed the error of not splitting the ~ from the parameters, but even though all mandatory extra parameters are specified, it still saying they are missing.
platforms:
- name: Application Server Test
driver:
catalog_name: Application Server
subtenant_name: Windows Services
cpus: 2
memory: 4096
extra_parameters:
provider-_deploymentName:
type: string
value: Testing Test-kitchen
provider-Hostname:
type: string
value: test001
provider-APP_Server~MaintenenceWindow:
type: string
value: 'SAT 12:00-13:00'
provider-APP_Server~ServerDescription:
type: string
value: Testing Test Kitchen
provider-APP_Server~SRM:
type: boolean
value: false
provider-image:
type: string
value: ValueSet.WindowsServer2016
provider-Vrm.DataCenter.Location:
type: string
values: lab
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Failed to complete #create action: [Unable to submit request: The data specified within the request is invalid., Field with id APP_Server~SRM is required., Field with id APP_Server~ServerDescription is required., Field with id APP_Server~Hostname is required., Field with id APP_Server~MaintenenceWindow is required., The value for the field with id MaintenenceWindow should be among the permitted values.] on default-Application Server Test
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
@RoinGrindwald Good that you were able to get slightly further. Do you have the rest of the Exception with any stack trace? Without your specific VRA setup it's hard to debug, but clearly the server thinks there's something wrong with the format of the requests being sent in. Is there any debug in logs available on the server that would help decipher what we're sending in vs what you've configured in your kitchen.yml?
I'm guessing some of these extra parameter names are being sent in a format the server doesn't understand. This might just be confirming this statement that extra parameters were not working with VRA 7: https://github.com/chef-partners/vmware-vra-gem/blob/master/README.md#creating-a-request-from-a-yaml-or-json-payload
# create a parameters array, although this only works with VRA6, since VRA7 can have complex data
parameters = yaml_data['requestData']['entries'].map {|item| [item['key'], item['value'].values].flatten }
@stuartpreston I created a new Blueprint in VRA for testing and removed/unenforced a bunch of the mandatory fields. I was able to get kitchen create to send a request to VRA. The issue though was none of the CPU, Memory, or Notes were actually captured of the request. I set the kitchen.yaml to 2 cpus and 4096 memory but came through with the defaults 1 cpus and 1024 memory. So something is defiantly wrong with how it's sending this to VRA.
If we use the much older version of kitchen-vra (2.2.0) and vmware-vra (2.1.3) we are able to pass in the extra parameters with the newest version of ChefDK (3.9.0) to our vRA server (Version: 7.5.0 (Build: 10053500)). As soon as we switch to any of the newer gems for vra we no longer pass the extra parameters.
@RoinGrindwald Reviewing the above, are you able to try the specified versions of these gems in your system to see if the parameters get passed?
Also, I wanted to double check that you have tried with and without the provider-
part of the parameter name in the kitchen.yml? Reviewing the specs for the vRA API, it is possible later versions do not require this part passed in.
In my working tests with the older gems I am not using the provider- in the parameters. I have tried with and without for the newer versions and nothing passes.
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.x 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.
Hi folks, I just upgraded to v2.7.0 and got this error:
ERROR: Vra::Exception::RequestError: Unable to submit request: Invalid filter '(userName eq "mcascone" and domain eq null)': Invalid filter value beginning at position 38
Moments prior to upgrading, i successfully ran the spin 3 times with no problems.
My command:
knife vra server create $catitem -N 'ICERemote-4' -r 'role[ice-remote-uat]'
Versions:
Platform Details
Scenario:
Kitchen Create is unable to provision with vra driver due to a undefined method for Symbol ~
Steps to Reproduce:
Adding any extra parameters that are required will result in the error. But if you try without them you cannot submit due to missing required parameters.
Expected Result:
You should see
Message: undefined method `split' for :"provider-APP_Server~Hostname":Symbol
in your kitchen.log.Actual Result: