VMware Hands on Lab are impressive but what if we wanna create our own with different configuration ?
One day in my head born this idea. Create own HoL using vRealize Automation. As I had some idea how this should be looks like because I’ve create taska for students so I’ve start preparing Blueprint

Configuration
1 x Windows Jump Host
1 x Share with NFS share and two iSCSI target
1 x Clear VM for installation of ESXi
1 x VM with installed ESXi
1 x vCenter
Jump Host.
For Jump host I’m using blueprint standard clone option Windows Template with customization


Share
NSF Share in same way like Jump but on CentOS withou customization


ESXi
In deployment process of ESXi I’m using same method like for Jump and NFS but one VM is empty without OS configured, only Hardware and on second one has installed ESXi
vCenter
This was the hardest because I observed some “bug/issue/feature” when importing from OVA in vRealize my vCenter require 4TB of datastore so not possible to achieve in LAB. I’ve decide to make some workaround because I wanna have this VM also in blueprint with specific name and IP address.

Deployment
When each element was configured in blueprint the time has come for Customization.
All elements in blueprint has three custom properties
Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Requested Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvisioned
node_name

vCenter has additional one
VMware.VirtualCenter.OperatingSystem
and for all we have event subscription

ChN is configured in this way


while configuration

Change name procedure you can find here on my previous post and as documentation from vRO in attachments.
The ESXi configuration workflow look like this

the last element is most important for us because there is a changing Network configuration
var host = vmName.sdkConnection;
var guestOperationsManager = host.guestOperationsManager;
var guestAuth = new VcNamePasswordAuthentication();
guestAuth.username = "";
guestAuth.password = "";
var guestProgramSpec = new VcGuestProgramSpec();
guestProgramSpec.programPath = "/bin/esxcli";
guestProgramSpec.arguments = "network ip interface ipv4 set -i vmk0 -I "+IPAddress+" -N 255.255.255.0 -t static";
var processManager = guestOperationsManager.processManager;
result = processManager.startProgramInGuest(vmName , guestAuth , guestProgramSpec);
var guestProgramSpec = new VcGuestProgramSpec();
guestProgramSpec.programPath = "/bin/esxcfg-route";
guestProgramSpec.arguments = "192.168.100.1";
var processManager = guestOperationsManager.processManager;
result = processManager.startProgramInGuest(vmName , guestAuth , guestProgramSpec);
On the Share we also run some scripts

which you can see in Atachment
For vCenter as I told you need workaround the I’ve create this kind of workflow.
- I’m building clear VM from vRA
- Collect Payload – IP and Hostname
- Decom this VM
- Run External PS script to deploy vCenter from OVA

The external scrip which I’m using is from William Lam blog for deployment
The final element in this whole fun part is collect all VM name which you can do based on my previous article
TO-DO List
- Send email confirmation for user with IP and Hostname of newly created HOL
- Register vCenter Machine in vRA for decom purpose or create Decom workflow
- Simplyfy scripts