Template management 101

So what does vRealize really utilize for automation. Well in 7.4(I believe) things got a lot easier with their guest agent. Utilizing the agent page from the appliance will now show an actual PowerShell or bash command for installing the agent(pretty awesome).

Here is the thing. Though the automated installer will remove the already installed guest agent, it doesn’t do it very cleanly. So some old commands are still very useful.

Goal of this blog:

Template management is key for success. Especially when running multiple vRA instances across the US and abroad. Making sure the template is pointed to the proper appliance(or VIP for HA), and IAAS Manager(Or VIP for HA) is CRUCIAL. Without the proper setup you will probably run into timeouts or issues with your deployments and the “customization”. If you’ve worked with vRealize you know how annoying the “Error during customization” message can be.


(Solution for removal pulled from Jim Griffiths @ http://itsgettingcloudy.blogspot.com/  Hes a great blogger with some good stuff, so check him out! )

Here are the steps to uninstall it;

From a command prompt on the machine which has the agent installed, type;
net stop vcacguestagentservice
sc delete vcacguestagentservice

If you do not want to install the vRAS\vCAD agent after this, then you can use the below command to remove the folder;
rmdir c:\vrmguestagent /s /q

I suggest running all three commands before installing the agent again.

Steps to run the installation of the gugent agent

  1. Download the gugent agent off your primary vRA appliance(if HA this can be any appliance).download guest agent1download guest agent2
  2. Move the .zip to the Machine that will be templatized.
  3. Extract the folder. There will be a folder within the extracted folder. I hate that so i just move the final folder to a c:\temp directory normally.
    1. Now open an command prompt runas admin and run PowerShell -NoProfile -ExecutionPolicy Bypass -Command C:\temp\**FOLDERNAME**\prepare_vra_template.ps1(if your like me and put it in c:\temp. **FOLDERNAME** is what vRA names the folder or if you rename it(default is currently prepare_vra_template_windows)*NOTE* To me this is the cleanest install, but for those that prefer .bat files…
    2. You can also run this by simply opening the prepare_vra_template_windows folder and running prepare_vra_template.bat as Administrator.
    3. Both of these solutions will get you a prompt asking for additional information
  4. First it will ask for you FQDN/Ip for the vRA Appliance(VIP if HA). *I find that if your using multiple domains the IP is better than the FQDN so DNS doesn’t bite you in the butt. However, If you didn’t put the IP in the appliance certificate(and shame on you if you did). This will not function properly.*download guest agent3
  5. It should find the appliance if the template can hit it and pull the certificate. Type “Yes” if the SHA1 matches(and if you really want to check that)
  6. Next is the manager. So type in the FQDN/Ip for the vRA IAAS Manager(VIP if HA)*I find that if your using multiple domains the IP is better than the FQDN so DNS doesn’t bite you in the butt. However, If you didn’t put the IP in the appliance certificate(and shame on you if you did). This will not work.*download guest agent4
  7. The rest is dependant on how your setting up the agent and where the template is (EC2, vsphere, etc) and the account you want to use on the machine for administration(local, or domain).download guest agent5
  8. After all information is completed the install will run and when complete, you should see a message that states “INSTALL COMPLETE Ready for shutdown”(or something like that…). Dont shut it down yet..
  9. Here is when your run your sdelete, or whatever cleanup solution you have(dont forget to delete the agent install!! )
  10. Now shut it down…

The GuestAgent log should now show proper calls, and responses including the full payload when the template is deployed. Pretty cool stuff…

Now never touch the template again…


One response to “Template management 101”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: