VMware vCenter 7.0.3d CLI

VMware vCenter Server 7.0 Update 3d – How to Install Using the CLI

In this article I will demonstrate an unattended installation of vCenter Server 7.0 Update 3d.

To follow along you will need:

  • installation ISO for vCenter Server 7.0 Update 3d, which you can download from your My.VMware account: VMware-VCSA-all-7.0.3-19480866.iso
  • a text editor. I used Microsoft Visual Studio Code, but you can really use any text editor.
  • the ability to run CLI commands. I used a Windows server to launch the command, but VMware also provides binaries for Linux and Mac.

Prepare the JSON Configuration File

VMware provides a number of JSON template files, so we don’t have to start from scratch. Inside the ISO file, we can navigate to vcsa-cli-installer\templates\install to see the available templates. There are 5 templates, among them:

  • embedded_vCSA_on_ESXi.json – minimum configuration required for the deployment of vCSA on an ESXi host.
  • embedded_vCSA_on_VC.json – minimum configuration required for the deployment of vCSA on a vCenter Server instance.

For this demonstration, we will install vCSA on a standalone host, so we will use embedded_vCSA_on_ESXi.json as a template. Using Visual studio Code we edit the JSON template to contain data specific to our environment:

{
    "__version": "2.13.0",
    "new_vcsa": {
        "esxi": {
            "hostname": "192.168.0.100",
            "username": "root",
            "password": "VMware01!",
            "deployment_network": "VM Network",
            "datastore": "esx0-ssd1"
        },
        "appliance": {
            "thin_disk_mode": true,
            "deployment_option": "tiny",
            "name": "vcenter.cloudhat.local"
        },
        "network": {
            "ip_family": "ipv4",
            "mode": "static",
            "system_name": "vcenter.cloudhat.local",
            "ip": "192.168.0.200",
            "prefix": "24",
            "gateway": "192.168.0.1",
            "dns_servers": ["192.168.0.222"]
        },
        "os": {
            "password": "VMware01!",
            "ntp_servers": "time.nist.gov",
            "ssh_enable": false
        },
        "sso": {
            "password": "VMware01!",
            "domain_name": "vsphere.local"
        }
    },
    "ceip": {
        "settings": {
            "ceip_enabled": true
        }
    }
}

We can notice different sections in the file:

  • esxi – information about the standalone ESXi where we will install vCSA. If there is no password provided, the CLI command will ask for the password at runtime. If we want to run the installation command completely unattended, we need to provide all the passwords in the file.
  • appliance – describes the vCSA appliance we want to install
  • network – describes how we want to configure the vCSA network
  • os – information about vCSA operating system; the field “password” here refers to the appliance root password.
  • sso – information about the Single Sign-On domain; the field “password” here refers to the [email protected]_name password.
  • ceip – provides an option related to VMware Customer Experience Improvement Program (CEIP)

For full description of all available parameters, you can check the VMware documentation page “Deployment Configuration Parameters”.

Run a Pre-Check

As best practice, we can run a pre-check of the configuration and environment.

For a reference to all available options for CLI command, you can check the VMware documentation page “Syntax of the CLI Deployment Command”.

Unarchive the ISO, then we can navigate to vcsa-cli-installer\win32 (or to the folder corresponding to our operating system: lin64 or mac). For easy reference, we can also copy our JSON file to the same location. I renamed my JSON file as cloudhat.json (it can be any name, but you need to call it in the commands below). We can also create a folder “logs” where we will send the very detailed logs that the installer provides us.

E:\VCSA7\vcsa-cli-installer\win32> .\vcsa-deploy install --accept-eula --acknowledge-ceip --no-ssl-certificate-verification --precheck-only --log-dir=logs cloudhat.json

