VMware Cloud Community
Czernobog
Expert
Expert

vRA 8.4 - user form password input - problem during deployment update

I want to allow my users to provide a password for their system during deployment. This input gets sent to ansible which takes care of setting the password on the deployed system. The input is defined as follows:

 

inputs: 
  password:
    type: string
    title: Password
    description: Password for the given username
    # writeOnly: true # will uncomment after debugging is finished 

 

The input field is by default mandatory. The user inputs a string, the value gets passed on and the password is set. A problem arises however, when you update the deployment. All input values in the Update form field are set to the latest set values, including the password... which is expected, since it is just another input value. So if I set the password input to "vmware123", the value will be present in the Update form (hidden, if using writeOnly).

This is of course problematic, since in most cases the user does not want to update the password or redeploy the vm when only for example changing some other inputs (like network assignments in my case - this action cannot be executed on the network resoruce directly). However it still should be available as an option, should the owner of the vm choose to reprovision it.

I thought at first of a workaround where the password input field would be optional: it will only be used, when the value is not null. But implementing it is not possible because of another issue - it does not seem possible to input a null value in a template or user form in vRA, even as a default value. It is also by default not possible to set the input field as non-mandatory - you first have to set a default value (nevermind what), change the field to Required = no in the custom form and then remove the default value. This works for the initial deployment, but when Updating the deployment, the field is still shown as required and so using null is not possible - the form will throw a "this field cannot be empty" error.

Is there a valid workaround for this scenarion? The examples provided by VMware only include some on setting the password, Update scenarions are not discussed, sadly.

0 Kudos
0 Replies