yangjianus
Contributor
Contributor

vRA 7.2 Pass custom property to Guest Agent

Hi,

I'm trying to pass some custom properties into guest agent in vRA 7.2.

I found it's very straightforward at first, based on this document. I put the following properties into a property group and assign to my test blueprint.

Vrm.DataCenter.Location = ABC

VirtualMachine.Admin.UseGuesetAgent = true

VirtualMachine.Customize.WaitComplete = true

VirtualMachine.Software0.Name = Download Test Script

VirtualMachine.Software0.ScriptPath = /bin/curl --output /tmp/test.sh http://xxx.xxx.xxx.xxx/test.sh

VirtualMachine.Software1.Name = Execute Test Script

VirtualMachine.Software1.ScriptPath = /tmp/test.sh {Vrm.DataCenter.Location}

The test.sh script is basically take input argument, put it into a temp file:

#!/bin/bash

/bin/echo $1 > /tmp/test.txt

After my request succeed, I checked /tmp/test.txt, the content is:

{Vrm.DataCenter.Location}

I was expect see ABC in the file.

Then I checked the workitem.xml file under /usr/share/gugent/site, the content is all lower case:

<property name="virtualmachine.software1.scriptpath" value="/tmp/test.sh {Vrm.DataCenter.Location}"/>

<property name="vrm.datacenter.location" value="ABC"/>

Then I changed the value of my argument for VirtualMachine.Software1.ScriptPath to:

VirtualMachine.Software1.ScriptPath = /tmp/test.sh {vrm.datacenter.location}

Then I got the lower case variable name in my file:

{Vrm.DataCenter.Location}

Is there anyone having the same issue? Or I am missing some step to turn on the elevator?

I have trying different thing, but none of them worked. I am stuck on this for a whole day now. Any feedback would be greatly appreciated!

2 Replies
darrenoid
Enthusiast
Enthusiast

That looks good to me. It may be a bug or perhaps we cannot use built in vra properties for the script variables? Try using your own custom property like dclocation=ABC to see if it works. If not I would open a support request with VMWare.

~ Darrenoid

yangjianus
Contributor
Contributor

Hi, darrenoid.

Based on your suggestion, I created a new custom property to test this, it works just fine. Then it turns out the reason I didn't get 'Vrm.DataCenter.Location' working is that I set it as dropdown, ABC is not a valid value for it. After I changed the value, it works fine.

Thank you!

0 Kudos