• Skip to primary navigation
  • Skip to content

Open902.com

My own Knowledge Base made public ..

  • Home
  • vRealize Automation 7
    • vRA & vRB 7.2
      • Installation
        • vRA 7.2 – Installation
        • vRA 7.2 – Unattended Enterprise Install
        • vRA 7.2 – Unattended Install Answer File Generator
        • vRB 7.2 – Installation
      • Configuration
        • vRA 7.2 – Initial Configuration
        • vRA 7.2 – Endpoints and AD Integration
        • vRA 7.2 – Fabric and Business Groups
        • vRA 7.2 – Reservations, Reservation Policies and Network Profiles
        • vRA 7.2 – Blueprints and Entitlements
        • vRA 7.2 – Email Config and Approval Policies
      • Advanced Configuration
        • vRA 7.2 – Guest Agent and Software Components
        • vRA 7.2 – Custom Property RegEx
        • vRA 7.2 – Make IP in Network Profile unavailable for deployments
      • Integrations
        • vRA 7.2 – Azure Integration
        • vRA 7.2 – vRB 7.2 Configuration
        • vRB Cloud without vRA by using vIDM
    • vRA 7.0 & 7.1
      • Installation & Configuration
        • vRealize Automation 7 – Simple install
        • vRealize Automation 7 – Enterprise install
        • Upgrade vRealize Automation 7.0 to 7.0.1
        • vRA7 – Initial Configuration
        • vRA7 – Endpoint
        • vRA7 – Business Groups
        • vRA7 – AD Integration
        • vRA7 – Fabric Group
        • vRA7 – Network Profile
        • vRA7 – Reservations
        • vRA7 – IaaS Blueprint
        • vRA7 – Mail and Approvals
      • Advanced Configuration
        • vRA7 – Customize Hostname, VLAN and IP during deployment
        • vRA7 – Custom Property Relationships using Actions
        • vRA7 – vRealize Orchestrator 7
        • vRA7 – VAMI Certificate
        • vRA7 – Gugent on Linux
        • vRA7 – Gugent on Windows
        • vRA7 – Import Unmanaged Virtual Machines from vSphere
      • Integrations
        • vRA7 – NSX 6 Integration
        • Ubiquiti EdgeRouter X, NSX and vRealize Automation in network kinda harmony
        • vRA7 – vRealize Business Standard
        • vRealize Business for Cloud – Change Time zone
        • vRB Cloud without vRA by using vIDM
      • Troubleshooting
        • vRA7 – Delete stuck ‘In Progress’ Deployments
        • vRA 7 – Remove Stuck Approval Process
        • Remove Orphaned Network Profiles
        • vRA7 – Remove Stuck or Orphaned Managed Machines
  • vRA / vCAC 6
    • Installation
      • 1. Requirements
      • 2. Identity Appliance
      • 3. vCAC Appliance
      • 4. IaaS Server
    • Configuration
      • 5. Add a Tenant
      • 6. Agents & Endpoints
      • 7. Resource Allocations
      • 8. Blueprints
      • 9. Services & Catalogs
      • 10. Entitlements & Test
    • Advanced Configuration
      • Enable vCenter Orchestrator in vCAC
      • Configure External vCenter Orchestrator for vCAC
      • vCAC – Create Active Directory Endpoint & Test
      • vCAC – Refresh Inventory
      • vCAC – SMTP Settings
  • NSX
    • Ubiquiti EdgeRouter X, NSX and vRA7 Configuration
    • NSX 6 Integration into vRA7
    • NSX Authentication in Web Client using Sub-Domain users
  • vCloud Director 8.x
    • Install vCloud Director 8.0 for SP
    • NSX 6.2 for vCloud Director 8.0 SP
    • Configure vCloud Director 8.0 for SP – PVDC
    • Configure vCloud Director 8.0 for SP – Organization
    • vCloud Director 8.0 with NSX 6.2 – Final Testing
  • vCloud Director 5.x
    • 1. Installation of vCD 5.5
    • 2. vShield Manager
    • 3. VXLAN Configuration
    • 4. Initial vCloud Config
    • 5. Create a Provider vDC
    • 6.External Network
    • 7. Organization VDC
    • 8. vShield Edge & Organization Network
    • 9. Final Testing
    • 10. Installing an additional vCloud cell
    • Upgrade 1.5 > 5.5
      • 1. vCloud Director Binaries
      • 2. vShield Manager
      • 3. Final Touches
  • Lego NUC vSAN Cluster
  • Vembu
  • About Me

vRealize Automation 7.2 – Guest Agent and Software Components

First we need to install the Guest Agent in our templates. Here I am just going through the Windows one. For Linux, please see my previous article : vRealize Automation 7 – Guest Agent.

Also for some strange reason, Linux always seem to be working whilst Windows is .. temperamental.

Guest Agent

First browse to the vRA appliance – specifically the software page

https://vra.open902.com/software/

open920-0308

Note: Download the Windows Guest Agent Files appropriate for the architecture of your server. This only applies if you ONLY intend to use the Guest Agent.

