VMware Cloud Community
rwk1982
Enthusiast
Enthusiast

vRA 7.4 - Custom Forms Data Grid

Hello!

I am playing around with the Data Grid in the New Custom forms Designer - more precisely with the "disks" Grid. What I found so far:

  • Adding the Grid to the Forms I got this Error:

Schema fields [[is_clone, initial_location, volumeId, id, label, custom_properties, userCreated, storage_reservation_policy, capacity]] should match the default value fields [[is_clone, initial_location, volumeId, id, label, userCreated, storage_reservation_policy, capacity]].

Cause: there is no "custom_properties" Field in the Grid Layout

Solution: Look at the "Default" Value and remove the "custom_properties," from the Header and the "," bevor the capacity - in my case before the "80":

is_clone,initial_location,volumeId,id,label,custom_properties,userCreated,storage_reservation_policy,capacity

true,,0,1525072814859,Hard disk 1,,false,,80

is_clone,initial_location,volumeId,id,label,custom_properties,userCreated,storage_reservation_policy,capacity

true,,0,1525072814859,Hard disk 1,,false,80

  • Using the "disks" Grid "breaks" any approval Policies based on Storage Size

Cause: If you add more disks to the Grid the Value of "Storage (GB)" will not be incremented

Solution: Well... its more a workaround since I have not found a way to pass the Values of a Data Grid to an vRO Action. I created a vRO Action which fills the "disks" Grid based on Values in the Custom Form (the size of the template base disks are Hardcoded):

pastedImage_13.png

pastedImage_17.png

pastedImage_14.png

  • If you use an external vRO Action for the Grid Values the Return type of the Action must be "Array/Properties". In my Case the Action was not found if I use this return Type.

Cause: Bug?

Workaround: I changed the Return Type to "Array/String" and the Action was found in vRA. After I changed the Values Binding in the Custom Form, Saved the Blueprint and corrected the Return Type of the Action to Array/Properties.

Drink coffee.. Do stupid things faster with more energy...
23 Replies
agbiront
Contributor
Contributor

Hi!

Could you explain a bit more on how to configure a user friendly disk grid?

The first part, actually. I don't mind right now about not filling the capacity. What I'm trying to do is give the user the ability to add a disk on any drive letter or mount point exactly like the normal form. But in this custom form, the Disks data grid asks for more information that the user doesn't know, and is confusing even if it is not required.

I'd like to have a custom form with a disk grid that only requires te size, the label and the mountpoint / drive letter.

How did you achieve that?

Thanks in advance.

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast

Hello!

My first idea was to use a "basic" DataGrid and use the values to build the Disk DataGrid but i never found out how to build this. So my solution was this custom form:

pastedImage_2.png

And with the attached Action with this input fields:

pastedImage_3.png

You can add "in_diskX_label" and "in_diskX_location" to the Input paramters and change the code from:

// snip

for (i = 1; i <= in_disk_count; i++) {

     var disk_size = "in_disk" + i + "_size"

     try {

          disks.push({"is_clone":false,

          "initial_location":null,

          "volumeId":disk_number,

          "id":null,

          "label":null,

          "userCreated":true,

          "storage_reservation_policy":StorageReservation,

          "capacity":eval(disk_size)})

          disk_number++

          } catch(err) {

          break

          }

}

//snip

to:

//snip

for (i = 1; i <= in_disk_count; i++) {

     var disk_size = "in_disk" + i + "_size"

     var disk_label = "in_disk" + i + "_label"

     var disk_location = "in_disk" + i + "_location"

     try {

          disks.push({"is_clone":false,

          "initial_location":eval(disk_location),

          "volumeId":disk_number,

          "id":null,

          "label":eval(disk_label),

          "userCreated":true,

          "storage_reservation_policy":StorageReservation,

          "capacity":eval(disk_size)})

          disk_number++

          } catch(err) {

          break

          }

}

//snip

In the custom form add two fields per Disk and link them to the "in_diskX_label" and "in_diskX_location" fields of the Action.

For the visibility in the custom form i use a conditional value based on the "Additional Harddisks":

pastedImage_16.png

I know: not the best solution but it works for our Environment Smiley Happy I really hope that in future vRA releases custom forms will be more "dynamical"...

Robert

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

@Robert ¯\_ツ_/¯

Did you find a way to remove/change columns? I just want to hide from my user unnecessary info like "id/storage_reservation" etc - leave just "size" here.

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast

I think there is no way to remove columns of the disk data grid. I put the grid in a new tab and set the visibility of the tab to "No" so the users never see it.

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

Yep, i figured out that this grid based on disk literalMap object with already hardcoded structure... My problem - to give users the same easy way to add more disks in the request form as they do today in the old form - they just click "+" and specify disks's size, vRA takes care of id/reservation for them. In custom form you have to specify all this information - it is risky and confuses users.