Command details:

  • vcsa-deploy – main CLI command.
  • install – do a vCSA installation.
  • –accept-eula – accept the end user license agreement (required).
  • –acknowledge-ceip – accept CEIP agreement (required if ceip.enabled parameter is set to true in the JSON file).
  • –no-ssl-certificate-verification – skip security certificate verification (required if the certificate on the target ESXi server is self-signed).
  • –precheck-only – perform only the basic template verification and OVF Tool parameter verification. Does not deploy the vCSA appliance.
  • –log-dir=logs – redirect all the installer logs to the folder named “logs”
  • cloudhat.json – use the configuration parameters from this JSON file.

We can now run the command. If we skipped one or more passwords in the JSON configuration file, we will receive in terminal one or more messages requiring us to input the password(s):

To escape the password prompt, and restart the deployment process, press <Ctrl-C>.
Enter the password for the deployment ESXi (cloudhat.json: 'new_vcsa', 'esxi', 'password'):

We should check the output for different errors we may have. For example, if we enter an incorrect root password for the standalone ESXi where we want to install the vCSA appliance, we will see a similar failure:

2022-04-27 17:21:51,127 - vCSACliInstallLogger - INFO - ================ [FAILED] Task: Running precheck: TargetCredentials execution failed at 17:21:51 ================
2022-04-27 17:21:51,127 - vCSACliInstallLogger - DEBUG - Task 'Running precheck: TargetCredentials' execution failed because [TargetCredentials: Cannot connect to '192.168.0.100' on which the vCenter Server Appliance is running. The exception message is 'Failed to log in to server '192.168.0.100' as user 'root' with error '(vim.fault.InvalidLogin) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   msg = 'Cannot complete login due to an incorrect user name or password.',
   faultCause = <unset>,
   faultMessage = (vmodl.LocalizableMessage) []
}'.

If we have no errors, the end of the log file will look like below. We can notice on the last line the name of the folder where the logs are saved. Main file to look for in that folder is vcsa-cli-installer.log.

022-04-27 17:23:56,615 - vCSACliInstallLogger - INFO -  [SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters to deploy a vCenter Server Appliance' in TaskFlow 'cloudhat' at 17:23:56 
2022-04-27 17:23:57,842 - vCSACliInstallLogger - DEBUG - [VAC] Attempt succeeded: Task
2022-04-27 17:23:58,629 - vCSACliInstallLogger - DEBUG - [VAC] Attempt succeeded: TaskFlow
2022-04-27 17:23:59,427 - vCSACliInstallLogger - DEBUG - [VAC] Attempt succeeded: TaskFlow
2022-04-27 17:24:00,605 - vCSACliInstallLogger - DEBUG - [VAC] Attempt succeeded: CLI Client Info
2022-04-27 17:24:00,605 - vCSACliInstallLogger - DEBUG - vcsa-deploy execution successfully completed, workflow log dir: logs\workflow_1651080132455

2022-04-27 17:24:00,607 - vCSACliInstallLogger - INFO - =================================== 17:24:00 ===================================
2022-04-27 17:24:00,607 - vCSACliInstallLogger - INFO - Result and Log File Information...
2022-04-27 17:24:00,607 - vCSACliInstallLogger - INFO - WorkFlow log directory: logs\workflow_1651080132455

Assuming we have no error, we can proceed with the installation.

Install vCenter Server 7.0 Update 3d Using the CLI

The big moment came, we will now start vCenter installation. This is an easy one, we will use the same command, omitting –precheck-only parameter:

E:\VCSA7\vcsa-cli-installer\win32> .\vcsa-deploy install --accept-eula --acknowledge-ceip --no-ssl-certificate-verification --log-dir=logs cloudhat.json

Some time later, we should see a success message:

2022-04-27 18:08:58,790 - vCSACliInstallLogger - DEBUG - ApplianceLoginSummaryTask: Provide appliance login information.
2022-04-27 18:08:58,790 - vCSACliInstallLogger - INFO -  [START] Start executing Task: Provide the login information about new appliance. at 18:08:58 
2022-04-27 18:08:58,944 - vCSACliInstallLogger - INFO -     Appliance Name: vcenter.cloudhat.local
2022-04-27 18:08:58,944 - vCSACliInstallLogger - INFO -     System Name: vcenter.cloudhat.local
2022-04-27 18:08:58,945 - vCSACliInstallLogger - INFO -     System IP: 192.168.0.200
2022-04-27 18:08:58,945 - vCSACliInstallLogger - INFO -     Log in as: [email protected]
2022-04-27 18:08:58,946 - vCSACliInstallLogger - INFO -  [SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide appliance login information.' in TaskFlow 'cloudhat' at 18:08:58 
2022-04-27 18:09:00,259 - vCSACliInstallLogger - DEBUG - [VAC] Attempt succeeded: Task
2022-04-27 18:09:00,259 - vCSACliInstallLogger - DEBUG - Querying VC version for VC: vcenter.cloudhat.local
2022-04-27 18:09:00,259 - vCSACliInstallLogger - DEBUG - Proceed with certificate thumbprint check...
2022-04-27 18:09:00,369 - vCSACliInstallLogger - DEBUG - [VAC] Got target vc version: 7.0.3
2022-04-27 18:09:00,369 - vCSACliInstallLogger - DEBUG - Querying VC instance UUID for VC: vcenter.cloudhat.local
2022-04-27 18:09:00,369 - vCSACliInstallLogger - DEBUG - Proceed with certificate thumbprint check...
2022-04-27 18:09:00,478 - vCSACliInstallLogger - DEBUG - [VAC] Got target vc uuid: ec637f30-b8fe-4112-b20d-b635de3c1514
2022-04-27 18:09:01,275 - vCSACliInstallLogger - DEBUG - [VAC] Attempt succeeded: TaskFlow
2022-04-27 18:09:01,275 - vCSACliInstallLogger - DEBUG - Querying VC version for VC: vcenter.cloudhat.local
2022-04-27 18:09:01,275 - vCSACliInstallLogger - DEBUG - Proceed with certificate thumbprint check...
2022-04-27 18:09:01,509 - vCSACliInstallLogger - DEBUG - [VAC] Got target vc version: 7.0.3
2022-04-27 18:09:01,509 - vCSACliInstallLogger - DEBUG - Querying VC instance UUID for VC: vcenter.cloudhat.local
2022-04-27 18:09:01,509 - vCSACliInstallLogger - DEBUG - Proceed with certificate thumbprint check...
2022-04-27 18:09:01,681 - vCSACliInstallLogger - DEBUG - [VAC] Got target vc uuid: ec637f30-b8fe-4112-b20d-b635de3c1514
2022-04-27 18:09:02,494 - vCSACliInstallLogger - DEBUG - [VAC] Attempt succeeded: TaskFlow
2022-04-27 18:09:03,494 - vCSACliInstallLogger - DEBUG - [VAC] Attempt succeeded: CLI Client Info
2022-04-27 18:09:03,494 - vCSACliInstallLogger - DEBUG - vcsa-deploy execution successfully completed, workflow log dir: logs\workflow_1651080523099

2022-04-27 18:09:03,494 - vCSACliInstallLogger - INFO - =================================== 18:09:03 ===================================
2022-04-27 18:09:03,494 - vCSACliInstallLogger - INFO - Result and Log File Information...
2022-04-27 18:09:03,494 - vCSACliInstallLogger - INFO - WorkFlow log directory: logs\workflow_1651080523099

Congrats, we can now login to the vCenter Server 7.0 Update 3d instance we just deployed using CLI!

VMware vCenter 7.0.3d

Constantin Ghioc

I usually play with VMware Cloud Foundation, vRealize Automation, vRealize Orchestrator, and different AWS tools. In my other life I’m a husband and a father, an amateur photographer and a Go enthusiast.

Leave a Reply