Instalasi vCenter Server 6.7 via CLI

Secara default, instalasi vCenter Server versi 6.7 sangat mudah dilakukan via GUI, baik melalui sistem operasi Windows, Linux maupun Mac. Meski demikian, adakalanya kita perlu unattended install, yang bisa dengan mudah dilakukan secara remote via akses Command Line Interface (CLI).

Berikut adalah proses untuk melakukan instalasi vCenter Server 6.7 melalui CLI :

PERSIAPAN

  1. Siapkan file ISO vCenter Server Appliance (vCSA) versi 6.7. Bisa didownload pada website VMware atau bisa juga melalui mirror Excellent
  2. Buat A dan PTR Records pada DNS server yang digunakan. Misalnya vCenter yang dibuat akan menggunakan nama vc-student1.excellent.co.id dengan IP 192.168.100.151
  3. 1 buah vSphere ESXi dengan minimal RAM 16 GB untuk menampung vCenter Appliance. vCenter memiliki beberapa pilihan deployment size dan tipe tiny membutuhkan RAM 10 GB dengan 2 vCPU. Berikut adalah tabel untuk deployment size vCenter Server Appliance selengkapnya

INSTALASI

Setelah persiapan diatas dilakukan, tahap selanjutnya adalah melakukan mounting file ISO dan melakukan proses edit file json yang diinginkan. Cara berikut menggunakan sistem Linux SUSE, namun perintah pada sistem Linux Ubuntu, Red Hat, CentOS dan lainnya relatif sama.

mkdir /srv/vcsa
mount -o loop VMware-VCSA-all-6.7.0-10244745.iso /srv/vcsa
cd /srv/vcsa/vcsa-cli-installer/templates/install/
cp /srv/vcsa/vcsa-cli-installer/templates/install/embedded_vCSA_on_ESXi.json /srv/vcsa67.json
List file template install vCenter

Pada folder /srv/vcsa/vcsa-cli-installer/templates/install/ terdapat beberapa file json yang bisa digunakan sebagai template install. Karena mekanisme yang akan dilakukan adalah install vCenter berikut dengan embedded Platform Services Controller (PSC), maka saya memilih template embedded_vCSA_on_ESXi.json dan menyalinnya ke folder terpisah (dalam hal ini folder /srv/ dengan nama vcsa67.json.

Buka file tersebut dan lakukan pengubahan pada pilihan yang sesuai. Berikut adalah contoh file json yang sudah disesuaikan :

{
    "__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": "192.168.100.3",
            "username": "root",
            "password": "VerySecretPasswd234!",
            "deployment_network": "VM Network",
            "datastore": "dssata3tb"
        },
        "appliance": {
            "__comments": [
                "You must provide the 'deployment_option' key with a value, which will affect the VCSA's configuration parameters, such as the VCSA'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": "tiny",
            "name": "192.168.100.151-vc67-student1.excellent.co.id"
        },
        "network": {
            "ip_family": "ipv4",
            "mode": "static",
            "ip": "192.168.100.151",
            "dns_servers": [
                "192.168.80.254"
            ],
            "prefix": "24",
            "gateway": "192.168.100.1",
            "system_name": "vc67-student1.excellent.co.id"
        },
        "os": {
            "password": "VerySecretPasswd234!",
            "ntp_servers": "0.id.pool.ntp.org",
            "ssh_enable": true
        },
        "sso": {
            "password": "VerySecretPasswd234!",
            "domain_name": "excellent.co.id"
        }
    },
    "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
        }
    }

Jangan lupa sesuaikan IP, subnet, user name, password dan nama storage yang akan digunakan. Setelah selesai menyesuaikannya, simpan file tersebut, masuk ke folder installer (lin64 karena pakai Linux) dan test validasi dengan perintah sebagai berikut :

cd /srv/vcsa/vcsa-cli-installer/lin64
./vcsa-deploy install --verify-template-only /srv/vcsa67.json

Jika ada hasil yang failed, check kembali sesuai pesan yang muncul. Jika hasilnya SUCCEEDED berarti bisa melakukan deployment lebih lanjut. Contoh tampilan pengecekan yang berhasil seperti berikut :

Template version processing for template '/srv/vcsa67.json' succeeded.
Version processing for all templates succeeded.
 [SUCCEEDED] Successfully executed Task 'VersionProcessingTask: Executing Template Version Processing task' in TaskFlow
'template_validation' at 12:43:51
 [START] Start executing Task: To validate the template structure against the rules specified by a corresponding template schema. at
12:43:51
Template structure validation for template '/srv/vcsa67.json' succeeded.
Structure validation for all templates succeeded.
 [SUCCEEDED] Successfully executed Task 'StructureValidationTask: Executing Template Structure Validation task' in TaskFlow
'template_validation' at 12:43:51
 [START] Start executing Task: To create a dependency graph for the provided templates, with an edge pairing two templates that are
