Created attachment 1346070 [details] method being used to add nics in provisioning request. Description of problem: When trying to provision a VM into VMware and adding additional nics (beyond first nic) during provisioning, using the set_network_adapter method, a cryptic error of "undefined method `[]' for nil:NilClass')]" results, and automate exits. Version-Release number of selected component (if applicable): cfme-5.8.2.3-1.el7cf.x86_64 How reproducible: Connect CFME 5.8.2 to vCenter version 6.0.0 and use the set_network_adapter method as such: prov.set_network_adapter(1, {:network => network2, :is_dvs => false} ) Actual results: VM Provision errors out, and subsequent service provision as well with following error: Calling Create Notification type: automate_user_error subject type: MiqRequest id: 86 options: {:message=>"VM Provision Error: [calo-dev-cfme-wk1] VM [vmw_nics_01] Step [CheckProvisioned] Status [Error Creating VM] Message [[NoMethodError]: undefined method `[]' for nil:NilClass] "} Expected results: VM is provisioned and additional nics are added. Additional info: CFME 5.8.2 vCenter Version 6.0.0 Build 5318172 VMware template has one nic, but Custom Spec has 5 defined. I will attach the actual method that I am using in my state machine. I have this method being called in the Infrastucture --> VM --> Provisioning -> StateMachine -> VMProvision_VM -> Provision VM From Template statemachine. It is placed in the schema immediately before pre-provisioning.
https://github.com/ManageIQ/manageiq-providers-vmware/pull/132
New commit detected on ManageIQ/manageiq-providers-vmware/master: https://github.com/ManageIQ/manageiq-providers-vmware/commit/8b196f6027a3bc0ae77f2cbb15ebab58a3309ec5 commit 8b196f6027a3bc0ae77f2cbb15ebab58a3309ec5 Author: Greg McCullough <gmccullo> AuthorDate: Sat Nov 4 19:47:35 2017 -0400 Commit: Greg McCullough <gmccullo> CommitDate: Mon Nov 6 09:02:43 2017 -0500 Properly update network hash when the first array element is nil Refactor and add tests for normalize_network_adapter_settings https://bugzilla.redhat.com/show_bug.cgi?id=1508069 .../provision/configuration/network.rb | 40 ++++++++++------ .../provision/configuration/network_spec.rb | 55 ++++++++++++++++++++++ 2 files changed, 81 insertions(+), 14 deletions(-) create mode 100644 spec/models/manageiq/providers/vmware/infra_manager/provision/configuration/network_spec.rb