Bug 1302250

Summary: Cannot add Environment options in the vmFields argument of create_provision_request
Product: Red Hat CloudForms Management Engine Reporter: Peter McGowan <pmcgowan>
Component: AutomateAssignee: Greg McCullough <gmccullo>
Status: CLOSED DUPLICATE QA Contact: Milan Falešník <mfalesni>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.5.0CC: amclean, blong, dajohnso, fdewaley, james.beal, jhardy, kmorey, mkanoor, nachandr, nstephan, obarenbo, tfitzger
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: automate
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-22 16:46:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Peter McGowan 2016-01-27 10:08:24 UTC
Description of problem:
I'm not sure if this is a bug or an RFE, but I don't seem to be able to add any options from the Environment provisioning dialog tab to my vmFields argument in a call to create_provision_request. In particular for a cloud instance provision it would be useful to be able to set options such as :cloud_network or :cloud_tenant.

Looking through the code in miq_provision_virt_workflow I can see that it's hard-coding "values[:placement_auto] = [true, 1]", so there's a possible assumption that Environment processing is not required. Certainly ws_vm_fields does not try to handle any environment fields; there's no ws_environment_fields method to handle the insertion of any environment values. If I try setting the value :cloud_network in my vmFields argument I see the message:

"Unprocessed key <cloud_network> with value <"1000000000002">"

This was probably a reasonable assumption when we purely had Infrastructure VM provisioning, but now with Cloud Instance provisioning to multiple tenants it would be useful to be able to override the auto_placement values.

Version-Release number of selected component (if applicable):
5.5.0.13

How reproducible:
Every time

Steps to Reproduce:
1. Code a call to $evm.execute('create_provision_request', args) with a templateFields argument specifying an OpenStack image name, and a vmFields (arg3) value containing "cloud_network=1000000000002|cloud_tenant=1000000000001" (specify valid object IDs)
2. Call the method
3. 

Actual results:
Observe in log/evm.log:

Unprocessed key <cloud_network> with value <"1000000000002">
Unprocessed key <cloud_tenant> with value <"1000000000001">

Expected results:
The specified cloud_network and cloud_tenant should be set in the provision request.

Additional info:
I note that we can override this behaviour ourselves by passing Environment value as ws_values arguments, and then special-casing them in an openstack_CustomizeRequest, but the need to do this is not intuitive, and not documented.

Comment 3 Shveta 2016-02-03 00:14:27 UTC
Assigning to add test case

Comment 5 Greg McCullough 2016-04-22 16:46:19 UTC

*** This bug has been marked as a duplicate of bug 1297335 ***