【VMware vCenter】一次性说清晰 vCenter Server 的 CLI 摆设方式。 ...

打印 上一主题 下一主题

主题 763|帖子 763|积分 2289

VMware vCenter Server 是 VMware vSphere 解决方案的核心组件,用于管理多个 ESXi 主机并实现更多高级功能特性(如 HA、DRS 以及 FT 等),相信各人已经非常认识了。对于 vCenter Server 的安装和摆设,可能大部分人会选择使用 GUI 方式摆设 vCenter Server,并使用 vCenter Server ISO 镜像文件中的 \vcsa-ui-installer\win32\installer.exe 摆设步伐,如下图所示。摆设过程分为两个阶段,第一阶段设置并摆设 vCenter Server 的 OVA 虚拟机文件;第二阶段设置并启动 vCenter Server 虚拟机的服务。

其实,对于 vCenter Server 的摆设还支持 CLI 摆设方式,像我这种在实验室中经常需要安装删除 vCenter Server 环境的来说,可能更喜欢 CLI 自动化摆设方式,因为如许可以节约很多时间来做其他事情。如果你能了解 vCenter Server 的 GUI 摆设过程,那对于使用 CLI 的摆设方式应该也会非常简单。下面来看看如何使用 CLI 方式来摆设我们所需要的 vCenter Server 环境,涵盖了 GUI 摆设过程中的所有场景,更多内容和细节请查察 vCenter Server 产物文档
将 vCenter Server ISO 镜像文件挂载到当地虚拟机光驱 F 盘符上,可以看到 vCenter Server 安装镜像文件中包罗的所有文件,如下图所示。注,对于 vCenter Server 的 CLI 摆设将使用 PowerShell 方式执行,ISO 镜像文件基于 vCenter Server 8.0 U2b,内部版本号 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 虚拟机摆设在现有 vCenter Server 上。第一类通常是用于初始摆设,第二类是在已有 vSphere 环境的情况下进行摆设,后面将分别先容这几种 JSON 设置文件所代表的摆设场景。

先看一下 vcsa-deploy.exe 摆设步伐的下令帮助,CLI 方式同样可以实现安装(install)、升级(upgrade)以及迁移(migrate)等功能。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe --help
复制代码

使用以下下令可以查察 vCenter Server 支持的摆设大小以及对应的默认设置,可根据环境的情况自行选择哪种摆设选项。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe --supported-deployment-sizes
复制代码

如果对 JSON 设置文件中的哪个设置选项有疑问,可以使用以下下令查察 JSON 设置文件中关于设置选项的阐明。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install --template-help | more
复制代码

下面正式进入 CLI 摆设的设置过程,涉及到 vCenter Server 的多种摆设场景,不同的场景会使用到不同的 JSON 设置文件以及环境。
一、将 vCenter Server 虚拟机摆设到 ESXi 主机上

