Perhaps you have been tasked with deploying a vCenter Server Appliance, and you are having trouble with the Client Integration Plugin. Maybe you’re just trying to deploy the VCSA into a lab environment, and you’d like a method that’s a little more hands off than using a wizard.

Look no further!

Now, I get it. Scripting can be scary. But it need not be. In fact, the VCSA ISO includes most of what you need to get a scripted install of the VCSA going.

I’ll walk you through it step-by-step.

Make sure all of the prerequisites have been met. That includes having a valid DNS entry for the VCSA, having the info on where you’ll be deploying it, etc. Mount the VCSA ISO on the machine you’ll be deploying the VCSA from. Browse to <Mounted Drive>:\vcsa-cli-installer\templates\install\. You should see some .json files that have helpful names like embedded_vCSA_on_ESXi, or PSC_on_ESXi or vCSA_on_ESXi. For our purposes, I’ll show you how to script the deployment of an Embedded VCSA, although it’s pretty easy to deploy with the other topologies too. Open embedded_vCSA_on_ESXi.json in your preferred text editor (Notepad is fine). Edit with your information in the following fields. Deployment.network (if applicable) Remember, the vCSA deploys to a Standard vSwitch. Deployment.option – Tiny, Small, Medium, Large are your options. Name – The display name in vSphere thin.disk.mode – I’d leave it as True, this deploys the VMDKs as thin-provisioned. “esxi” hostname – The FQDN or IP address of the ESXi Host on which to deploy the new appliance. username – Root or similar username with admin privileges on the ESXi Host. password – Password of the ESXi user. datastore – The storage location for the VCSA. Network hostname – The FQDN or IP of the appliance. Match what you’ve put in DNS. ip.family – Leave it as ipv4 unless you are using ipv6. mode – static or DHCP. ip – Enter the IP. dns.servers – Enter the DNS servers the VCSA will use. prefix – Calculate the prefix of the VCSA’s IP address and enter it here. gateway – Enter the gateway for the subnet. os password – This will be the appliance root password. ssh.enable – This setting enables SSH from the first power up. I’d leave it enabled here. sso password – This will be the password for the administrator@vsphere.local account. domain-name – vsphere.local by default, change it if you need to. site-name – The SSO site name.

{

“__version”: “1.2.0”,

“__comments”: “Sample template to deploy a vCenter Server Appliance with an embedded Platform Services Controller on an ESXi host.”,

“target.vcsa”: {

“appliance”: {

“deployment.network”: “VM Network”,

“deployment.option”: “small”,

“name”: “Embedded-vCenter-Server-Appliance”,

“thin.disk.mode”: true

},

“esxi”: {

“hostname”: “<FQDN or IP address of the ESXi host on which to deploy the new appliance>”,

“username”: “root”,

“password”: “<Password of the ESXi host root user>”,

“datastore”: “<ESXi host datastore>”

},

“network”: {

“hostname”: “<Optional. FQDN or IP address for the appliance. Remove this if using dhcp.>”,

“ip.family”: “ipv4”,

“mode”: “static”,

“ip”: “<Optional. Static IP address. Remove this if using dhcp.>”,

“dns.servers”: [

“<Optional. DNS Server IP Address. Remove this if using dhcp.>”

],

“prefix”: “<Optional. The value must be from 0 to 32. Remove this if using dhcp.>”,

“gateway”: “<Optional. Gateway IP address. Remove this if using dhcp.>”

},

“os”: {

“password”: “<Appliance root password; refer to –template-help for password policy>”,

“ssh.enable”: true

},

“sso”: {

“password”: “<vCenter Single Sign-On administrator password; refer to –template-help for password policy>”,

“domain-name”: “vsphere.local”,

“site-name”: “<vCenter Single Sign-On site name>”

}

}

}

5. Save the .json file somewhere to the machine from which you’ll be deploying the VCSA (I usually save it as C:\Temp\full_conf.json). Be sure to save it as .json, and not .txt or whatever the default extension of your text editor is.

6. Now you get to run a script that will run the installer and pull the config information from the json file. I’ve provided a script I cobbled together that will accomplish this purpose below:

# Deploy vCSA 6 using vCSA-Deploy – Written by vWebster.

# Pre-fill the appropriate .json template with the correct information and give it a unique name for each install. Save it locally, preferably to the C:\Temp directory. Be sure to update the subcommand following the installer variable. Update variables prior to running script.

# If installing VCSA from scratch, use install. If Upgrading, use Upgrade in place of Install. Refer to VMware documentation for more guidance. $Installer=”E:\vcsa-cli-installer\win32\vcsa-deploy.exe”

$updatedconfig=”C:\temp\full_conf.json” Invoke-Expression “$Installer install –accept-eula –no-esx-ssl-verify $updatedconfig”

Save the script. Give it a meaningful name like VCSA-PowerCLI-Install.ps1.

7. Launch PowerShell. CD to the directory where you saved the ps1 script. Run it and watch as the VCSA deploys via script. Or go grab coffee.

Enjoy!