VLC- Expansion Pack – VCF 3.9.1

The expansion pack feature in VLC can be used for a few things;
1) Building nested hosts
2) Expanding your nested VCF implementation!
3) Testing the limits of your hardware <- You know you want to!

In this post we’re going to talk about Building Nested Hosts and I’m sure you’ll be able to figure out how to do the other two things on your own, or I’ll write a blog article on it! Make sure you follow the implementation guide for VLC with regards to PowerCLI and OVFtool versions and settings.

Let’s stack up some more servers to be consumed by VCF or another project! To start with you’ll need VLC, an ESXi host or cluster and the ESXi ISO.

Chances are, if you’re reading this post you’ve already seen what VLC can do when building out a nested environment, but you may not know that it can churn out additional hosts as well. It all starts with the add_3_hosts.json file. You can use this as a template to build as many hosts as you’d like (I’ve tested up to 12 at a time at which point your Jump VM might get a little unstable) and you’ll find it in the VLC zip file. I’ve labeled each line in the first “Host array” in the file below. To add additional hosts you simply add the same array construct and put a comma after, unless it is the final host, in that case you omit the comma.

{
    "genVM": [
Host->{
  ^    "name": "esxi-10",          <- Hostname and VM Name
  |    "cpus": 4,                  <- # of "Cores" in the vCPU
  |    "mem": 16,                  <- Amount of Memory in GB
  |    "disks": "10,10,50,50,50",  <- Disks for the host
  |    "mgmtip": "10.0.0.110",     <- IP address for management
  |	   "subnetmask":"255.255.255.0", <- Subnet for management
  V	   "ipgw":"10.0.0.1"           <- Gateway for management
Host->}, <- Comma after all but the last host
      {
        "name": "esxi-11",
        "cpus": 4,
        "mem": 16,
        "disks": "10,10,50,50,50",
		"mgmtip": "10.0.0.111",
		"subnetmask":"255.255.255.0",
		"ipgw":"10.0.0.1"
      },
      {
        "name": "esxi-12",
        "cpus": 4,
        "mem": 16,
        "disks": "10,10,50,50,50",
		"mgmtip": "10.0.0.112",
		"subnetmask":"255.255.255.0",
		"ipgw":"10.0.0.1"
      } <- No Comma!
    ]
}

There are two entries that I think need a little explanation. The first is the “cpus” value, I note that this in the number of “Cores” in the vCPU. The way that VLC builds the VM, it only builds it with (1) CPU but as many cores as you put in. With the way lab licensing works for vExpert and VMUG Adv folks, it’s advantageous to minimize the CPU count. The other entry is the disks. In the template they are setup to make this a vSAN node. The first disk is always the OS (ESXi), the second is the caching drive, and all subsequent ones will be marked as capacity drives. If you want to build a host that will only consume NFS storage you would simply delete the last (4) values in the “disks” entry.
There are also some assumptions that are made, like the fact that you’ll always want 2 NIC’s in your hosts, or that SSH will be enabled. Those things could be changed in the code but are not offered as options at this time.

Once you have your JSON file set, the next step is to run VLCGui.ps1 and populate the UI with a few things;

  • The domain name (the hostname is specified in the JSON but to set the FQDN we’ll need the domain name).
  • The location of the add hosts JSON and ESXi ISO files
  • A password for the hosts
  • NTP and DNS Server IP’s to be set on the hosts
  • Your target vCenter or ESXi information
  • Optional: Prefix for the VM names, and All Flash hosts

Once you press the construct button things will start flying all over the place and before you know it you’ll have some shiny new nested hosts! While they are deploying it can be fun to watch the consoles.. the first time or two, after that just push the button and walk away.

In a nutshell the process looks like this. VLC first extracts all the files from the ESXi ISO. Then, the nested host VM’s are created and reconfigured “hardware” wise according to the specs provided in the JSON file. Then they are briefly powered on and off again to generate a MAC address.

The MAC addresses are collected and a case statement is built inside a kickstart file. This case statement matches against the MAC address to provide certain config elements (like IP address) to the nested host.
Next, VLC modifies the boot.cfg, adding the kickstart file as a kernel option.
After this the custom ISO is wrapped back up and uploaded to the datastore where it is attached to the newly created hosts.

Lastly, the hosts are booted up and configure themselves based on the kickstart file. The whole process generally takes about 6-8 minutes for 3 hosts with times slightly increasing for each host added.

After the build is complete your nested hosts are ready to be commissioned into VCF, or added to another vCenter, or cluster. Hope you enjoy this post, thank you for reading!