Created attachment 1233425 [details] customer provided log showing request and error response Description of problem: Customer using REST API to provision Windows VM and is encountering undefined method 'key?' error Version-Release number of selected component (if applicable): 4.1 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: customer logs provided
Created attachment 1233450 [details] current logs as provided by customer
This error occurred because the data for the sysprep_timezone dialog field is stored differently then other fields. Instead of hashes the data is stored in an array which is causing the reported method error. INFO -- : MIQ(ManageIQ::Providers::Vmware::InfraManager::ProvisionWorkflow#set_ws_field_value) processing key <customize:sysprep_timezone(string)> with values <[["(GMT-12:00) International Date Line West", "000"], ["(GMT-11:00) Midway Island, Samoa", "001"], ... We will need to look into the best method to resolve this issue. As a work-around I would suggest the user remove the timezone value from the vm_fields data being passed and provide the value as part of the additional_values section. Then they will need to modify an automate method to apply this value to the provision task before the task is sent to the provider.
Another workaround that will work for this issue is to create a custom provision dialog for the service account that is being used to access the API. In this dialog I changed the `syspre_timezone` to optional and defaulted the value to `020` (Central Time).
https://github.com/ManageIQ/manageiq-providers-vmware/pull/35 and https://github.com/ManageIQ/manageiq-ui-classic/pull/982
https://github.com/ManageIQ/manageiq/pull/14772
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/d7bb1da4d14cd066ed4271275f26198b5fdf7aa5 commit d7bb1da4d14cd066ed4271275f26198b5fdf7aa5 Author: Greg McCullough <gmccullo> AuthorDate: Thu Apr 13 22:02:29 2017 -0400 Commit: Greg McCullough <gmccullo> CommitDate: Thu Apr 13 22:02:29 2017 -0400 Remove call reverse! for timezone after converting structure to hash. https://bugzilla.redhat.com/show_bug.cgi?id=1406084 app/models/miq_provision_virt_workflow.rb | 1 - 1 file changed, 1 deletion(-)
Verified using POST /api/provision_requests { "version": "1.1", "template_fields": { "guid": "56595c62-318b-11e7-bfda-001a4a447b87" }, "vm_fields": { "number_of_cpus": 1, "vm_name": "test_rest_prov_1113", "vm_memory": "2048", "vlan": "DPortGroup (DSwitch)", "sysprep_timezone": "095" }, "requester": { "user_name": "admin", "owner_first_name": "John", "owner_last_name": "Doe", "owner_email": "jdoe", "auto_approve": true }, "tags": { "network_location": "Internal", "cc": "001" }, "additional_values": { "request_id": "1001" }, "ems_custom_attributes": {}, "miq_custom_attributes": {} }