以前に vSphere 6.5 の vCSA をインストールする というメモを書きました。 このメモでは vCSA を GUI からインストールする手順をメモしていますが、vCSA は Windows, macOS, Linux の CLI からデプロイすることも出来ます。 今回は CLI からのデプロイ手順をメモしておきます。 尚、今回は Linux の CLI で作業し、vSphere のバージョンは 7.0U2 を利用する前提とします。
後述する 7.0U2 用のパラメータを定義する JSON はバージョン 2.13.0 のようですが、これは vSphere のバージョンが異なると必ずしも互換性があるとは限らないようですので、注意が必要です。
vCSA イメージのマウント
まず vCSA の ISO イメージをマウントします。
mount -t iso9660 -o loop VMware-VCSA-all-7.0.2-18356314.iso /mnt/
パラメータ用 JSON ファイルの用意
vCSA のデプロイには予め、必要なパラメータを記載した JSON ファイルを用意します。 作りたい構成ごとの JSON ファイルのサンプルは vCSA イメージをマウントしたディレクトリ以下の vcsa-cli-installer/templates/install/
に存在します。
# ls -l /mnt/vcsa-cli-installer/templates/install/
total 40
-r-xr-xr-x 1 root root 4586 Sep 17 23:03 embedded_vCSA_on_ESXi.json
-r-xr-xr-x 1 root root 5626 Sep 17 23:03 embedded_vCSA_on_VC.json
-r-xr-xr-x 1 root root 4809 Sep 17 23:03 embedded_vCSA_replication_on_ESXi.json
-r-xr-xr-x 1 root root 5849 Sep 17 23:03 embedded_vCSA_replication_on_VC.json
-r-xr-xr-x 1 root root 5396 Sep 17 23:03 vCSA_with_cluster_on_ESXi.json
今回は embedded_vCSA_on_ESXi.json
をテンプレートとして利用することにします。 テンプレートを編集可能なディレクトリにコピーします。
cp /mnt/vcsa-cli-installer/templates/install/embedded_vCSA_on_ESXi.json ~/
パラメータ
今回は以下のパラメータで設定するものとします。 尚、各値の詳細は デプロイ構成パラメータ で参照出来ます。
ESXi
Property | Value | Description |
---|---|---|
hostname | 10.0.0.1 | vCSA をデプロイする ESXi のアドレス |
username | root | ESXi のユーザ名 |
password | PASS-ESXi | ESXi のパスワード |
deployment_network | VM Network | vCSA をデプロイするポートグループ |
datastore | datastore1 | vCSA を保存するデータストア |
Appliance
Property | Value | Description |
---|---|---|
thin_disk_mode | true | ストレージを Thin ディスクにするか |
deployment_option | small | デプロイする仮想マシンのりソーズ割当の量 |
name | vCSA | ESXi / vCSA 上に表示する仮想マシン名 |
Network
Property | Value | Description |
---|---|---|
ip_family | ipv4 | 管理用アドレスの IP バージョン |
mode | static | 静的アドレスか、動的アドレス (DHCP) を利用するか |
ip | 10.0.0.100 | vCSA へ割り当てる IP アドレス |
prefix | 24 | vCSA へ割り当てるプリフィックス長 |
gateway | 10.0.0.254 | vCSA へ割り当てるゲートウェイ |
dns_servers | 1.1.1.1, 1.0.0.1 | vCSA へ割り当てる DNS サーバ |
OS
Property | Value | Description |
---|---|---|
password | PASS-OS | vCSA の root ユーザ用パスワード |
ntp_servers | 216.239.35.12,216.239.35.8 | vCSA へ割り当てる NTP サーバ |
ssh_enable | true | vCSA へ SSH を有効化するか、否か |
SSO
Property | Value | Description |
---|---|---|
password | PASS-SSO | vCSA の WebUI からログインする際のパスワード |
domain_name | vsphere.local | vCSA の WebUI からログインする際のドメイン名 |
実際の JSON
これらのパラメータの場合、JSON ファイルは以下のようになります。
{
"__version": "2.13.0",
"__comments": "",
"new_vcsa": {
"esxi": {
"hostname": "10.0.0.1",
"username": "root",
"password": "PASS-ESXi",
"deployment_network": "VM Network",
"datastore": "datastore1"
},
"appliance": {
"__comments": [
""
],
"thin_disk_mode": true,
"deployment_option": "small",
"name": "vCSA"
},
"network": {
"ip_family": "ipv4",
"mode": "static",
"system_name": "10.0.0.100",
"ip": "10.0.0.100",
"prefix": "24",
"gateway": "10.0.0.254",
"dns_servers": [
"1.1.1.1",
"1.0.0.1"
]
},
"os": {
"password": "PASS-OS",
"ntp_servers": [
"216.239.35.12",
"216.239.35.8"
],
"ssh_enable": true
},
"sso": {
"password": "PASS-SSO",
"domain_name": "vsphere.local"
}
},
"ceip": {
"description": {
"__comments": [
""
]
},
"settings": {
"ceip_enabled": false
}
}
}
deployment_option に指定可能な値
deployment_option
に指定可能な値は vcsa-deploy --supported-deployment-sizes
で確認出来ます。 実行例は以下の通りです。 今回のサンプルでは small
を指定しています。
# ~/vcsa/vcsa-cli-installer/lin64/vcsa-deploy --supported-deployment-sizes
Information about deployment sizes:
Options vCPUs Memory(GB) Storage(GB) Hosts(up to) VMs(up to)
--------------------------------------------------------------------------------
tiny 2 12 463 10 100
tiny-lstorage 2 12 1538 10 100
tiny-xlstorage 2 12 3293 10 100
small 4 19 528 100 1000
small-lstorage 4 19 1583 100 1000
small-xlstorage 4 19 3343 100 1000
medium 8 28 748 400 4000
medium-lstorage 8 28 1748 400 4000
medium-xlstorage 8 28 3508 400 4000
large 16 37 1113 1000 10000
large-lstorage 16 37 1813 1000 10000
large-xlstorage 16 37 3573 1000 10000
xlarge 24 56 1853 2000 35000
xlarge-lstorage 24 56 1953 2000 35000
xlarge-xlstorage 24 56 3713 2000 35000
デプロイ
実際のデプロイは vcsa-deploy
というバイナリを利用します。 OS 毎に異なりますが、Linux の場合は以下のように実行します。 実行 〜 完了までは GUI の場合と同様、かなり時間がかかります。 環境 / スペックに依存すると思いますが、私の環境では約 30 分程度かかりました。
/mnt/vcsa-cli-installer/lin64/vcsa-deploy install \
--accept-eula \
--no-esx-ssl-verify \
~/embedded_vCSA_on_ESXi.json
参考
vcsa-cli-installer/templates/install/embedded_vCSA_on_ESXi.json
{
"__version": "2.13.0",
"__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": {
"__comments": [
"You must provide the 'deployment_option' key with a value, which will affect the vCenter Server Appliance's configuration parameters, such as the vCenter Server Appliance's number of vCPUs, the memory size, the storage size, and the maximum numbers of ESXi hosts and VMs which can be managed. For a list of acceptable values, run the supported deployment sizes help, i.e. vcsa-deploy --supported-deployment-sizes"
],
"thin_disk_mode": true,
"deployment_option": "small",
"name": "Embedded-vCenter-Server-Appliance"
},
"network": {
"ip_family": "ipv4",
"mode": "static",
"system_name": "<FQDN or IP address for the appliance. Optional when the mode is Static. Remove this if using dhcp.>",
"ip": "<Static 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.>",
"dns_servers": [
"<DNS Server IP Address. Optional when the mode is Static. 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.>",
"ntp_servers": "time.nist.gov",
"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"
}
},
"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
}
}
}
コメント