Пошаговое руководство по изменению IP-адреса в Appliance VMware Cloud Director
Внутри папки /opt/vmware/share/vami есть скрипты для изменения vCD Appliance.
В данном примере будем использовать скрипт vami_config_net. С помощью этого сценария можем изменить IP-адреса, шлюз по умолчанию, DNS и имя хоста.
Шаг 1. Остановим vCD сервис
1 2 3
root@dev-vcd [ ~ ]# /opt/vmware/vcloud-director/bin/cell-management-tool -u AdminUsername cell -s Please enter the administrator password: Cell successfully deactivated and all tasks cleared in preparation for shutdown
В качестве имени пользователя необходимо использовать имя администратора vCloud Director.
Шаг 2. Запускаем скрипт vami_config_net
Запускаем скрипт vami_config_net и изменяем первый IP-адрес, который находится в eth0.
0) Show Current Configuration (scroll with Shift-PgUp/PgDown) 1) Exit this program 2) Default Gateway 3) Hostname 4) DNS 5) Proxy Server 6) IP Address Allocation for eth0 7) IP Address Allocation for eth1 Enter a menu number [0]: 6 Type Ctrl-C to go back to the Main Menu
Configure an IPv4 address for eth0? y/n [n]: y Use a DHCPv4 Server instead of a static IPv4 address? y/n [n]: n IPv4 Address [172.16.88.151]: 172.16.77.151 Netmask [255.255.255.0]: IPv4 Address: 172.16.77.151 Netmask: 255.255.255.0
Теперь нам нужно перенастроить vCD, чтобы увидеть новые IP-адреса. Для этого воспользуемся скриптом настройки vCD/opt/vmware/vcloud-director/bin/configure
root@dev-vcd [ /opt/vmware/share/vami ]# /opt/vmware/vcloud-director/bin/configure Welcome to the VMware Cloud Director configuration utility.
You will be prompted to enter a number of parameters that are necessary to configure and start the VMware Cloud Director service.
Error: saved primary IP address (/172.16.88.151) is no longer registered on this machine. Error: saved primary IP address (/172.16.88.151) is no longer registered on this machine. Please indicate which IP address available on this machine should be used for the HTTP service and which IP address should be used for the remote console proxy.
The HTTP service IP address is used for accessing the user interface and the REST API. The remote console proxy IP address is used for all remote console connections and traffic.
Please enter your choice for the HTTP service IP address: 1. 172.16.77.151 2. 172.16.99.151 3. 127.0.0.1 4. [0:0:0:0:0:0:0:1%lo] Choice [default=1]: 1
Please enter your choice for the remote console proxy IP address: 1. 172.16.77.151 2. 172.16.50.151 3. 127.0.0.1 4. [0:0:0:0:0:0:0:1%lo] Console proxy IP is optional. Press enter to select none. Choice [default=none]: 1 Connecting to the database: jdbc:postgresql://172.16.99.151:5432/vcloud?socketTimeout=90 DB credentials read successfully. ...\ Database configuration complete.
VMware Cloud Director configuration is now complete.
Once the VMware Cloud Director server has been started you will be able to access it at this URL: https://dev-vcd.example.com
Would you like to start the Cloud Director service now? If you choose not to start it now, you can manually start it at any time using this command: service vmware-vcd start
Start it now? [y/n] y
The Cloud Director service will be started automatically on boot. To disable this, use the following command: chkconfig --del vmware-vcd
Шаг 4. Повторный импорт сертификатов
Повторно импортируем сертификаты vCenter, NSX-V или NSX-T, используемые в vCD Appliance.
1 2 3 4 5 6 7 8 9 10
root@dev-vcd [ /opt/vmware/share/vami ]# /opt/vmware/vcloud-director/bin/cell-management-tool trust-infra-certs --vsphere --unattended Downloading certificates for 2 host(s), including 1 vCenter(s): WARNING: Trusting VMCA certificates for vCenter vcenter.example.com failed nsxv.example.com [Download: SUCCESS] vcenter.example.com [Download: FAILURE] Downloaded certificates for 1/2 host(s). Trusting certificates for 1 host(s): nsxv.example.com [Already Trusted: SUCCESS] Trusting VMCA certificates for 0 vCenter(s): Trusted 1/1 downloaded certificates.