vCenter?Server?的?CLI?部署方式圖文詳解
VMware vCenter Server 是 VMware vSphere 解決方案的核心組件,用于管理多個 ESXi 主機并實現(xiàn)更多高級功能特性(如 HA、DRS 以及 FT 等),相信大家已經(jīng)非常熟悉了。對于 vCenter Server 的安裝和部署,可能大部分人會選擇使用 GUI 方式部署 vCenter Server,并使用 vCenter Server ISO 鏡像文件中的 \vcsa-ui-installer\win32\installer.exe 部署程序,如下圖所示。部署過程分為兩個階段,第一階段配置并部署 vCenter Server 的 OVA 虛擬機文件;第二階段設(shè)置并啟動 vCenter Server 虛擬機的服務(wù)。

其實,對于 vCenter Server 的部署還支持 CLI 部署方式,像我這種在實驗室中經(jīng)常需要安裝刪除 vCenter Server 環(huán)境的來說,可能更喜歡 CLI 自動化部署方式,因為這樣可以節(jié)約很多時間來做其他事情。如果你能了解 vCenter Server 的 GUI 部署過程,那對于使用 CLI 的部署方式應該也會非常簡單。下面來看看如何使用 CLI 方式來部署我們所需要的 vCenter Server 環(huán)境,涵蓋了 GUI 部署過程中的所有場景,更多內(nèi)容和細節(jié)請查看 vCenter Server 產(chǎn)品文檔。
將 vCenter Server ISO 鏡像文件掛載到本地虛擬光驅(qū) F 盤符上,可以看到 vCenter Server 安裝鏡像文件中包含的所有文件,如下圖所示。注,對于 vCenter Server 的 CLI 部署將使用 PowerShell 方式執(zhí)行,ISO 鏡像文件基于 vCenter Server 8.0 U2b,內(nèi)部版本號 23319993。

如你所見,要是使用 GUI 部署方式則選擇 vcsa-ui-installer 文件夾下面所對應的部署程序,如果使用 CLI 部署方式則使用 \vcsa-cli-installer\win32\ 文件夾下面的 vcsa-deploy.exe 部署程序。

使用 CLI 部署方式除了要使用 vcsa-deploy.exe 部署程序以外,還需要用到 \vcsa-cli-installer\templates\install\ 文件夾下面的 JSON 配置文件,這些 JSON 配置文件中預定義了在部署 vCenter Server 過程中所需配置的信息,如部署位置 、FQDN 等。

這些 JSON 配置文件一共分為兩類,一類是 *_on_ESXi.json 文件,用于將 vCenter Server 虛擬機部署在 ESXi 主機上;另一類是 *_on_VC.json 文件,用于將 vCenter Server 虛擬機部署在現(xiàn)有 vCenter Server 上。第一類通常是用于初始部署,第二類是在已有 vSphere 環(huán)境的情況下進行部署,后面將分別介紹這幾種 JSON 配置文件所代表的部署場景。

先看一下 vcsa-deploy.exe 部署程序的命令幫助,CLI 方式同樣可以實現(xiàn)安裝(install)、升級(upgrade)以及遷移(migrate)等功能。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe --help

使用以下命令可以查看 vCenter Server 支持的部署大小以及對應的默認配置,可根據(jù)環(huán)境的情況自行選擇哪種部署選項。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe --supported-deployment-sizes

如果對 JSON 配置文件中的哪個配置選項有疑問,可以使用以下命令查看 JSON 配置文件中關(guān)于配置選項的說明。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install --template-help | more

下面正式進入 CLI 部署的配置過程,涉及到 vCenter Server 的多種部署場景,不同的場景會使用到不同的 JSON 配置文件以及環(huán)境。
一、將 vCenter Server 虛擬機部署到 ESXi 主機上
將 vCenter Server 虛擬機部署到 ESXi 主機上,通常是 ESXi 主機上已經(jīng)具有本地存儲和網(wǎng)絡(luò)端口組等環(huán)境信息,這種場景需要用到 vCenter Server 鏡像文件中的 embedded_vCSA_on_ESXi.json 配置文件,根據(jù)這個配置文件修改為實際環(huán)境中的信息,示例如下:
{
"__version": "2.13.0",
"__comments": "將 vCenter Server 虛擬機部署到 ESXi 主機上",
"new_vcsa": {
"esxi": {
"hostname": "192.168.32.51",
"username": "root",
"password": "vSphere8@password",
"deployment_network": "VM Network",
"datastore": "Datastore-01"
},
"appliance": {
"__comments": [
"vCenter Server 部署參數(shù)"
],
"thin_disk_mode": true,
"deployment_option": "tiny",
"name": "vcenter01"
},
"network": {
"ip_family": "ipv4",
"mode": "static",
"system_name": "vcenter01.mulab.local",
"ip": "192.168.32.55",
"prefix": "24",
"gateway": "192.168.32.254",
"dns_servers": [
"192.168.32.3"
]
},
"os": {
"password": "vSphere8@password",
"ntp_servers": "192.168.32.3",
"ssh_enable": true
},
"sso": {
"password": "vSphere8@password",
"domain_name": "vsphere.local"
}
},
"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": false
}
}
}另存為 deploy-on-esxi.json 配置文件到 files 文件夾,使用以下命令執(zhí)行部署前預檢查。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-esxi.json --accept-eula --no-ssl-certificate-verification --precheck-only
如果 JSON 配置文件與部署環(huán)境檢查成功,則會輸出類似下面的內(nèi)容。
[SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters to deploy a vCenter Server Appliance' in TaskFlow 'deploy-on-esxi' at 09:03:06 =================================== 09:03:07 =================================== Result and Log File Information... WorkFlow log directory: C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-02-x2dv8gw0\workflow_1722934960074
如果 JSON 配置文件與部署環(huán)境檢查確定沒問題,使用以下命令執(zhí)行正式部署。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-esxi.json --accept-eula --no-ssl-certificate-verification
如果 vCenter Server 部署成功,則會輸出類似下面的內(nèi)容。
Successfully completed VCSA deployment. VCSA Deployment Start Time:
2024-08-06T09:11:48.264Z VCSA Deployment End Time: 2024-08-06T09:33:42.921Z
[SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring
Deployment' in TaskFlow 'deploy-on-esxi' at 09:33:55
Monitoring VCSA Deploy task completed
== [START] Start executing Task: Join active domain if necessary at 09:33:56 ==
Domain join task not applicable, skipping task
[SUCCEEDED] Successfully executed Task 'Running deployment: Domain Join' in
TaskFlow 'deploy-on-esxi' at 09:33:56
[START] Start executing Task: Provide the login information about new
appliance. at 09:33:56
Appliance Name: vcenter01
System Name: vcenter01.mulab.local
System IP: 192.168.32.55
Log in as: Administrator@vsphere.local
[SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide
appliance login information.' in TaskFlow 'deploy-on-esxi' at 09:33:56
=================================== 09:33:57 ===================================
Result and Log File Information...
WorkFlow log directory:
C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-03-4auw6_e4\workflow_1722935032748登錄 vCenter Server,查看部署情況。

二、將 vCenter Server 虛擬機部署到現(xiàn)有 vCenter Server 上
將 vCenter Server 虛擬機部署到現(xiàn)有 vCenter Server 上,通常是當前環(huán)境中已經(jīng)具有 vSphere 環(huán)境并想在之上部署另外一套環(huán)境,這種場景需要用到 vCenter Server 鏡像文件中的 embedded_vCSA_on_VC.json 配置文件,根據(jù)這個配置文件修改為實際環(huán)境中的信息,示例如下:
{
"__version": "2.13.0",
"__comments": "將 vCenter Server 虛擬機部署到現(xiàn)有 vCenter Server 上",
"new_vcsa": {
"vc": {
"__comments": [
"'datacenter' must end with a datacenter name, and only with a datacenter name.",
"'target' must end with an ESXi hostname, a cluster name, or a resource pool name.",
"The item 'Resources' must precede the resource pool name. ",
"All names are case-sensitive. ",
"For details and examples, refer to template help, i.e. vcsa-deploy {install|upgrade|migrate} --template-help"
],
"hostname": "vcsa8-01.mulab.local",
"username": "administrator@vsphere.local",
"password": "vSphere8@password",
"deployment_network": "VM Network",
"datacenter": [
"mulab"
],
"datastore": "vsanDatastore",
"target": [
"vsan8-hci-esa"
]
},
"appliance": {
"__comments": [
"vCenter Server 部署參數(shù)"
],
"thin_disk_mode": true,
"deployment_option": "tiny",
"name": "vcenter02"
},
"network": {
"ip_family": "ipv4",
"mode": "static",
"system_name": "vcenter02.mulab.local",
"ip": "192.168.32.56",
"prefix": "24",
"gateway": "192.168.32.254",
"dns_servers": [
"192.168.32.3"
]
},
"os": {
"password": "vSphere8@password",
"ntp_servers": "192.168.32.3",
"ssh_enable": true
},
"sso": {
"password": "vSphere8@password",
"domain_name": "vsphere.local"
}
},
"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": false
}
}
}另存為 deploy-on-vcenter.json 配置文件到 files 文件夾,使用以下命令執(zhí)行部署前預檢查。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-vcenter.json --accept-eula --no-ssl-certificate-verification --precheck-only
如果 JSON 配置文件與部署環(huán)境檢查成功,則會輸出類似下面的內(nèi)容。
[SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters to deploy a vCenter Server Appliance' in TaskFlow 'deploy-on-vcenter' at 09:05:55 =================================== 09:05:56 =================================== Result and Log File Information... WorkFlow log directory: C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-05-z39vgzmr\workflow_1722935126586
如果 JSON 配置文件與部署環(huán)境檢查確定沒問題,使用以下命令執(zhí)行正式部署。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-vcenter.json --accept-eula --no-ssl-certificate-verification
如果 vCenter Server 部署成功,則會輸出類似下面的內(nèi)容。
[SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters to deploy a vCenter Server Appliance' in TaskFlow 'deploy-on-vcenter' at 09:05:55 =================================== 09:05:56 =================================== Result and Log File Information... WorkFlow log directory: C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-05-z39vgzmr\workflow_1722935126586
登錄 vCenter Server,查看部署情況。

三、部署多個 vCenter Server
前面兩種場景分別是將 vCenter Server 部署到 ESXi 主機或者現(xiàn)有 vCenter Server 上,針對前面兩種情況,可能你有同時部署多個 vCenter Server 環(huán)境的需求,可以將 embedded_vCSA_on_ESXi.json 或者 embedded_vCSA_on_VC.json 配置文件復制為多個 vCenter Server 的部署配置文件,然后將這些文件放在同一個文件夾內(nèi)(如 deploy-multiple-vcenter),部署的時候指定這個文件夾即可同時部署多個 vCenter Server 環(huán)境。

如果已經(jīng)配置好了 JSON 配置文件并放在了同一文件夾(如 deploy-multiple-vcenter),使用以下命令執(zhí)行部署前預檢查。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-multiple-vcenter\ --accept-eula --no-ssl-certificate-verification --precheck-only
如果文件夾中的 JSON 配置文件與部署環(huán)境檢查確定沒問題,使用以下命令執(zhí)行正式部署。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-multiple-vcenter\ --accept-eula --no-ssl-certificate-verification四、部署具有增強型鏈接模式的 vCenter Server
增強型鏈接模式(ELM)就是將環(huán)境中的多個 vCenter Server 實例鏈接到一起并加入到同一個 SSO 域當中,當你通過 SSO 管理員登錄到任意一個 vCenter Server 的時候,可以同時看到鏈接的其他 vCenter Server,這樣就可以實現(xiàn)多個 vCenter Server 實例的統(tǒng)一管理??梢圆榭催@篇(使用cmsso-util命令進行鏈接、刪除、修改多個vCenter Server(VCSA)的SSO域。)文章了解更多關(guān)于增強型鏈接模式 vCenter Server 的相關(guān)配置。
部署具有增強型鏈接模式的 vCenter Server 虛擬機到 ESXi 主機上,需要用到 vCenter Server 鏡像文件中的 embedded_vCSA_replication_on_ESXi.json 配置文件,根據(jù)這個配置文件修改為實際環(huán)境中的信息,示例如下:
{
"__version": "2.13.0",
"__comments": "將具有增強型鏈接模式的 vCenter Server 虛擬機部署到 ESXi 主機上",
"new_vcsa": {
"esxi": {
"hostname": "192.168.32.51",
"username": "root",
"password": "vSphere8@password",
"deployment_network": "VM Network",
"datastore": "Datastore-01"
},
"appliance": {
"__comments": [
"vCenter Server 部署參數(shù)"
],
"thin_disk_mode": true,
"deployment_option": "tiny",
"name": "vcenter03"
},
"network": {
"ip_family": "ipv4",
"mode": "static",
"system_name": "vcenter03.mulab.local",
"ip": "192.168.32.57",
"prefix": "24",
"gateway": "192.168.32.254",
"dns_servers": [
"192.168.32.3"
]
},
"os": {
"password": "vSphere8@password",
"ntp_servers": "192.168.32.3",
"ssh_enable": true
},
"sso": {
"password": "vSphere8@password",
"domain_name": "vsphere.local",
"first_instance": false,
"replication_partner_hostname": "vcenter01.mulab.local",
"sso_port": 443
}
},
"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": false
}
}
}另存為 deploy-elm-on-esxi.json 配置文件到 files 文件夾,使用以下命令執(zhí)行部署前預檢查。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-elm-on-esxi.json --accept-eula --no-ssl-certificate-verification --precheck-only
如果 JSON 配置文件與部署環(huán)境檢查成功,則會輸出類似下面的內(nèi)容。
[SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters to deploy a vCenter Server Appliance' in TaskFlow 'deploy-elm-on-esxi' at 09:42:46 =================================== 09:42:46 =================================== Result and Log File Information... WorkFlow log directory: C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-42-qzp_kn0v\workflow_1722937339642
如果 JSON 配置文件與部署環(huán)境檢查確定沒問題,使用以下命令執(zhí)行正式部署。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-elm-on-esxi.json --accept-eula --no-ssl-certificate-verification
如果 vCenter Server 部署成功,則會輸出類似下面的內(nèi)容。
Successfully completed VCSA deployment. VCSA Deployment Start Time:
2024-08-06T09:52:23.624Z VCSA Deployment End Time: 2024-08-06T10:15:36.574Z
[SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring
Deployment' in TaskFlow 'deploy-elm-on-esxi' at 10:16:03
Monitoring VCSA Deploy task completed
== [START] Start executing Task: Join active domain if necessary at 10:16:04 ==
Domain join task not applicable, skipping task
[SUCCEEDED] Successfully executed Task 'Running deployment: Domain Join' in
TaskFlow 'deploy-elm-on-esxi' at 10:16:04
[START] Start executing Task: Provide the login information about new
appliance. at 10:16:05
Appliance Name: vcenter03
System Name: vcenter03.mulab.local
System IP: 192.168.32.57
Log in as: Administrator@vsphere.local
[SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide
appliance login information.' in TaskFlow 'deploy-elm-on-esxi' at 10:16:05
=================================== 10:16:05 ===================================
Result and Log File Information...
WorkFlow log directory:
C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-44-5l_hhkqk\workflow_1722937468472登錄 vCenter Server,查看部署情況。

部署具有增強型鏈接模式的 vCenter Server 虛擬機到現(xiàn)有 vCenter Server 上,需要用到 vCenter Server 鏡像文件中的 embedded_vCSA_replication_on_VC.json 配置文件,根據(jù)這個配置文件修改為實際環(huán)境中的信息,示例如下:
{
"__version": "2.13.0",
"__comments": "將具有增強型鏈接模式的 vCenter Server 虛擬機部署到現(xiàn)有 vCenter Server 上",
"new_vcsa": {
"vc": {
"__comments": [
"'datacenter' must end with a datacenter name, and only with a datacenter name.",
"'target' must end with an ESXi hostname, a cluster name, or a resource pool name.",
"The item 'Resources' must precede the resource pool name. ",
"All names are case-sensitive. ",
"For details and examples, refer to template help, i.e. vcsa-deploy {install|upgrade|migrate} --template-help"
],
"hostname": "vcsa8-01.mulab.local",
"username": "administrator@vsphere.local",
"password": "vSphere8@password",
"deployment_network": "VM Network",
"datacenter": [
"mulab"
],
"datastore": "vsanDatastore",
"target": [
"vsan8-hci-esa"
]
},
"appliance": {
"__comments": [
"vCenter Server 部署參數(shù)"
],
"thin_disk_mode": true,
"deployment_option": "tiny",
"name": "vcenter04"
},
"network": {
"ip_family": "ipv4",
"mode": "static",
"system_name": "vcenter04.mulab.local",
"ip": "192.168.32.58",
"prefix": "24",
"gateway": "192.168.32.254",
"dns_servers": [
"192.168.32.3"
]
},
"os": {
"password": "vSphere8@password",
"ntp_servers": "192.168.32.3",
"ssh_enable": true
},
"sso": {
"password": "vSphere8@password",
"domain_name": "vsphere.local",
"first_instance": false,
"replication_partner_hostname": "vcenter02.mulab.local",
"sso_port": 443
}
},
"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": false
}
}
}另存為 deploy-elm-on-vcenter.json 配置文件到 files 文件夾,使用以下命令執(zhí)行部署前預檢查。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-elm-on-vcenter.json --accept-eula --no-ssl-certificate-verification --precheck-only
如果 JSON 配置文件與部署環(huán)境檢查成功,則會輸出類似下面的內(nèi)容。
[SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters to deploy a vCenter Server Appliance' in TaskFlow 'deploy-elm-on-vcenter' at 09:55:12 =================================== 09:55:13 =================================== Result and Log File Information... WorkFlow log directory: C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-54-lps7j7v1\workflow_1722938084996
如果 JSON 配置文件與部署環(huán)境檢查確定沒問題,使用以下命令執(zhí)行正式部署。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-elm-on-vcenter.json --accept-eula --no-ssl-certificate-verification
如果 vCenter Server 部署成功,則會輸出類似下面的內(nèi)容。
[SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters to deploy a vCenter Server Appliance' in TaskFlow 'deploy-elm-on-vcenter' at 09:55:12 =================================== 09:55:13 =================================== Result and Log File Information... WorkFlow log directory: C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-54-lps7j7v1\workflow_1722938084996
登錄 vCenter Server,查看部署情況。

部署具有增強型鏈接模式 vCenter Server 的時候,可能大部分情況是環(huán)境中已經(jīng)有第一個 vCenter Server 了,然后再使用上面所述的方式部署第二個 vCenter Server 并將其鏈接到第一個 vCenter Server 中。其實,如果環(huán)境中沒有第一個 vCenter Server 的時候,也可以同時部署增強型鏈接模式的 vCenter Server,比如,deploy-vcenter01-on-esxi.json 配置文件用于部署第一個 vCenter Server,deploy-vcenter01-elm-on-esxi.json 配置文件用于部署具有增強型鏈接模式的第二個 vCenter Server,將這兩個 JSON 配置文件放在同一文件夾中,在部署的時候指定這個文件夾,這樣 CLI 部署完第一個 vCenter Server 后,然后當?shù)诙€ vCenter Server 部署的時候就會自動鏈接到第一個 vCenter Server 中去。

五、將 vCenter Server 虛擬機部署到 ESXi 主機上并配置單節(jié)點 vSAN ESA 集群
對于初始構(gòu)建 vSphere 環(huán)境的用戶來說,可能 ESXi 主機安裝部署以后,想直接將 ESXi 主機應用于 vSAN 環(huán)境,同時又想將 vSAN 存儲用于承載 vCenter Server。如果使用以上所述場景,部署 vCenter Server 的前提是環(huán)境中必須具有用于存放 vCenter Server 的本地/共享存儲,但是,VMware 這里提供了一種方式,在部署 vCenter Server 之前,可以直接將初始安裝的 ESXi 主機轉(zhuǎn)換成 vSAN 集群的第一臺主機,這樣配置為單節(jié)點 vSAN 集群后,再將配置后的 vSAN 存儲用于承載 vCenter Server 虛擬機所使用的存儲。如果是這樣,就不用單獨先配置 ESXi 主機的本地/共享存儲用于部署 vCenter Server 了,這也是 VMware 很多解決方案所使用的方式,比如 VMware Cloud Foundation。
將 vCenter Server 虛擬機部署到 ESXi 主機上并配置單節(jié)點 vSAN ESA 集群,需要用到 vCenter Server 鏡像文件中的 vCSA_with_cluster_on_ESXi.json 配置文件,根據(jù)這個配置文件修改為實際環(huán)境中的信息,示例如下:
{
"__version": "2.13.0",
"__comments": "將 vCenter Server 虛擬機部署到 ESXi 主機上并配置單節(jié)點 vSAN ESA 集群",
"new_vcsa": {
"esxi": {
"hostname": "esxi.mulab.local",
"username": "root",
"password": "vSphere8@password",
"deployment_network": "VM Network",
"VCSA_cluster": {
"__comments": [
"Optional section. You must provide this option if you want to create the vSAN bootstrap cluster"
],
"datacenter": "datacenter",
"cluster": "vsan-esa",
"compression_only": false,
"deduplication_and_compression": false,
"enable_vlcm": true,
"enable_vsan_esa": true,
"storage_pool": {
"single_tier": [
"0654f79de904b1744a000c29669162b236",
"063ec1878a6b90d657000c296a1c16f648"
]
},
"vsan_hcl_database_path": "all.json"
}
},
"appliance": {
"__comments": [
"vCenter Server 部署參數(shù)"
],
"thin_disk_mode": true,
"deployment_option": "small",
"name": "vcenter"
},
"network": {
"ip_family": "ipv4",
"mode": "static",
"ip": "192.168.32.50",
"dns_servers": [
"192.168.32.3"
],
"prefix": "24",
"gateway": "192.168.32.254",
"system_name": "vcenter.mulab.local"
},
"os": {
"password": "vSphere8@password",
"ntp_servers": "192.168.32.3",
"ssh_enable": true
},
"sso": {
"password": "vSphere8@password",
"domain_name": "vsphere.local"
}
},
"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": false
}
}
}JSON 配置文件中,關(guān)于 ESXi 主機用于 vSAN 存儲池的硬盤信息可以在下圖所示的地方獲取。注意,由于是部署 vSAN ESA 環(huán)境,需要下載 vSAN HCL 文件到本地,并將文件的路徑填入到對應的 JSON 配置文件當中,當前部署環(huán)境將 vSAN HCL 文件放在了運行 CLI 命令的當前目錄(C:\Users\JUNIOR_MU\)。

另存為 deploy-on-esxi-with-vsan-esa.json 配置文件到 files 文件夾,使用以下命令執(zhí)行部署前預檢查。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-esxi-with-vsan-esa.json --accept-eula --no-ssl-certificate-verification --precheck-only
如果 JSON 配置文件與部署環(huán)境檢查成功,則會輸出類似下面的內(nèi)容。
[SUCCEEDED] Successfully executed Task 'Running Pre-check: vSAN Cluster Health Checks.' in TaskFlow 'install' at 10:53:30 Running Pre-check: vSphere vLCM Cluster Enablement. [START] Start executing Task: Running Pre-check for vSphere vLCM Cluster Enablement. at 10:53:30 [SUCCEEDED] Successfully executed Task 'Running Pre-check: vSphere vLCM Cluster Enablement.' in TaskFlow 'install' at 10:53:30 [SUCCEEDED] Successfully executed Task 'PrecheckTask: Running prechecks.' in TaskFlow 'deploy-on-esxi-with-vsan-esa' at 10:53:30 vcsa-deploy execution successfully completed, workflow log dir: C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-10-52-j1nef3kt\workflow_1722941536363 =================================== 10:53:31 =================================== Result and Log File Information... WorkFlow log directory: C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-10-52-j1nef3kt\workflow_1722941536363
如果 JSON 配置文件與部署環(huán)境檢查確定沒問題,使用以下命令執(zhí)行正式部署。
F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-esxi-with-vsan-esa.json --accept-eula --no-ssl-certificate-verification
如果 vCenter Server 部署成功,則會輸出類似下面的內(nèi)容。
Successfully completed VCSA deployment. VCSA Deployment Start Time:
2024-08-06T11:12:39.139Z VCSA Deployment End Time: 2024-08-06T11:31:05.857Z
[SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring
Deployment' in TaskFlow 'deploy-on-esxi-with-vsan-esa' at 11:31:19
Monitoring VCSA Deploy task completed
== [START] Start executing Task: Join active domain if necessary at 11:31:20 ==
Domain join task not applicable, skipping task
[SUCCEEDED] Successfully executed Task 'Running deployment: Domain Join' in
TaskFlow 'deploy-on-esxi-with-vsan-esa' at 11:31:20
==== [START] Start executing Task: Creating the new datacenter. at 11:31:21 ====
The certificate of server 'vcenter.mulab.local' will not be verified because you
have provided either the '--no-ssl-certificate-verification' or
'--no-esx-ssl-verify' command parameter, which disables verification for all
certificates. Remove this parameter from the command line if you want server
certificates to be verified.
[SUCCEEDED] Successfully executed Task 'Running Datacenter Creation: Creating
the new datacenter for vSphere vLCM managed cluster.' in TaskFlow
'deploy-on-esxi-with-vsan-esa' at 11:31:23
[START] Start executing Task: Creating vSphere vLCM managed cluster. at
11:31:24
Enabling vLCM Cluster creation task on vcenter.mulab.local
Running ExecuteClusterHostSeedingWorkflow...
[SUCCEEDED] Successfully executed Task 'Running vSphere vLCM: Creating vSphere
vLCM managed cluster.' in TaskFlow 'deploy-on-esxi-with-vsan-esa' at 11:35:44
[START] Start executing Task: Provide the login information about new
appliance. at 11:35:45
Appliance Name: vcenter
System Name: vcenter.mulab.local
System IP: 192.168.32.50
Log in as: Administrator@vsphere.local
Your vCenter Server Appliance is deployed on a vSAN cluster. However this
one-host cluster must be further configured in order to provide the full
benefits of a vSAN cluster.
vSAN Configuration Instructions
1. Add additional hosts to the vSAN cluster (a minimum of two).
2. Complete the required configuration of the vSAN cluster.
3. Apply the correct VM Storage Policy to the vCenter Server Appliance.
[SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide
appliance login information.' in TaskFlow 'deploy-on-esxi-with-vsan-esa' at
11:35:45
=================================== 11:35:46 ===================================
Result and Log File Information...
WorkFlow log directory:
C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-11-00-u9zayc8j\workflow_1722942009531登錄 vCenter Server,查看部署情況。

當前是單節(jié)點 vSAN 集群,需要增加 ESXi 主機以滿足 vSAN 集群最少主機要求(3臺)。

vSAN 存儲容量以及當前默認存儲策略配置。

vSAN ESA 集群 ESXi 主機磁盤配置。

vSAN ESA 集群 ESXi 主機網(wǎng)絡(luò)配置,需要添加配置用于 vSAN 流量的 vmkernel 網(wǎng)卡。

配置好完整的 vSAN 集群后,請將 vCenter Server 的策略調(diào)整為 vSAN 存儲策略。

到此這篇關(guān)于vCenter Server 的 CLI 部署方式的文章就介紹到這了,更多相關(guān)vCenter Server 的 CLI 部署內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
VMware VMnet8模式共享主機網(wǎng)絡(luò)配置靜態(tài)IP和DNS方式
文章介紹了NAT網(wǎng)絡(luò)模式的基本概念和配置步驟,包括設(shè)置靜態(tài)IP、配置CentOS網(wǎng)絡(luò)適配器為NAT模式、修改網(wǎng)絡(luò)設(shè)置和重啟network服務(wù),最后驗證網(wǎng)絡(luò)設(shè)置成功2024-11-11
VMware Workstation 12安裝與激活圖文教程
這篇文章主要為大家詳細介紹了VMware Workstation 12安裝與激活圖文教程,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-12-12
VMWare15 安裝 Mac OS系統(tǒng)(圖文教程)
這篇文章主要介紹了VMWare15 安裝 Mac OS系統(tǒng),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-01-01
Vmware+Centos7搭建Openstack環(huán)境(網(wǎng)絡(luò)配置)
本篇文章主要介紹了Vmware+Centos7搭建Openstack環(huán)境(網(wǎng)絡(luò)配置),具有一定的參考價值,感興趣的小伙伴們可以參考一下。2017-03-03
VMWARE安裝與VMWARE下LINUX系統(tǒng)安裝(圖文教程)
這篇文章主要介紹了VMWARE安裝與VMWARE下LINUX系統(tǒng)安裝(圖文教程),有需要的朋友可以了解一下。2016-10-10
解決VMware虛擬機橋接模式無法上網(wǎng)的解決方法
這篇文章主要介紹了解決VMware虛擬機橋接模式無法上網(wǎng)的解決方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2019-11-11
VMware虛擬機如何設(shè)置網(wǎng)絡(luò)的方法步驟
本文主要介紹了VMware虛擬機如何設(shè)置網(wǎng)絡(luò)的方法步驟,要在宿主機訪問虛擬機電腦服務(wù)器,要設(shè)置成nat格式,虛擬機可以上網(wǎng),感興趣的可以了解一下2023-09-09