If you intend to use Software Components as well then please scroll down to the Software Components and use the Powershell script to prepare the template instead.

I want to keep the footprint as small as possible and therefore only install what is needed.

So here, for the sake of completeness – the Guest Agent only.

Running the .exe will just extract the packages to VRMGuestAgent

open920-0309

Move the folder to C:\

Open up a command prompt and navigate to the folder

open920-0311

Now install the service. Point it to the Manager Service – here I only got one IaaS server anyway.

WinService.exe -i -h iaas.open902.com:443 -p ssl

open920-0312

The above will not pull the appropriate IaaS certificate needed for secure communication.

Using the .pem file created during the installation process, copy it as cert.pem into the installation folder

open920-0313

If you don’t have a .pem – check out the article HERE – it describes how to download the certificate from the IaaS and convert it properly.

Now start the service

open920-0314

Once started …

open920-0316

.. check the logs

C:\VRMGuestAgent\axis2\logs\gugent-axis.log

Make sure you don’t see any errors but rather that the certificate was specified (something along those lines)

[Thu Nov 24 10:32:17 2016] [info] Starting addressing out handler
[Thu Nov 24 10:32:17 2016] [debug] ..\..\src\modules\mod_addr\addr_out_handler.c(133) No action present. Stop processing addressing
[Thu Nov 24 10:32:17 2016] [debug] ..\..\src\core\transport\http\sender\http_transport_sender.c(246) ctx_epr:https://iaas.open902.com:443/VMPS2
[Thu Nov 24 10:32:17 2016] [debug] ..\..\src\core\transport\http\sender\http_transport_sender.c(805) using axis2 native http sender.
[Thu Nov 24 10:32:17 2016] [debug] ..\..\src\core\transport\http\sender\http_sender.c(416) msg_ctx_id:urn:uuid:b4c47fa3-5689-4fa2-bc3d-08f2a7e94bed
[Thu Nov 24 10:32:17 2016] [info] [ssl client] Client certificate chain filenot specified
[Thu Nov 24 10:32:17 2016] [debug] ..\..\src\core\transport\http\sender\http_transport_sender.c(822) OP name axutil_qname_get_localpart = http://www.w3.org/2004/08/wsdl/out-in
[Thu Nov 24 10:32:17 2016] [debug] ..\..\axiom\src\soap\soap_builder.c(930) Identified soap version is soap11
[Thu Nov 24 10:32:17 2016] [debug] ..\..\src\core\engine\phase.c(210) Invoke the handler request_uri_based_dispatcher within the phase Transport
[Thu Nov 24 10:32:17 2016] [debug] ..\..\src\core\engine\phase.c(210) Invoke the handler AddressingInHandler within the phase Transport

Also make sure the following logfile doesn’t have any errors

C:\VRMGuestAgent\GuestAgent.log

Again, you should not see any errors but a clean communication. The fact there isn’t a workitem means that essentially no install has been initiated by vRA

2016-11-24 10:35:49 Application: [Debug] Uninitializing subsystem: Logging Subsystem
2016-11-24 10:36:19 Application.MachineQuery: [Information] uuid = 9ed30742-2c69-a396-b004-cee2eeb5ef5a
2016-11-24 10:36:19 Application: [Information] Using the network enabled proxy ...
2016-11-24 10:36:19 Application: [Information] The vCAC endpoint is https://iaas.open902.com:443/VMPS2.
2016-11-24 10:36:19 Application: [Information] The AXIS2C directory is axis2/.
2016-11-24 10:36:19 Application: [Information] Requesting work for agent ID 4207d39e-692c-96a3-b004-cee2eeb5ef5a.
2016-11-24 10:36:19 Application: [Information] Fetching a work item ...
2016-11-24 10:36:19 Application.Proxy: [Information] 
2016-11-24 10:36:19 Application.Proxy: [Information] No workitem currently available

So what is it good for ?

The Guestagent is used to customise the operating system after deployment.

This is not to be confused by the customization done by vCenter as part of the deployment.

The agent gives you the option to execute scripts – Powershell – Batch – Shell – anything really. The agent merely passes the commands from vRA through to the agent and executes them locally.

Let’s test it.

Here I created a simple script which puts the current date and time into a text file

date /T > c:\date.txt
time /T >> c:\date.txt

Here an example when executed manually

open920-0317

Now shut the server down and prepare it for vRA. In my case I am using Linked Clones. So I will create a new Snapshot which I will be using in my Blueprint

open920-0318

Now re-run the Data Collection of your vCenter Resources to ensure vRA knows about the new Snapshot

open920-0319

If you are unsure how to create a Blueprint and Entitle it – see my previous article

vRealize Automation 7.2 – Blueprints and Entitlements

In order to utilise the guest agent we need to create a couple of Custom Properties.

  • VirtualMachine.Customize.WaitComplete
    • Set to True to prevent the provisioning workflow from sending work items to the guest agent until all customizations are complete
  • VirtualMachine.Software0.Name
    • Specifies the descriptive name of a software application
  • VirtualMachine.Admin.UseGuestAgent
    • If the guest agent is installed as a service on a template for cloning, set to True on the machine blueprint to enable the guest agent service on machines cloned from that template
  • VirtualMachine.Software0.ScriptPath
    • Specifies the full path to an application’s install script

