VMware Cloud Community
improvingdaily
Enthusiast
Enthusiast
Jump to solution

Dynamic Input for VM Disk to Datastore

I am trying to develop a workflow I can use to migrate a VM.  The issue I run into is how I handle the disk drives.  The number of drives I have on any VM is dynamic but I need to be able to present the drives on a particular vm and specify a datastore each drive will be migrated to when I run the workflow.  I know how to build the migration piece.  I just don't know how to present the drives in a manner that is completely dynamic and give me the ability to link the drive with a new datastore.  Any ideas?

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Well, vRO presentations do not allow dynamic creation of input fields, but here are some possible workarounds that comes in mind:

1) If there is an upper limit of number of drives, you can create presentation fields for the maximum possible number of drives/datastores, make most of them hidden, and then dynamically show the fields for the actual drives/datastores.

2) You can put the list of your drives in an attribute of type Array/something, and then create a workflow with a loop that will iterate over this list, and then in each iteration it will display an user interaction displaying the next drive from the list and asking the user to choose a datastore for this drive.

View solution in original post

0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Well, vRO presentations do not allow dynamic creation of input fields, but here are some possible workarounds that comes in mind:

1) If there is an upper limit of number of drives, you can create presentation fields for the maximum possible number of drives/datastores, make most of them hidden, and then dynamically show the fields for the actual drives/datastores.

2) You can put the list of your drives in an attribute of type Array/something, and then create a workflow with a loop that will iterate over this list, and then in each iteration it will display an user interaction displaying the next drive from the list and asking the user to choose a datastore for this drive.

0 Kudos
improvingdaily
Enthusiast
Enthusiast
Jump to solution

I had thought about the first option you mentioned but not the second one.  The second option might be better otherwise I would potentially have to create a hundred inputs.  Thanks

0 Kudos