Tuesday, May 6, 2014

Deploy Hyperic Agents using vCenter Configuration Manager (vCM)

With the vC Ops Suite 5.8 you can now push Hyperic agent installations from  Infrastructure Navigator for all virtual machines (Windows/Linux), but if you need to push the Hyperic agent to physical servers then you can use vCM.  

This will require to update the zip files for both x64 and x86 install files to include the agent.properties and if you're encrypting the password you will also need to include agent.scu.  In this case I've taken the agent.properties and agent.scu from a previous installation and included them in the zip files.

Here's example preferences for configuring for auto-install of the Hyperic Agent:

x:\[install-path]\hyperic-hqee-agent-5.8.0\conf\agent.properties

[PREFS]
agent.setup.camIP=192.168.100.29
agent.setup.camPort=7080
agent.setup.camSSLPort=7443
agent.setup.camLogin=hqadmin
agent.setup.camPword=ENC(xtL6TawA/dqnXVvj6Rl5LZWjqnfkmkEB)
agent.setup.unidirectional=No
agent.setup.camSecure=Yes
Once the zip files are updated with the agent.properties and agent.scu, copy those files to the cmfiles$\Remote_Command_Files share or x:\Program Files (x86)\VMware\VCM\WebConsole\L1033\Files\Remote_Command_Files

In order to unzip the files I used 7-zip command line Version to do this.  You can download the executable below and make sure to copy it to the same path above:



Now it's time to create the remote commands in vCM.  The screenshot below shows to remote commands one for x64 and x86 systems.  I've also created a Hyperic Agent folder to keep it separated from other remote commands.


Here's the VBscript to include in the remote command:

Note: Some modifications may need to be made based on the version of Hyperic you are installing (in this case we are installing 5.8.0) and the destination of the agent (c:\Hyperic-Agent\)

Sub DoWork()
On Error Resume Next
'***Hyperic 5.8 x64 Installation***
'Name of Hyperic Agent Zip Install File:
strFilename = "hyperic-hq-agent-x86-64-win-5.8.0.zip"
'Destination to zip to:
strDest = "C:\Hyperic-Agent\"

'***Do not modify below this line***
strFolder = "hyperic-hq-agent-5.8.0"

 Err.Clear
 '********************
 ' Extract HQ Agent
 '********************
 szCMD = chr(34) & EcmAgtContext.JobDownloadDirectory & "\7za.exe x" & chr(34) & " " & strFilename & " -o" & strDest
 EcmScriptRuntime.CmdExecute szCMD, 3600

 '********************
 ' Setup HQ Agent
 '********************
 szCMD = strDest & strFolder & "\bin\hq-agent.bat install"
 EcmScriptRuntime.CmdExecute szCMD, 3600

 szCMD = strDest & strFolder & "\bin\hq-agent.bat start"
 EcmScriptRuntime.CmdExecute szCMD, 3600


 '********************
 ' Clean Downloads Dir
 '********************
 Set objFSO = CreateObject("Scripting.FileSystemObject")
 objFSO.DeleteFolder EcmAgtContext.JobDownloadDirectory
End Sub 

To create the remote command click on the Add button

Give it a name and click next


Copy the VBScript above with your modifications to the Command Text Box and also make sure to click the Check Box


Select the 7za.exe file to unzip the agent files and the appropriate Hyperic Agent zip file for x86 or x64.  When the remote command is executed on a machine it will copy these files to the vCM agent Job Downloads folder to be executed.


Last click finish to create the new Remote Command.

Follow the same steps for creating x86 remote command if this is a requirement.

VBScript for installing Hyperic x86 agent:

Sub DoWork()
On Error Resume Next
'***Hyperic 5.8 x86 Installation***
'Name of Hyperic Agent Zip Install File:
strFilename = "hyperic-hq-agent-win32-5.8.0.zip"
'Destination to zip to:
strDest = "E:\Hyperic-Agent"

'***Do not modify below this line***
strFolder = "hyperic-hqee-agent-5.8.0"

 Err.Clear
 '********************
 ' Extract HQ Agent
 '********************
 szCMD = chr(34) & EcmAgtContext.JobDownloadDirectory & "\7za.exe x" & chr(34) & " " & strFilename & " -o" & strDest
 EcmScriptRuntime.CmdExecute szCMD, 3600

 '********************
 ' Setup HQ Agent
 '********************
 szCMD = strDest & strFolder & "\bin\hq-agent.bat install"
 EcmScriptRuntime.CmdExecute szCMD, 3600

 szCMD = strDest & strFolder & "\bin\hq-agent.bat start"
 EcmScriptRuntime.CmdExecute szCMD, 3600


 '********************
 ' Clean Downloads Dir
 '********************
 Set objFSO = CreateObject("Scripting.FileSystemObject")
 objFSO.DeleteFolder EcmAgtContext.JobDownloadDirectory
End Sub 


Next steps are to select the machines you want to deploy for x64 or x86 (you can use dynamic machine groups or the column grouping option in the Machines Datagrid to filter the machine types).  Once the remote command is finished running verify in the Hyperic UI that the machines have checked in and are ready for auto-discovery.

Monday, July 29, 2013

vFabric Application Director - Configure Linux Agent Bootstrap

How to install the Application director bootstrap agent and communicate with the vCAC server for provisioning application blueprints.