将 vCenter Server 虚拟机摆设到 ESXi 主机上,通常是 ESXi 主机上已经具有当地存储和网络端口组等环境信息,这种场景需要用到 vCenter Server 镜像文件中的 embedded_vCSA_on_ESXi.json 设置文件,根据这个设置文件修改为实际环境中的信息,示比方下:
  1. {
  2.     "__version": "2.13.0",
  3.     "__comments": "将 vCenter Server 虚拟机部署到 ESXi 主机上",
  4.     "new_vcsa": {
  5.         "esxi": {
  6.             "hostname": "192.168.32.51",
  7.             "username": "root",
  8.             "password": "vSphere8@password",
  9.             "deployment_network": "VM Network",
  10.             "datastore": "Datastore-01"
  11.         },
  12.         "appliance": {
  13.             "__comments": [
  14.                 "vCenter Server 部署参数"
  15.             ],
  16.             "thin_disk_mode": true,
  17.             "deployment_option": "tiny",
  18.             "name": "vcenter01"
  19.         },
  20.         "network": {
  21.             "ip_family": "ipv4",
  22.             "mode": "static",
  23.             "system_name": "vcenter01.mulab.local",
  24.             "ip": "192.168.32.55",
  25.             "prefix": "24",
  26.             "gateway": "192.168.32.254",
  27.             "dns_servers": [
  28.                 "192.168.32.3"
  29.             ]
  30.         },
  31.         "os": {
  32.             "password": "vSphere8@password",
  33.             "ntp_servers": "192.168.32.3",
  34.             "ssh_enable": true
  35.         },
  36.         "sso": {
  37.             "password": "vSphere8@password",
  38.             "domain_name": "vsphere.local"
  39.         }
  40.     },
  41.     "ceip": {
  42.         "description": {
  43.             "__comments": [
  44.                 "++++VMware Customer Experience Improvement Program (CEIP)++++",
  45.                 "VMware's Customer Experience Improvement Program (CEIP) ",
  46.                 "provides VMware with information that enables VMware to ",
  47.                 "improve its products and services, to fix problems, ",
  48.                 "and to advise you on how best to deploy and use our ",
  49.                 "products. As part of CEIP, VMware collects technical ",
  50.                 "information about your organization's use of VMware ",
  51.                 "products and services on a regular basis in association ",
  52.                 "with your organization's VMware license key(s). This ",
  53.                 "information does not personally identify any individual. ",
  54.                 "",
  55.                 "Additional information regarding the data collected ",
  56.                 "through CEIP and the purposes for which it is used by ",
  57.                 "VMware is set forth in the Trust & Assurance Center at ",
  58.                 "http://www.vmware.com/trustvmware/ceip.html . If you ",
  59.                 "prefer not to participate in VMware's CEIP for this ",
  60.                 "product, you should disable CEIP by setting ",
  61.                 "'ceip_enabled': false. You may join or leave VMware's ",
  62.                 "CEIP for this product at any time. Please confirm your ",
  63.                 "acknowledgement by passing in the parameter ",
  64.                 "--acknowledge-ceip in the command line.",
  65.                 "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  66.             ]
  67.         },
  68.         "settings": {
  69.             "ceip_enabled": false
  70.         }
  71.     }
  72. }
复制代码
另存为 deploy-on-esxi.json 设置文件到 files 文件夹,使用以下下令执行摆设前预查抄。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-esxi.json --accept-eula --no-ssl-certificate-verification --precheck-only
复制代码
如果 JSON 设置文件与摆设环境查抄成功,则会输出类似下面的内容。
  1. [SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters
  2. to deploy a vCenter Server Appliance' in TaskFlow 'deploy-on-esxi' at 09:03:06
  3. =================================== 09:03:07 ===================================
  4. Result and Log File Information...
  5. WorkFlow log directory:
  6. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-02-x2dv8gw0\workflow_1722934960074
复制代码
如果 JSON 设置文件与摆设环境查抄确定没问题,使用以下下令执行正式摆设。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-esxi.json --accept-eula --no-ssl-certificate-verification
复制代码
如果 vCenter Server 摆设成功,则会输出类似下面的内容。
  1. Successfully completed VCSA deployment.  VCSA Deployment Start Time:
  2. 2024-08-06T09:11:48.264Z VCSA Deployment End Time: 2024-08-06T09:33:42.921Z
  3. [SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring
  4. Deployment' in TaskFlow 'deploy-on-esxi' at 09:33:55
  5. Monitoring VCSA Deploy task completed
  6. == [START] Start executing Task: Join active domain if necessary at 09:33:56 ==
  7. Domain join task not applicable, skipping task
  8. [SUCCEEDED] Successfully executed Task 'Running deployment: Domain Join' in
  9. TaskFlow 'deploy-on-esxi' at 09:33:56
  10. [START] Start executing Task: Provide the login information about new
  11. appliance. at 09:33:56
  12.     Appliance Name: vcenter01
  13.     System Name: vcenter01.mulab.local
  14.     System IP: 192.168.32.55
  15.     Log in as: Administrator@vsphere.local
  16. [SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide
  17. appliance login information.' in TaskFlow 'deploy-on-esxi' at 09:33:56
  18. =================================== 09:33:57 ===================================
  19. Result and Log File Information...
  20. WorkFlow log directory:
  21. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-03-4auw6_e4\workflow_1722935032748
复制代码
登录 vCenter Server,查察摆设情况。

二、将 vCenter Server 虚拟机摆设到现有 vCenter Server 上

将 vCenter Server 虚拟机摆设到现有 vCenter Server 上,通常是当前环境中已经具有 vSphere 环境并想在之上摆设别的一套环境,这种场景需要用到 vCenter Server 镜像文件中的 embedded_vCSA_on_VC.json 设置文件,根据这个设置文件修改为实际环境中的信息,示比方下:
  1. {
  2.     "__version": "2.13.0",
  3.     "__comments": "将 vCenter Server 虚拟机部署到现有 vCenter Server 上",
  4.     "new_vcsa": {
  5.         "vc": {
  6.             "__comments": [
  7.                 "'datacenter' must end with a datacenter name, and only with a datacenter name.",
  8.                 "'target' must end with an ESXi hostname, a cluster name, or a resource pool name.",
  9.                 "The item 'Resources' must precede the resource pool name. ",
  10.                 "All names are case-sensitive. ",
  11.                 "For details and examples, refer to template help, i.e. vcsa-deploy {install|upgrade|migrate} --template-help"
  12.             ],
  13.             "hostname": "vcsa8-01.mulab.local",
  14.             "username": "administrator@vsphere.local",
  15.             "password": "vSphere8@password",
  16.             "deployment_network": "VM Network",
  17.             "datacenter": [
  18.                 "mulab"
  19.             ],
  20.             "datastore": "vsanDatastore",
  21.             "target": [
  22.                             "vsan8-hci-esa"
  23.             ]
  24.         },
  25.         "appliance": {
  26.             "__comments": [
  27.                 "vCenter Server 部署参数"
  28.             ],
  29.             "thin_disk_mode": true,
  30.             "deployment_option": "tiny",
  31.             "name": "vcenter02"
  32.         },
  33.         "network": {
  34.             "ip_family": "ipv4",
  35.             "mode": "static",
  36.             "system_name": "vcenter02.mulab.local",
  37.             "ip": "192.168.32.56",
  38.             "prefix": "24",
  39.             "gateway": "192.168.32.254",
  40.             "dns_servers": [
  41.                 "192.168.32.3"
  42.             ]
  43.         },
  44.         "os": {
  45.             "password": "vSphere8@password",
  46.             "ntp_servers": "192.168.32.3",
  47.             "ssh_enable": true
  48.         },
  49.         "sso": {
  50.             "password": "vSphere8@password",
  51.             "domain_name": "vsphere.local"
  52.         }
  53.     },
  54.     "ceip": {
  55.         "description": {
  56.             "__comments": [
  57.                 "++++VMware Customer Experience Improvement Program (CEIP)++++",
  58.                 "VMware's Customer Experience Improvement Program (CEIP) ",
  59.                 "provides VMware with information that enables VMware to ",
  60.                 "improve its products and services, to fix problems, ",
  61.                 "and to advise you on how best to deploy and use our ",
  62.                 "products. As part of CEIP, VMware collects technical ",
  63.                 "information about your organization's use of VMware ",
  64.                 "products and services on a regular basis in association ",
  65.                 "with your organization's VMware license key(s). This ",
  66.                 "information does not personally identify any individual. ",
  67.                 "",
  68.                 "Additional information regarding the data collected ",
  69.                 "through CEIP and the purposes for which it is used by ",
  70.                 "VMware is set forth in the Trust & Assurance Center at ",
  71.                 "http://www.vmware.com/trustvmware/ceip.html . If you ",
  72.                 "prefer not to participate in VMware's CEIP for this ",
  73.                 "product, you should disable CEIP by setting ",
  74.                 "'ceip_enabled': false. You may join or leave VMware's ",
  75.                 "CEIP for this product at any time. Please confirm your ",
  76.                 "acknowledgement by passing in the parameter ",
  77.                 "--acknowledge-ceip in the command line.",
  78.                 "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  79.             ]
  80.         },
  81.         "settings": {
  82.             "ceip_enabled": false
  83.         }
  84.     }
  85. }
复制代码
另存为 deploy-on-vcenter.json 设置文件到 files 文件夹,使用以下下令执行摆设前预查抄。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-vcenter.json --accept-eula --no-ssl-certificate-verification --precheck-only
复制代码
如果 JSON 设置文件与摆设环境查抄成功,则会输出类似下面的内容。
  1. [SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters
  2. to deploy a vCenter Server Appliance' in TaskFlow 'deploy-on-vcenter' at
  3. 09:05:55
  4. =================================== 09:05:56 ===================================
  5. Result and Log File Information...
  6. WorkFlow log directory:
  7. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-05-z39vgzmr\workflow_1722935126586
复制代码
如果 JSON 设置文件与摆设环境查抄确定没问题,使用以下下令执行正式摆设。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-on-vcenter.json --accept-eula --no-ssl-certificate-verification
复制代码
如果 vCenter Server 摆设成功,则会输出类似下面的内容。
  1. Successfully completed VCSA deployment.  VCSA Deployment Start Time:
  2. 2024-08-06T09:18:57.371Z VCSA Deployment End Time: 2024-08-06T09:47:03.177Z
  3. [SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring
  4. Deployment' in TaskFlow 'deploy-on-vcenter' at 09:47:27
  5. Monitoring VCSA Deploy task completed
  6. == [START] Start executing Task: Join active domain if necessary at 09:47:28 ==
  7. Domain join task not applicable, skipping task
  8. [SUCCEEDED] Successfully executed Task 'Running deployment: Domain Join' in
  9. TaskFlow 'deploy-on-vcenter' at 09:47:28
  10. [START] Start executing Task: Provide the login information about new
  11. appliance. at 09:47:29
  12.     Appliance Name: vcenter02
  13.     System Name: vcenter02.mulab.local
  14.     System IP: 192.168.32.56
  15.     Log in as: Administrator@vsphere.local
  16. [SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide
  17. appliance login information.' in TaskFlow 'deploy-on-vcenter' at 09:47:29
  18. =================================== 09:47:30 ===================================
  19. Result and Log File Information...
  20. WorkFlow log directory:
  21. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-06-42t35ek9\workflow_1722935200962
复制代码
登录 vCenter Server,查察摆设情况。

三、摆设多个 vCenter Server

前面两种场景分别是将 vCenter Server 摆设到 ESXi 主机或者现有 vCenter Server 上,针对前面两种情况,可能你有同时摆设多个 vCenter Server 环境的需求,可以将 embedded_vCSA_on_ESXi.json 或者 embedded_vCSA_on_VC.json 设置文件复制为多个 vCenter Server 的摆设设置文件,然后将这些文件放在同一个文件夹内(如 deploy-multiple-vcenter),摆设的时间指定这个文件夹即可同时摆设多个 vCenter Server 环境。

如果已经设置好了 JSON 设置文件并放在了同一文件夹(如 deploy-multiple-vcenter),使用以下下令执行摆设前预查抄。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-multiple-vcenter\ --accept-eula --no-ssl-certificate-verification --precheck-only
复制代码
如果文件夹中的 JSON 设置文件与摆设环境查抄确定没问题,使用以下下令执行正式摆设。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-multiple-vcenter\ --accept-eula --no-ssl-certificate-verification
复制代码
四、摆设具有增强型链接模式的 vCenter Server

增强型链接模式(ELM)就是将环境中的多个 vCenter Server 实例链接到一起并参加到同一个 SSO 域当中,当你通过 SSO 管理员登录到恣意一个 vCenter Server 的时间,可以同时看到链接的其他 vCenter Server,如许就可以实现多个 vCenter Server 实例的统一管理。可以查察这篇(使用cmsso-util下令进行链接、删除、修改多个vCenter Server(VCSA)的SSO域。)文章了解更多关于增强型链接模式 vCenter Server 的相关设置。
摆设具有增强型链接模式的 vCenter Server 虚拟机到 ESXi 主机上,需要用到 vCenter Server 镜像文件中的 embedded_vCSA_replication_on_ESXi.json 设置文件,根据这个设置文件修改为实际环境中的信息,示比方下:
  1. {
  2.     "__version": "2.13.0",
  3.     "__comments": "将具有增强型链接模式的 vCenter Server 虚拟机部署到 ESXi 主机上",
  4.     "new_vcsa": {
  5.         "esxi": {
  6.             "hostname": "192.168.32.51",
  7.             "username": "root",
  8.             "password": "vSphere8@password",
  9.             "deployment_network": "VM Network",
  10.             "datastore": "Datastore-01"
  11.         },
  12.         "appliance": {
  13.             "__comments": [
  14.                 "vCenter Server 部署参数"
  15.             ],
  16.             "thin_disk_mode": true,
  17.             "deployment_option": "tiny",
  18.             "name": "vcenter03"
  19.         },
  20.         "network": {
  21.             "ip_family": "ipv4",
  22.             "mode": "static",
  23.             "system_name": "vcenter03.mulab.local",
  24.             "ip": "192.168.32.57",
  25.             "prefix": "24",
  26.             "gateway": "192.168.32.254",
  27.             "dns_servers": [
  28.                 "192.168.32.3"
  29.             ]
  30.         },
  31.         "os": {
  32.             "password": "vSphere8@password",
  33.             "ntp_servers": "192.168.32.3",
  34.             "ssh_enable": true
  35.         },
  36.         "sso": {
  37.             "password": "vSphere8@password",
  38.             "domain_name": "vsphere.local",
  39.             "first_instance": false,
  40.             "replication_partner_hostname": "vcenter01.mulab.local",
  41.             "sso_port": 443
  42.         }
  43.     },
  44.     "ceip": {
  45.         "description": {
  46.             "__comments": [
  47.                 "++++VMware Customer Experience Improvement Program (CEIP)++++",
  48.                 "VMware's Customer Experience Improvement Program (CEIP) ",
  49.                 "provides VMware with information that enables VMware to ",
  50.                 "improve its products and services, to fix problems, ",
  51.                 "and to advise you on how best to deploy and use our ",
  52.                 "products. As part of CEIP, VMware collects technical ",
  53.                 "information about your organization's use of VMware ",
  54.                 "products and services on a regular basis in association ",
  55.                 "with your organization's VMware license key(s). This ",
  56.                 "information does not personally identify any individual. ",
  57.                 "",
  58.                 "Additional information regarding the data collected ",
  59.                 "through CEIP and the purposes for which it is used by ",
  60.                 "VMware is set forth in the Trust & Assurance Center at ",
  61.                 "http://www.vmware.com/trustvmware/ceip.html . If you ",
  62.                 "prefer not to participate in VMware's CEIP for this ",
  63.                 "product, you should disable CEIP by setting ",
  64.                 "'ceip_enabled': false. You may join or leave VMware's ",
  65.                 "CEIP for this product at any time. Please confirm your ",
  66.                 "acknowledgement by passing in the parameter ",
  67.                 "--acknowledge-ceip in the command line.",
  68.                 "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  69.             ]
  70.         },
  71.         "settings": {
  72.             "ceip_enabled": false
  73.         }
  74.     }
  75. }
复制代码
另存为 deploy-elm-on-esxi.json 设置文件到 files 文件夹,使用以下下令执行摆设前预查抄。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-elm-on-esxi.json --accept-eula --no-ssl-certificate-verification --precheck-only
复制代码
如果 JSON 设置文件与摆设环境查抄成功,则会输出类似下面的内容。
  1. [SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters
  2. to deploy a vCenter Server Appliance' in TaskFlow 'deploy-elm-on-esxi' at
  3. 09:42:46
  4. =================================== 09:42:46 ===================================
  5. Result and Log File Information...
  6. WorkFlow log directory:
  7. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-42-qzp_kn0v\workflow_1722937339642
复制代码
如果 JSON 设置文件与摆设环境查抄确定没问题,使用以下下令执行正式摆设。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-elm-on-esxi.json --accept-eula --no-ssl-certificate-verification
复制代码
如果 vCenter Server 摆设成功,则会输出类似下面的内容。
  1. Successfully completed VCSA deployment.  VCSA Deployment Start Time:
  2. 2024-08-06T09:52:23.624Z VCSA Deployment End Time: 2024-08-06T10:15:36.574Z
  3. [SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring
  4. Deployment' in TaskFlow 'deploy-elm-on-esxi' at 10:16:03
  5. Monitoring VCSA Deploy task completed
  6. == [START] Start executing Task: Join active domain if necessary at 10:16:04 ==
  7. Domain join task not applicable, skipping task
  8. [SUCCEEDED] Successfully executed Task 'Running deployment: Domain Join' in
  9. TaskFlow 'deploy-elm-on-esxi' at 10:16:04
  10. [START] Start executing Task: Provide the login information about new
  11. appliance. at 10:16:05
  12.     Appliance Name: vcenter03
  13.     System Name: vcenter03.mulab.local
  14.     System IP: 192.168.32.57
  15.     Log in as: Administrator@vsphere.local
  16. [SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide
  17. appliance login information.' in TaskFlow 'deploy-elm-on-esxi' at 10:16:05
  18. =================================== 10:16:05 ===================================
  19. Result and Log File Information...
  20. WorkFlow log directory:
  21. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-44-5l_hhkqk\workflow_1722937468472
复制代码
登录 vCenter Server,查察摆设情况。

摆设具有增强型链接模式的 vCenter Server 虚拟机到现有 vCenter Server 上,需要用到 vCenter Server 镜像文件中的 embedded_vCSA_replication_on_VC.json 设置文件,根据这个设置文件修改为实际环境中的信息,示比方下:
  1. {
  2.     "__version": "2.13.0",
  3.     "__comments": "将具有增强型链接模式的 vCenter Server 虚拟机部署到现有 vCenter Server 上",
  4.     "new_vcsa": {
  5.         "vc": {
  6.             "__comments": [
  7.                 "'datacenter' must end with a datacenter name, and only with a datacenter name.",
  8.                 "'target' must end with an ESXi hostname, a cluster name, or a resource pool name.",
  9.                 "The item 'Resources' must precede the resource pool name. ",
  10.                 "All names are case-sensitive. ",
  11.                 "For details and examples, refer to template help, i.e. vcsa-deploy {install|upgrade|migrate} --template-help"
  12.             ],
  13.             "hostname": "vcsa8-01.mulab.local",
  14.             "username": "administrator@vsphere.local",
  15.             "password": "vSphere8@password",
  16.             "deployment_network": "VM Network",
  17.             "datacenter": [
  18.                 "mulab"
  19.             ],
  20.             "datastore": "vsanDatastore",
  21.             "target": [
  22.                             "vsan8-hci-esa"
  23.             ]
  24.         },
  25.         "appliance": {
  26.             "__comments": [
  27.                 "vCenter Server 部署参数"
  28.             ],
  29.             "thin_disk_mode": true,
  30.             "deployment_option": "tiny",
  31.             "name": "vcenter04"
  32.         },
  33.         "network": {
  34.             "ip_family": "ipv4",
  35.             "mode": "static",
  36.             "system_name": "vcenter04.mulab.local",
  37.             "ip": "192.168.32.58",
  38.             "prefix": "24",
  39.             "gateway": "192.168.32.254",
  40.             "dns_servers": [
  41.                 "192.168.32.3"
  42.             ]
  43.         },
  44.         "os": {
  45.             "password": "vSphere8@password",
  46.             "ntp_servers": "192.168.32.3",
  47.             "ssh_enable": true
  48.         },
  49.         "sso": {
  50.             "password": "vSphere8@password",
  51.             "domain_name": "vsphere.local",
  52.             "first_instance": false,
  53.             "replication_partner_hostname": "vcenter02.mulab.local",
  54.             "sso_port": 443
  55.         }
  56.     },
  57.     "ceip": {
  58.         "description": {
  59.             "__comments": [
  60.                 "++++VMware Customer Experience Improvement Program (CEIP)++++",
  61.                 "VMware's Customer Experience Improvement Program (CEIP) ",
  62.                 "provides VMware with information that enables VMware to ",
  63.                 "improve its products and services, to fix problems, ",
  64.                 "and to advise you on how best to deploy and use our ",
  65.                 "products. As part of CEIP, VMware collects technical ",
  66.                 "information about your organization's use of VMware ",
  67.                 "products and services on a regular basis in association ",
  68.                 "with your organization's VMware license key(s). This ",
  69.                 "information does not personally identify any individual. ",
  70.                 "",
  71.                 "Additional information regarding the data collected ",
  72.                 "through CEIP and the purposes for which it is used by ",
  73.                 "VMware is set forth in the Trust & Assurance Center at ",
  74.                 "http://www.vmware.com/trustvmware/ceip.html . If you ",
  75.                 "prefer not to participate in VMware's CEIP for this ",
  76.                 "product, you should disable CEIP by setting ",
  77.                 "'ceip_enabled': false. You may join or leave VMware's ",
  78.                 "CEIP for this product at any time. Please confirm your ",
  79.                 "acknowledgement by passing in the parameter ",
  80.                 "--acknowledge-ceip in the command line.",
  81.                 "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  82.             ]
  83.         },
  84.         "settings": {
  85.             "ceip_enabled": false
  86.         }
  87.     }
  88. }
复制代码
另存为 deploy-elm-on-vcenter.json 设置文件到 files 文件夹,使用以下下令执行摆设前预查抄。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-elm-on-vcenter.json --accept-eula --no-ssl-certificate-verification --precheck-only
复制代码
如果 JSON 设置文件与摆设环境查抄成功,则会输出类似下面的内容。
  1. [SUCCEEDED] Successfully executed Task 'Precheck ovftool commandline parameters
  2. to deploy a vCenter Server Appliance' in TaskFlow 'deploy-elm-on-vcenter' at
  3. 09:55:12
  4. =================================== 09:55:13 ===================================
  5. Result and Log File Information...
  6. WorkFlow log directory:
  7. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-54-lps7j7v1\workflow_1722938084996
复制代码
如果 JSON 设置文件与摆设环境查抄确定没问题,使用以下下令执行正式摆设。
  1. F:\vcsa-cli-installer\win32\vcsa-deploy.exe install .\files\deploy-elm-on-vcenter.json --accept-eula --no-ssl-certificate-verification
复制代码
如果 vCenter Server 摆设成功,则会输出类似下面的内容。
  1. [SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring
  2. Deployment' in TaskFlow 'deploy-elm-on-vcenter' at 10:35:50
  3. Monitoring VCSA Deploy task completed
  4. == [START] Start executing Task: Join active domain if necessary at 10:35:51 ==
  5. Domain join task not applicable, skipping task
  6. [SUCCEEDED] Successfully executed Task 'Running deployment: Domain Join' in
  7. TaskFlow 'deploy-elm-on-vcenter' at 10:35:51
  8. [START] Start executing Task: Provide the login information about new
  9. appliance. at 10:35:52
  10.     Appliance Name: vcenter04
  11.     System Name: vcenter04.mulab.local
  12.     System IP: 192.168.32.58
  13.     Log in as: Administrator@vsphere.local
  14. [SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide
  15. appliance login information.' in TaskFlow 'deploy-elm-on-vcenter' at 10:35:52
  16. =================================== 10:35:52 ===================================
  17. Result and Log File Information...
  18. WorkFlow log directory:
  19. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-09-56-8s9_eg18\workflow_1722938163017
复制代码
登录 vCenter Server,查察摆设情况。

摆设具有增强型链接模式 vCenter Server 的时间,可能大部分情况是环境中已经有第一个 vCenter Server 了,然后再使用上面所述的方式摆设第二个 vCenter Server 并将其链接到第一个 vCenter Server 中。其实,如果环境中没有第一个 vCenter Server 的时间,也可以同时摆设增强型链接模式的 vCenter Server,好比,deploy-vcenter01-on-esxi.json 设置文件用于摆设第一个 vCenter Server,deploy-vcenter01-elm-on-esxi.json 设置文件用于摆设具有增强型链接模式的第二个 vCenter Server,将这两个 JSON 设置文件放在同一文件夹中,在摆设的时间指定这个文件夹,如许 CLI 摆设完第一个 vCenter Server 后,然后当第二个 vCenter Server 摆设的时间就会自动链接到第一个 vCenter Server 中去。

五、将 vCenter Server 虚拟机摆设到 ESXi 主机上并设置单节点 vSAN ESA 集群

对于初始构建 vSphere 环境的用户来说,可能 ESXi 主机安装摆设以后,想直接将 ESXi 主机应用于 vSAN 环境,同时又想将 vSAN 存储用于承载 vCenter Server。如果使用以上所述场景,摆设 vCenter Server 的前提是环境中必须具有效于存放 vCenter Server 的当地/共享存储,但是,VMware 这里提供了一种方式,在摆设 vCenter Server 之前,可以直接将初始安装的 ESXi 主机转换成 vSAN 集群的第一台主机,如许设置为单节点 vSAN 集群后,再将设置后的 vSAN 存储用于承载 vCenter Server 虚拟机所使用的存储。如果是如许,就不用单独先设置 ESXi 主机的当地/共享存储用于摆设 vCenter Server 了,这也是 VMware 很多解决方案所使用的方式,好比 VMware Cloud Foundation。
将 vCenter Server 虚拟机摆设到 ESXi 主机上并设置单节点 vSAN ESA 集群,需要用到 vCenter Server 镜像文件中的 vCSA_with_cluster_on_ESXi.json 设置文件,根据这个设置文件修改为实际环境中的信息,示比方下:
  1. {
  2.     "__version": "2.13.0",
  3.     "__comments": "将 vCenter Server 虚拟机部署到 ESXi 主机上并配置单节点 vSAN ESA 集群",
  4.     "new_vcsa": {
  5.         "esxi": {
  6.             "hostname": "esxi.mulab.local",
  7.             "username": "root",
  8.             "password": "vSphere8@password",
  9.             "deployment_network": "VM Network",
  10.             "VCSA_cluster": {
  11.                 "__comments": [
  12.                     "Optional section. You must provide this option if you want to create the vSAN bootstrap cluster"
  13.                 ],
  14.                 "datacenter": "datacenter",
  15.                 "cluster": "vsan-esa",
  16.                 "compression_only": false,
  17.                 "deduplication_and_compression": false,
  18.                 "enable_vlcm": true,
  19.                 "enable_vsan_esa": true,
  20.                 "storage_pool": {
  21.                     "single_tier": [
  22.                         "0654f79de904b1744a000c29669162b236",
  23.                         "063ec1878a6b90d657000c296a1c16f648"
  24.                     ]
  25.                 },
  26.                 "vsan_hcl_database_path": "all.json"
  27.             }
  28.         },
  29.         "appliance": {
  30.             "__comments": [
  31.                 "vCenter Server 部署参数"
  32.             ],
  33.             "thin_disk_mode": true,
  34.             "deployment_option": "small",
  35.             "name": "vcenter"
  36.         },
  37.         "network": {
  38.             "ip_family": "ipv4",
  39.             "mode": "static",
  40.             "ip": "192.168.32.50",
  41.             "dns_servers": [
  42.                 "192.168.32.3"
  43.             ],
  44.             "prefix": "24",
  45.             "gateway": "192.168.32.254",
  46.             "system_name": "vcenter.mulab.local"
  47.         },
  48.         "os": {
  49.             "password": "vSphere8@password",
  50.             "ntp_servers": "192.168.32.3",
  51.             "ssh_enable": true
  52.         },
  53.         "sso": {
  54.             "password": "vSphere8@password",
  55.             "domain_name": "vsphere.local"
  56.         }
  57.     },
  58.     "ceip": {
  59.         "description": {
  60.             "__comments": [
  61.                 "++++VMware Customer Experience Improvement Program (CEIP)++++",
  62.                 "VMware's Customer Experience Improvement Program (CEIP) ",
  63.                 "provides VMware with information that enables VMware to ",
  64.                 "improve its products and services, to fix problems, ",
  65.                 "and to advise you on how best to deploy and use our ",
  66.                 "products. As part of CEIP, VMware collects technical ",
  67.                 "information about your organization's use of VMware ",
  68.                 "products and services on a regular basis in association ",
  69.                 "with your organization's VMware license key(s). This ",
  70.                 "information does not personally identify any individual. ",
  71.                 "",
  72.                 "Additional information regarding the data collected ",
  73.                 "through CEIP and the purposes for which it is used by ",
  74.                 "VMware is set forth in the Trust & Assurance Center at ",
  75.                 "http://www.vmware.com/trustvmware/ceip.html . If you ",
  76.                 "prefer not to participate in VMware's CEIP for this ",
  77.                 "product, you should disable CEIP by setting ",
  78.                 "'ceip_enabled': false. You may join or leave VMware's ",
  79.                 "CEIP for this product at any time. Please confirm your ",
  80.                 "acknowledgement by passing in the parameter ",
  81.                 "--acknowledge-ceip in the command line.",
  82.                 "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  83.             ]
  84.         },
  85.         "settings": {
  86.             "ceip_enabled": false
  87.         }
  88.     }
  89. }
复制代码
JSON 设置文件中,关于 ESXi 主机用于 vSAN 存储池的硬盘信息可以在下图所示的地方获取。注意,由于是摆设 vSAN ESA 环境,需要下载 vSAN HCL 文件到当地,并将文件的路径填入到对应的 JSON 设置文件当中,当前摆设环境将 vSAN HCL 文件放在了运行 CLI 下令的当前目录(C:\Users\JUNIOR_MU\)。

另存为 deploy-on-esxi-with-vsan-esa.json 设置文件到 files 文件夹,使用以下下令执行摆设前预查抄。
  1. 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 设置文件与摆设环境查抄成功,则会输出类似下面的内容。
  1. [SUCCEEDED] Successfully executed Task 'Running Pre-check: vSAN Cluster Health
  2. Checks.' in TaskFlow 'install' at 10:53:30
  3. Running Pre-check: vSphere vLCM Cluster Enablement.
  4. [START] Start executing Task: Running Pre-check for vSphere vLCM Cluster
  5. Enablement. at 10:53:30
  6. [SUCCEEDED] Successfully executed Task 'Running Pre-check: vSphere vLCM Cluster
  7. Enablement.' in TaskFlow 'install' at 10:53:30
  8. [SUCCEEDED] Successfully executed Task 'PrecheckTask: Running prechecks.' in
  9. TaskFlow 'deploy-on-esxi-with-vsan-esa' at 10:53:30
  10. vcsa-deploy execution successfully completed, workflow log dir:
  11. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-10-52-j1nef3kt\workflow_1722941536363
  12. =================================== 10:53:31 ===================================
  13. Result and Log File Information...
  14. WorkFlow log directory:
  15. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-10-52-j1nef3kt\workflow_1722941536363
复制代码
如果 JSON 设置文件与摆设环境查抄确定没问题,使用以下下令执行正式摆设。
  1. 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 摆设成功,则会输出类似下面的内容。
  1. Successfully completed VCSA deployment.  VCSA Deployment Start Time:
  2. 2024-08-06T11:12:39.139Z VCSA Deployment End Time: 2024-08-06T11:31:05.857Z
  3. [SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring
  4. Deployment' in TaskFlow 'deploy-on-esxi-with-vsan-esa' at 11:31:19
  5. Monitoring VCSA Deploy task completed
  6. == [START] Start executing Task: Join active domain if necessary at 11:31:20 ==
  7. Domain join task not applicable, skipping task
  8. [SUCCEEDED] Successfully executed Task 'Running deployment: Domain Join' in
  9. TaskFlow 'deploy-on-esxi-with-vsan-esa' at 11:31:20
  10. ==== [START] Start executing Task: Creating the new datacenter. at 11:31:21 ====
  11. The certificate of server 'vcenter.mulab.local' will not be verified because you
  12. have provided either the '--no-ssl-certificate-verification' or
  13. '--no-esx-ssl-verify' command parameter, which disables verification for all
  14. certificates. Remove this parameter from the command line if you want server
  15. certificates to be verified.
  16. [SUCCEEDED] Successfully executed Task 'Running Datacenter Creation: Creating
  17. the new datacenter for vSphere vLCM managed cluster.' in TaskFlow
  18. 'deploy-on-esxi-with-vsan-esa' at 11:31:23
  19. [START] Start executing Task: Creating vSphere vLCM managed cluster. at
  20. 11:31:24
  21. Enabling vLCM Cluster creation task on vcenter.mulab.local
  22. Running ExecuteClusterHostSeedingWorkflow...
  23. [SUCCEEDED] Successfully executed Task 'Running vSphere vLCM: Creating vSphere
  24. vLCM managed cluster.' in TaskFlow 'deploy-on-esxi-with-vsan-esa' at 11:35:44
  25. [START] Start executing Task: Provide the login information about new
  26. appliance. at 11:35:45
  27.     Appliance Name: vcenter
  28.     System Name: vcenter.mulab.local
  29.     System IP: 192.168.32.50
  30.     Log in as: Administrator@vsphere.local
  31. Your vCenter Server Appliance is deployed on a vSAN cluster. However this
  32. one-host cluster must be further configured in order to provide the full
  33. benefits of a vSAN cluster.
  34. vSAN Configuration Instructions
  35. 1.       Add additional hosts to the vSAN cluster (a minimum of two).
  36. 2.       Complete the required configuration of the vSAN cluster.
  37. 3.       Apply the correct VM Storage Policy to the vCenter Server Appliance.
  38. [SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide
  39. appliance login information.' in TaskFlow 'deploy-on-esxi-with-vsan-esa' at
  40. 11:35:45
  41. =================================== 11:35:46 ===================================
  42. Result and Log File Information...
  43. WorkFlow log directory:
  44. C:\Users\JUNIOR~1\AppData\Local\Temp\vcsaCliInstaller-2024-08-06-11-00-u9zayc8j\workflow_1722942009531
复制代码
登录 vCenter Server,查察摆设情况。

当前是单节点 vSAN 集群,需要增长 ESXi 主机以满足 vSAN 集群最少主机要求(3台)。

vSAN 存储容量以及当前默认存储计谋设置。

vSAN ESA 集群 ESXi 主机磁盘设置。

vSAN ESA 集群 ESXi 主机网络设置,需要添加设置用于 vSAN 流量的 vmkernel 网卡。

设置好完整的 vSAN 集群后,请将 vCenter Server 的计谋调整为 vSAN 存储计谋。


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

王柳

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表