Deploy vCSA 6.5 with PowerShell!

I posted a while back on a scripted deployment of the vCenter Server Appliance 6.0. I found the scripted method where PowerShell is leveraged to execute a .json script to be superior to the GUI-based method of deploying the vCSA, especially if multiple vCSAs need to be deployed.

The method of deploying the vCSA 6.5 via PowerShell is a little different than the method of deploying the vCSA 6.0, in that the .json script is slightly different, and the PowerShell command is different as well. In my opinion, it’s been simplified a bit.

The  .json script is included in the ISO for the vCSA at E:\vcsa-cli-installer\templates. You can use the script from the relevant deployment type you’re going to do; you can browse to install, upgrade, or migrate templates. From there, you can also select between templates for the relevant vCenter topology you’re going to use. I’ve included the .json template for installing an embedded vCSA on ESXi below; you’d use this in a situation wherein you are either deploying a brand new vCSA in a greenfield deployment, or you are replacing an existing vCenter, but either can’t upgrade it, or don’t wish to.

Open the .json template in your preferred text editor. Start at “esxi” and add in your relevant configurations in the areas bracketed <> off.

Be sure that you’ve already completed the prerequisites of deploying the vCSA: The big one is having a DNS entry for the vCSA to resolve its IP into a FQDN and vice versa.

{
“__version”: “2.3.1”,
“__comments”: “Sample template to deploy a vCenter Server Appliance with an embedded Platform Services Controller on an ESXi host.”,
“new.vcsa”: {
“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. If left blank, or omitted, you will be prompted to enter it at the command console during template verification.>”,
“deployment.network”: “VM Network”,
“datastore”: “<A specific ESXi host datastore, or a specific datastore in a datastore cluster.>”
},
“appliance”: {
“thin.disk.mode”: true,
“deployment.option”: “small”,
“name”: “Embedded-vCenter-Server-Appliance”
},
“network”: {
“ip.family”: “ipv4”,
“mode”: “static”,
“ip”: “<Static IP address. Remove this if using dhcp.>”,
“dns.servers”: [
“<DNS Server IP Address. Remove this if using dhcp.>”
],
“prefix”: “<Network prefix length. Use only when the mode is ‘static’. Remove if the mode is ‘dhcp’. This is the number of bits set in the subnet mask; for instance, if the subnet mask is 255.255.255.0, there are 24 bits in the binary version of the subnet mask, so the prefix length is 24. If used, the values must be in the inclusive range of 0 to 32 for IPv4 and 0 to 128 for IPv6.>”,
“gateway”: “<Gateway IP address. Remove this if using dhcp.>”,
“system.name”: “<FQDN or IP address for the appliance. Remove this if using dhcp.>”
},
“os”: {
“password”: “<Appliance root password; refer to –template-help for password policy. If left blank, or omitted, you will be prompted to enter it at the command console during template verification.>”,
“ssh.enable”: false
},
“sso”: {
“password”: “<vCenter Single Sign-On administrator password; refer to –template-help for password policy. If left blank, or omitted, you will be prompted to enter it at the command console during template verification.>”,
“domain-name”: “vsphere.local”,
“site-name”: “<vCenter Single Sign-On site name>”
}
},
“ceip”: {
“description”: {
“__comments”: [
“++++VMware Customer Experience Improvement Program (CEIP)++++”,
“VMware’s Customer Experience Improvement Program (CEIP) “,
“provides VMware with information that enables VMware to “,
“improve its products and services, to fix problems, “,
“and to advise you on how best to deploy and use our “,
“products. As part of CEIP, VMware collects technical “,
“information about your organization’s use of VMware “,
“products and services on a regular basis in association “,
“with your organization’s VMware license key(s). This “,
“information does not personally identify any individual. “,
“”,
“Additional information regarding the data collected “,
“through CEIP and the purposes for which it is used by “,
“VMware is set forth in the Trust & Assurance Center at “,
http://www.vmware.com/trustvmware/ceip.html . If you “,
“prefer not to participate in VMware’s CEIP for this “,
“product, you should disable CEIP by setting “,
“‘ceip.enabled’: false. You may join or leave VMware’s “,
“CEIP for this product at any time. Please confirm your “,
“acknowledgement by passing in the parameter “,
“–acknowledge-ceip in the command line.”,
“++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++”
]
},
“settings”: {
“ceip.enabled”: true
}
}
}

Be sure to save the template to a location you can access, and save it as .json.

Then, with the ISO still mounted, launch PowerShell as admin, cd to <Install Drive>:\vcsa-cli-installer\<relevant OS> and run the following command:

.\vcsa-deploy.exe install –no-esx-ssl-verify –accept-eula –acknowledge-ceip “C:\Path\To\Your\vCSA.json”

PowerShell will deploy the vCSA and give you status updates as the rpm is deployed, as services are started, etc.

In all, like I said, this is a much easier way to deploy vCSA 6.5 than using the GUI. It’s also a good introduction to scripting.

 

Enjoy!

Leave a comment