Convert Your linux VM Template to a Virtual Machine

First thing's first, the easiest way to call the vCAC agent is to bake it into a template that you clone other machines off of. To do this, you'll want to:

1. Go into vCenter2. Find your template3. Right click the template and choose "Convert to Virtual Machine"4. Power the machine on

Find the Right Agent Version

In your vCAC installation zip, there will be a folder called "LinuxGuestAgentPkgs" which holds all of the agents for major Linux distributions. Find the one that is appropriate for your Linux OS and copy the RPM file to the virtual machine you converted from a template in the steps above. I usually use WinSCP to copy over the files to the /tmp folder. If an RPM isn't available in the folder, use the TAR file, knowing that you'll have to decompress it once it's on the virtual machine.

Install the RPM

Install the RPM using the following format:{codecitation}rpm -i /YOUR_DIRECTORY/YOUR_AGENT_RPM{/codecitation}

Install the Agent

Run the following command to call the install script with the vCAC server fully qualified doamin name as a parameter:{codecitation}./installgugent.sh YOUR_VCAC_SERVER_FQDN:443 ssl{/codecitation}

Check the configuration file to confirm that the host is correct:{codecitation}cat rungugent.sh{/codecitation}

Configure Certificate for Agent

Make sure that you're in the /usr/share/gugent directory and run the following command to import the certificate into a cert.pem file:{codecitation}echo | openssl s_client –connect YOUR_VCAC_SERVER_FQDN:443 | sed –ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > cert.pem{/codecitation}*NOTE* if you're typing this, the character before "/-Begin" and after "-/p" is not a single quote, but a ` which is commonly found above the tilde key on an American English keyboard.

At the end you should have a cert.pem file in the /usr/share/gugent folder

Convert Your VM Back to a Template

In vSphere, power down the VM and then right click the virtual machine and go to template > convert to template

Depending on how long you took to do all of the things above, you may have to run an inventory scan inside vCAC to get the template to show up in your list of clone-able templates when creating a blueprint. Make sure that you use this template in your vCAC blueprint.

Build the Properties

You can do this step directly on a blueprint, or you can create a build profile so that the set of properties can be used on many blueprints.

Enter the following properties. descriptions of what should be entered are right after the property name:

VirtualMachine.Admin.UseGuestAgent - this should be set to "true" (without quotes) to tell the agent that you will be making calls to itVirtualMachine.Customize.WaitComplete - set this to be "true" (without quotes) to have vCAC wait for the scripts to finish before moving on down the rest of the life cycleVirtualMachine.Software0.Name - enter a friendly name for your script that you want to run. If you want to run more than one script, create new properties with sequential numbers (ex: VirtualMachine.Software0.Name, VirtualMachine.Software1.Name, etc).VirtualMachine.Software0.ScriptPath - enter the location and file name of the script that you want to run. If you want to run more than one script, create new properties with sequential numbers (ex: VirtualMachine.Software0.ScriptPath, VirtualMachine.Software1.ScriptPath, etc)

Passing Variables into Properties

If you want to pass a property into the ScriptPath property, or any of the other ones, you can do so by putting curly brackets around the property name that you want to call. An example would be that if I had a custom parameter named ScriptFile.Custom and I wanted to call it into the VirtualMachine.Software0.ScriptPath property, I could do so by setting the value to something like:

/tmp/script_repository/{ScriptFile.Custom}

You can see I've done this in the last screen shot with the repo.path property