VMware - do you really test things BEFORE release? Are you listening customers at all? How could it be that "Disk" form is broken from the beginning??? 

Reply
0 Kudos
agbiront
Contributor
Contributor

Unhappyvra,

It looks like, although ugly, the "Disk" form works like the old form. I've requested different blueprints to test:

Only specify "size". Added 2 disks. Both show up, and they work fine. Also if you have Guest Agent they get formatted and a labeled according to the auto assigned letter.

Only specify "size" "label" and "id": Works like before but label and drive letter are assigned by the user.

Just don't touch the other columns, and thats fine. It's fugly, but it works.... (like the old form :smileysilly:)

Robert,

Thanks a lot! I've got to get my head around this. I'm a newbie on vRA and I'm making a lot of effort to have a production ready environment to show here where I work.

This disk form issue is mostly cosmetic, but I can't quite follow everything you said Smiley Sad

Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

Well, the case here - to give end-users exact the same experiences as they had with standard form. From end-user perspective, in a previous form they just put disk size, in a new one - size and ID and Label and reservation -  much more info then before Smiley Happy --> they will complain about it. I don't like when people complain, do you, VMware? Smiley Happy

Reply
0 Kudos
sascha_milic
Hot Shot
Hot Shot

One working solution is to export the form & removing the unnecessary colums (including the default values) in the JSON/YAML file, then importing the changed file.

Yes - the Return Type Bug regarding the default value external source (vRO) chooser is really nasty and shows clearly that this functionality was never testet!

Much luck!

Reply
0 Kudos
agbiront
Contributor
Contributor

Sascha,

I've tried that but I can't get it to work.

I've removed all the columns but mountpoint, label and size. Also deleted the default values for the disk 0 (it's a cloned machine workflow). If I deploy a VM without adding any disks, it works fine. The Disk 0 (the cloned one) is generated as it should, getting the configuration from the blueprint.

If I add a new disk, that disk overwrites the configuration of the disk 0, and it fails. To solve this I added another column with the ID field to select and ID other than 0. That also creates issues... the disk 0 gets modified nonetheless (the storage reservation policy gets deleted), and the configuration of the new disk does not work (size is equal to the cloned disk, mountpoint is empty).

What am I missing?

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast

This is how our Data Disk Grid looks with five additional HDD:

pastedImage_0.png

As far as i remember from testing the "Is Clone", "User Created", "Volume ID" and "Capacity" are mandatory.

Is Clone -> Existing Disk(s) in Template

User Created -> New Disk(s)

Capacity -> Size in GiB

Volume ID -> SCSI Order

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos
agbiront
Contributor
Contributor

Yep, it looks similar to the original Disk Grid. I didn't want the user to change de SCSI ID, or the "Is Clone" or "User Created" values...

It's confusing for the end user. I wanted to only show the size, label and mountpoint...

Anyway, I guess I'll just use the standard grid and add some informational texts.

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast

Our Users do not see the DataGrid at all. I placed it in a new Tab and hide the Tab from the Users. The Grid Values are generated from a vRO Action based on Custom Form Fields and Custom Properties.

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos
MukeshIdnani
VMware Employee
VMware Employee

Hi Robert,

thanks for the workaround, I have follow up questions,

1. what value did enter for in_StorageReservation_Type/SubType & Tier input field? PFA screenshot of the storage disk.

   to my compute resources I haven't assigned storage policies

Picture1.png

2. What will be the value for the in_template_disks?

Thanks for your feedback.

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast

Hello!

The in_DC and in_StorageReservation_* Values are only used for the Storage Reservation Policy. I changed the Code a bit - now you only need the "in_template_disks" and the "in_diskX_size" parameters.

The "in_template_disks" Values depends on your base Template. If the Template has one Disk with 80 GB you set the Value to "80". If your Template has multiple Disks (for example four Disks with 80, 20, 10 and 30 GB) set the value to "80|20|10|30" - the "|" is the delimiter.

Robert

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos
YestoVI
VMware Employee
VMware Employee

I have implemented the steps as mentioned, but I don't see the grid getting populated. Any suggestions? I have the action returning an array of strings.

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast

Hello!

The Return Type must be Array/Properties.

Robert

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos
zzillman
Contributor
Contributor

Hi Robert,

I've been trying to follow your steps but I'm running into a issue where my ~storage field is read only, I don't have the option to set it to a computed value.  Did you have to change any thing to allow you to modify that field?  The one difference is I'm using vRA 7.5 and not 7.4, maybe they locked it down in 7.5.  Thanks.

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast

I just checked this in our 7.5 test environment and there is no "Value" and "Constrains" Tab anymore. Maybe the ~storage field is now updated out of the box?

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos
Lie_DW
Contributor
Contributor

I have the values tab but I can see the disk I added in my blueprint are nw added to the CSV as well.

Reply
0 Kudos