For documentation purposes I will demonstrate how to configure CentOS 5.6 x64 VM to deploy AppD blueprints using vCAC to provision the VM.

VM Requirements:
-Make sure the operating system (in this case we are doing Linux) you are using either RHEL 6.1 or CentOS 5.6 32 or 64 bit.
-JRE 1.6.0 which can be downloaded from the Application Director Appliance - http://App-director-IP:8443/agent/jre-6u6u31-linux-amd64.rpm
-Linux agent bootstrap service for vcac can be downloaded from application director appliance - http://App-director-IP:8443/agent/vmware-appdirector-agent-service-vcac_5.2.0.0-0_x86_64.rpm
-Linux vCAC guest agent, which can be obtained from the vCAC 5.2 installation zip file.

To help simplify this process you can download CentOS 5.6 x64 from VMware vFabric Application Director download site - https://my.vmware.com/web/vmware/details?downloadGroup=VFAPPDIR_520_GA&productId=345&rPId=3789
Here you will find various supporting operating systems (with the exception of MS Windows) you can download and configure to use with vCAC and Application Director.

  1. If you haven't already convert the template back to a VM.
  2. Power on the VM
  3. You may have to configure the VM with an IP either static or DHCP, so we can get some install files on the server.  If that's the case use the Configure Network option to accomplish this.
  4. If needed update the VMware tools.
  5. Once you have an IP you can either login with the console or use another SSH tool to access the command line.  If you downloaded the OS from VMware use root/vmware to login.
  6. Copy the files needed to the VM to the /tmp folder.  We will need to copy the vCAC agent and the Application Director vCAC bootstrap agent.
  7. First make sure the existing bootstrap agent is not installed and running using "ps -ef | grep agent_bootstrap" If it doesn't exist go to step 11
  8. If so stop the process
  9. Run this command to remove the agent bootstrap service - "/opt/vmware-appdirector/agent-bootstrap/agent_reset.sh"
  10. Uninstall the agent bootstrap - rpm --erase vmware-appdirector-agent-service
  11. Install the vCAC guest agent from the tmp directory - rpm -i gugent-5.2.3-349.x86_64.rpm (version may vary make sure to verify the file name first).
  12. Configure the vCAC guest agent by changing directories to /usr/share/gugent - run "./instalgugent.sh YOUR_VCAC_SERVER_FQDN:443 ssl"
  13. Next configure the certificate for the agent if you're using SSL in vCAC - "echo | openssl s_client –connect YOUR_VCAC_SERVER_FQDN:443 | sed –ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > cert.pem"
  14. Verify the cert.pem has a file size greater than 0.  If that's the case make sure this VM can connect to your vCAC server by pinging the FQDN of vCAC server.
  15. Now install the Application Director vCAC from the /tmp directory - "rpm -i vmware-appdirector-agent-service-vcac_5.2.0.0-0_x86_64.rpm"
  16. Register the Application Director vCAC guest agent with the vCAC server "/opt/vmware-appdirector/agent-bootstrap/vcac-register.sh -r 443 -s vCAC-Server-IP
  17. Verify the vCAC vrm-agent and vmware_appdirector_agent are installed by running "chkconfig --list" to display the list of services installed.
  18. NOTE:  This may not apply to all environments, but for this in my case to get CentOS 5.6 to work with Customization Specifications to work with my VM template I had to delete this file in order to work - /etc/sysconfig/network-scripts/ifcfg-eth0.  Also changing the VM Guest OS to RHEL 5.  More info here - http://www.virtualtothecore.com/en/?p=4163
  19. Last step is to reset the Application Director agent by running /opt/vmware-appdirector/agent-bootstrap/agent_reset.sh.
  20. Shutdown the VM and convert back to a template.
  21. Now you're ready to create the vCAC blueprint and configure Application Director to use vCAC as a cloud provider to provision.  Look for another article on how to create a vCAC blueprint for Application Director and how to configure Application Director to use vCAC to provision VM's.


Reference:
http://pubs.vmware.com/appdirector-5.2/index.jsp#com.vmware.appdirector5.2.using.doc/GUID-659B901A-0071-43E5-9FBE-D1BB4EA8725F.html

Tuesday, July 10, 2012

vC Ops 5.0.2 New Features

vC Ops 5.0.2 was released Friday and one of my favorite dashboards I typically create uses the Mashup Chart Widget to show the health of an application grouping or any resource kind.  With the new release we have added the ability to include vSphere change events and vCM (vCenter Configuration Manager) change events to the health of an application to correlate any changes or alerts to the health of the application or resource.

The Mashup Chart includes a health chart, an anomaly count graph, and metric graphs.  This shows active and inactive alerts along with change events from vCenter and vCM relating to the health of the resource.
How to add Change Events to the Mashup Chart

Another new interesting widget is the Text Widget.  This can basically show information in text or HTML format.  Some examples would have a MOTD (Message of the Day) or outage information that can be linked to a URL or html file that exists on the vC Ops UI VM.

Text Widget example pointing to an HTML file displaying current outage information within a vC Ops dashboard
For more information about vC Ops 5.0.2 and see what else is new check out the release notes at - https://www.vmware.com/support/vcops/doc/vcops-502-release-notes.html

Next topic will be how to create Application Groups and incorporate dashboards to view the health of the Application Groups.