dependent on each other. Such graph relationships will affect whether certain templates can be deployed in parallel, or must be deployed
sequentially. at 12:43:51
Dependency processing for all templates succeeded.
 [SUCCEEDED] Successfully executed Task 'DependencyProcessingTask: Executing Template Dependency Processing task' in TaskFlow
'template_validation' at 12:43:51
Template verification completed.
================================================================ 12:43:51 ================================================================
Result and Log File Information...
WorkFlow log directory: /tmp/vcsaCliInstaller-2019-01-03-12-43-55n7937q/workflow_1546519431216

Untuk menjalankan proses instalasi, jalankan perintah sebagai berikut :

screen -S install-vcsa
./vcsa-deploy install /srv/vcsa67.json --accept-eula

Perintah screen -S install-vcsa adalah perintah agar Linux menjalankan script installer diatas dalam modus screen terpisah. Jika satu waktu koneksi terputus, kita bisa memanggil screen tersebut dengan perintah : screen -x sehingga tidak kehilangan jejak proses install.

Setelah beberapa saat, proses deployment dan konfigurasi otomatis selesai dilakukan dengan contoh tampilan log sebagai berikut :

VCSA Deployment is still running
==========VCSA Deployment Progress Report==========         Task: Install required RPMs for the appliance.(SUCCEEDED 100/100)       - Task
has completed successfully.         Task: Run firstboot scripts.(RUNNING 73/100)    - Starting VMware Update Manager...
VCSA Deployment is still running
==========VCSA Deployment Progress Report==========         Task: Install required RPMs for the appliance.(SUCCEEDED 100/100)       - Task
has completed successfully.         Task: Run firstboot scripts.(RUNNING 84/100)    - Starting VMware VSAN Health Service...
VCSA Deployment is still running
==========VCSA Deployment Progress Report==========         Task: Install required RPMs for the appliance.(SUCCEEDED 100/100)       - Task
has completed successfully.         Task: Run firstboot scripts.(RUNNING 97/100)    - Starting VMware Performance Charts...
VCSA Deployment is still running
==========VCSA Deployment Progress Report==========         Task: Install required RPMs for the appliance.(SUCCEEDED 100/100)       - Task
has completed successfully.         Task: Run firstboot scripts.(SUCCEEDED 100/100) - Task has completed successfully.
Successfully completed VCSA deployment.  VCSA Deployment Start Time: 2018-12-31T06:35:08.656Z VCSA Deployment End Time:
2018-12-31T06:50:44.118Z
== [SUCCEEDED] Successfully executed Task 'MonitorDeploymentTask: Monitoring Deployment' in TaskFlow 'embedded_vCSA_on_ESXi' at 06:50:58 ==
Monitoring VCSA Deploy task completed
====================== [START] Start executing Task: Provide the login information about new appliance. at 06:50:58 ======================
    Appliance Name: 192.168.100.151-vc67-student1.excellent.co.id
    System Name: vc67-student1.excellent.co.id
    System IP: 192.168.100.151
    Log in as: Administrator@excellent.co.id
 [SUCCEEDED] Successfully executed Task 'ApplianceLoginSummaryTask: Provide appliance login information.' in TaskFlow
'embedded_vCSA_on_ESXi' at 06:50:58
================================================================ 06:50:59 ================================================================
Result and Log File Information...
WorkFlow log directory: /tmp/vcsaCliInstaller-2018-12-31-06-32-o3xw9kij/workflow_1546237928755

Jika sudah selesai, vCenter bisa diakses dengan model akses, yaitu :

  1. Dashboard administrasi port 5480 SSL, https://vc67-student1.excellent.co.id:5480
  2. Dashboard vCenter untuk manajemen vSphere, menggunakan akses SSL tanpa port khusus : https://vc67-student1.excellent.co.id

Saya beberapa kali melakukan instalasi vCenter via GUI, beberapa kali juga sempat gagal karena ada problem di DNS atau lainnya. Instalasi via CLI ini selalu sukses. Entah karena konfigurasinya berbeda atau memang by nature instalasi via CLI ini sudah ada preliminary check sebelumnya.

Yang jelas, instalasi via CLI bisa digunakan sebagai metode alternatif jika instalasi via GUI tidak memungkinkan.

Catatan :

  1. Materi diatas merupakan bagian dari materi training virtualisasi server di Excellent. Rencananya, training pertama virtualisasi server dengan konsep dan spesifikasi baru di tahun 2019 akan dilaksanakan pada 16-19 Februari 2019.
  2. Ebook VMware vSphere 6.7 tersedia pada . Saat ada rilis baru, otomatis akan terupdate dengan materi baru
  3. Jika lebih menyukai format buku cetak, buku VMware vSphere 6.7 tersedia juga di Tokopedia dan Bukalapak, hanya saja versi cetak tidak otomatis terupdate (ya iyalah 😛 ) dan harus membeli edisi baru jika sudah rilis versi terbarunya

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.