Reference:

http://pubs.vmware.com/vrealize-automation-72/topic/com.vmware.ICbase/PDF/vrealize-automation-72-custom-properties.pdf

Rather than adding all the properties to every single Blueprint you want to utilise the script, create a Property Group

Example:

open920-0320

Now create a Blueprint

Here making sure I select a template / snapshot with the Gugent installed

open920-0353

Apart from the network of course, ensure you add the newly created Property Group

open920-0354

I will also add another Custom Property – Hostname – this allows me to specify a custom hostname – rather than using the pre-configured prefix.

open920-0355
Note: The VM MUST have network access (DNS is important !!) to the IaaS Manager Service. If the VM doesn’t have access to the VM, you will likely end up with a stale deployment. Whether or not it times out seems to be random – at least in my lab.

It needs more testing but it seems similar to previous vRA 7.x releases. If this happens to you – see my previous article in how to delete those state deployments. You can find the article HERE.

Pay special attention to the following comment as this is an easier procedure than described in my article:

open920-0362

Anyway, when requested, I can now enter a custom hostname

open920-0356

Now wait for the deployment to finish

open920-0357

Once finished you should be able to see that the script was executed and shows the time pretty close to the finished deployment

open920-0360

Software Components

Software Components are different and have a few more requirements.

If you intend to use Application Components then you need in addition to the Gugent also the Software Agent and Java.

From your template browse again to

https://vra.open902.com/software/

Download the Powershell script. No need to download the Guest Agent, the script will do this for you (and downloads the certificates required).

prepare_vra_template.ps1

open920-0382

Open a Powershell prompt and navigate to the location of the script and execute it using the below command.

Please Note: The Software page is missing the full path. If the command is executed without the full path, it is likely to fail.

PowerShell -NoProfile -ExecutionPolicy Bypass -Command c:\prepare_vra_template.ps1

Enter the FQDN / IP of your vRA appliance, Manager Service Server (IaaS) and the account the Management Agent runs under. Whether or not you use local or domain accounts obviously depend whether your deployed VM will be in the domain once done 🙂

open920-0388

Ensure the install completes successfully – shut down the template as instructed

open920-0389

Note: If you are using Full clones in vRA, prepare the server as template. If you are using Linked Clones, create a new Snapshot and run another data collection of the Compute Resources

Now back to vRA.

Browse to Software Components

First, here is the example – using Powershell throwing the bios information a text file

# List Bios Info into bios.log

param( [string]$strComputer = "." )

$colItems = get-wmiobject -class "Win32_BIOS" -namespace "root\CIMV2" -computername $strComputer | Out-File c:\bios.log

foreach ($objItem in $colItems) {
write-host "Name :" $objItem.Name
write-host "Version :" $objItem.Version
write-host "Manufacturer :" $objItem.Manufacturer
write-host "SMBIOSBIOS Version :" $objItem.SMBIOSBIOSVersion
}

Which will output the follwing into a text file called bios.log

SMBIOSBIOSVersion : 6.00
Manufacturer : Phoenix Technologies LTD
Name : PhoenixBIOS 4.0 Release 6.0
SerialNumber : VMware-42 07 2a 4e 9e dd 0f 9c-c0 2c b6 32 77 c3 5a 31
Version : INTEL - 6040000

Let’s do it.

Click New

open920-0361

Give it a Name

open920-0395

I don’t need to specify any properties for this simple script so I will skip it.

You could use a property for example to have the path (here c:\bios.log) made available during the request with the ability to change it.

But here, I just want a simple example so I won’t use any at this stage.

open920-0396

Here select powershell and Click here to edit.

open920-0397

Now paste the sample code and click OK > Finish

open920-0398

Make sure you Publish the Software Component

open920-0399

Now click Software Components. Select the newly created component BiosInfo and drag it onto the Virtual Machine

open920-0400

Now deploy the VM and wait for the deployment to finish

open920-0404

Apart from the obvious success, the existence of the Bios.log file we created …

open920-0407

… you can also confirm the success in the log file

C:\VRMGuestAgent\GuestAgent.log
2016-11-25 15:03:42 Application: [Information] Executing '10_finalize_noop.bat' ...
2016-11-25 15:03:42 Application: [Information] Wait for completion of '10_finalize_noop.bat'
2016-11-25 15:03:42 Application: [Information] Successfully sent the work item response for id=b1a9d74e-fa7a-4b05-b503-30d1eda6120e
2016-11-25 15:03:42 Application: [Information] c:\VRMGuestAgent\config.xml
2016-11-25 15:03:42 Application: [Information] found termination node
2016-11-25 15:03:42 Application: [Debug] Uninitializing subsystem: Logging Subsystem

If you don’t want to create your own Application Blueprints, have a look at VMware’s Solution Exchange, you can there download ready prepared blueprints, such as Microsoft SQL 2014.

Happy scripting 🙂

Copyright © 2019 · Genesis Sample on Genesis Framework · WordPress · Log in