Enthusiast
Enthusiast

custom field and guest script

Jump to solution

Hello,

I have a question, I need to run a script inside the machine with the parameter given by the user in the field, can you guide me to the right path (vRA 7.3)?

Regards,

Piotr

0 Kudos
1 Solution

Accepted Solutions
Immortal
Immortal

The simplest way is if you're using vRA Enterprise. Create a software component that has your script. Create a property which is a variable in that script. Create a custom property and show on the request form. In the blueprint containing this software component, bind the custom property to the software component's property. When the script runs, it'll inherit the value specified in the custom property. Done.

View solution in original post

0 Kudos
6 Replies
Enthusiast
Enthusiast

Hello Piotr!

You can use a Event Subscription at the POST state of VMPSMasterWorkflow32.MachineProvisioned and start the vRO Workflow "Run Program in Guest". The Workflow needs an OS User in the VM to run. Or you install the vRA Gugent Agent in the Template (https://open902.com/vra7-gugent-on-windows/).

Regards,

Robert

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

Hi Robert,

It's the easier part (gugent) Smiley Happy

How to pass a parameter to such a script provided by the user in the vm deploy form (/path/script parameter)?

Regards,

Piotr

0 Kudos
Enthusiast
Enthusiast

For Example:

VirtualMachine.Software0.ScriptPath -> c:\scripts\runme.bat {this.is.my.custom.property}

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

or... you can parse the "c:\VRMGuestAgent\site\workitem.xml" - the agent saves all properties to this xml file.

Drink coffee.. Do stupid things faster with more energy...
0 Kudos
Immortal
Immortal

The simplest way is if you're using vRA Enterprise. Create a software component that has your script. Create a property which is a variable in that script. Create a custom property and show on the request form. In the blueprint containing this software component, bind the custom property to the software component's property. When the script runs, it'll inherit the value specified in the custom property. Done.

View solution in original post

0 Kudos
Enthusiast
Enthusiast

The solution works very well 🙂

I also helped:http://www.vmtocloud.com/how-to-use-drop-down-lists-with-vra-software-components/

Thank you, colleagues!

Piotr

0 Kudos