Unable to Change vCenter Server Appliance IP

I am trying to change a vCenter Server Appliance static IP address.

If I follow VMware documentation here I get the following message

IPv4 configuration for nic0 of this node cannot be edited post deployment.

Logging in through console doesn't allow me to change the address.

Editing /etc/sysconfig/networking/devices/ifcfg-eth0 will cause permission issues.

Executing /opt/vmware/share/vami/vami_config_net in shell gives the error ImportError: No module named libxml2mod

I have tried to install libxml2mod with Zypper but can't find this specific package and already have libxml installed.

How can I change my IP address?

vCSA is version 6 build 2562643


Solution 1:

It sounds as though you may have used an IP address rather than a FQDN for the vCenter name during installation. If that is indeed the case, you may be out of luck:

Prerequisites

To change the IP settings of the vCenter Server Appliance, make sure that the system name of the appliance is an FQDN. If, during the vCenter Server Appliance deployment, you set up the appliance to use an IP address as a system name, you cannot change the IP settings.

(From: Configuring the vCenter Server Appliance by Using the Direct Console User Interface )

Solution 2:

I didn't feel like redeploying vCenter Server Appliance, so I took a risk and edited the raw linux networking config. Not the approved solution, but it seems to be working fine. If it stops working, then I'm right back where I started (needing to redeploy).

Go to the appliance management page and enable the SSH login and Bash shell:

https://static-ip-address:5480

enter image description here

Then ssh to the appliance. Login as root, and the default password is vmware. If you set a password for the appliance for the web client, then use that password with the root username.

Connected to service

    * List APIs: "help api list"
    * List Plugins: "help pi list"
    * Enable BASH access: "shell.set --enabled True"
    * Launch BASH: "shell"

Command>

Launch the shell by typing the command "shell"

shell

edit the interfaces config in linux

 vim /etc/sysconfig/networking/devices/ifcfg-eth0

and you should see something like this

DEVICE=eth0
BOOTPROTO='static'
STARTMODE='auto'
TYPE=Ethernet
USERCONTROL='no'
IPADDR='10.8.3.11'
NETMASK='255.255.255.0'
BROADCAST='10.8.3.255'

Make the changes you want, then restart the networking service.

localhost:~ # service network restart
Shutting down network interfaces:
    eth0      device: VMware VMXNET3 Ethernet Controller                    done
Shutting down service network  .  .  .  .  .  .  .  .  .                    done
Hint: you may set mandatory devices in /etc/sysconfig/network/config
Setting up network interfaces:
    eth0      device: VMware VMXNET3 Ethernet Controller
    eth0      IP address: 10.8.3.11/21                                      done
Setting up service network  .  .  .  .  .  .  .  .  .  .                    done