VMware Cloud Community
Agryppa
Enthusiast
Enthusiast
Jump to solution

custom field and guest script

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

Reply
0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

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

Reply
0 Kudos
6 Replies
rwk1982
Enthusiast
Enthusiast
Jump to solution

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...
Reply
0 Kudos
Agryppa
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast
Jump to solution

For Example:

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

Drink coffee.. Do stupid things faster with more energy...
Reply
0 Kudos
rwk1982
Enthusiast
Enthusiast
Jump to solution

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...
Reply
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

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.

Reply
0 Kudos
Agryppa
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos