Provisioniong Dialogs and sysprep_domain_name


#1

Hi all,

I need some assistance in figuring this out. The default miq_provision_vmware_dialogs_template dialog has a sysprep_domain_name stanza that looks like this:

  :sysprep_domain_name:
    :values_from:
      :options:
        :active_proxy: 
        :platform: 
      :method: :allowed_domains
    :auto_select_single: false
    :description: Domain Name
    :required: false
    :display: :edit
    :data_type: :string

What is greatly disturbing me is this method “allowed_domains”. I really really want to not validate this field in any way, and simply allow the end user to enter their desired domain name as plain text.

So I have modified it thus:

  :sysprep_domain_name:
    :auto_select_single: false
    :description: Domain Name
    :required: false
    :display: :edit
    :data_type: :string

I saved this with a new name, and modified the provisioning profile so that this new dialog gets selected. And I am thinking, “sweet … this should fix the problem”. But I’m only half way there. When I try to invoke the provisioning dialog, by going to Infrastructure, Virtual Machines, and choosing Lifecycle, Provision VMs, selecting a Windows template then going to Customize …

I still get a drop down list selector, but there are no choices available. How do I change the dialog to make this a freeform text field instead of a drop down?


#2

@Stephen_McKay,

The dialog field type is defined in the view for provisioning dialogs which means you will need to move the :sysprep_domain_name symbol from the drop-down section (app/views/miq_request/_prov_field.html.haml#L247) to the text field section here:

Give it a try and let me know if that works for you.


#3

Ooh. Mmm - yeah that’s probably going to work, but I really don’t want to try :slight_smile: … Not that I disrespect your advice - I just want to leave the miq / cloudforms code pristine, to minimise the maintenance required if and when we deploy rpm updates.

Maybe I’m attacking my problem in the wrong way. What I’ve found is that setting the :sysprep_domain_name option in miq_provision isn’t having the desired effect, and I think the call to the ‘allowed_domains’ method in this stanza from the provisioning dialog is preventing me from overriding that option with a freeform text variable from a service dialog. The reason is that ‘allowed_vlans’ is populating the drop down with only one domain - the ldap domain we are using to authenticate users. If I provision a VM to that domain, all is good. If I provision to another domain, the sysprep phase of the VMware clone-to-template operation takes forever – and it never joins the domain! The Unattended.xml left behind on the VM from the attempt has no AD domain specified, which suggests CloudForms isn’t passing the desired parameters - even though the desired options (dialog_option_0_sysprep_domain_name) are set in miq_provision, which I have verified by dumping root to the automate log.

I could hard code the valid possible domains as a values: hash in the provisioning dialog, and I assume that would work, but I don’t want to incur the overhead of having to maintain a list of possible domains. It would also create issues for our multi-tenancy environment, which I admittedly could address by using different provisioning dialogs and profiles for each customer, but again, I’m looking to reduce the degree of maintenance and customisation required to on board new tenants, not only because I’m an inherently lazy scumbag, but also because I work with a team of like minded individuals :slight_smile:

What are my options here? Can I just remove the call to ‘allowed_domains’? Will that be sufficient to let miq_provision consume my service dialog options without interference?

Or maybe I am experiencing something out of the ordinary - maybe I should just keep looking for the broken piece in this puzzle.