Guv
Enthusiast
Enthusiast

Changing IP address of ESX Server

I am using vsphere and also esx v4.0 servers.  I want to change the ip address of the esx host as we are moving to a new subnet.  Is there a way to do this in powercli.

0 Kudos
6 Replies
RvdNieuwendijk
Leadership
Leadership

Yes, you can change the ip address of an esx host with the Set-VMHostNetworkAdapter cmdlet.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
LucD
Leadership
Leadership

I suspect you will also need the Set-VMHostNetwork cmdlet to change the console gateway.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Guv
Enthusiast
Enthusiast

how would use this cmdlet to change the ip address of the esx host.

0 Kudos
LucD
Leadership
Leadership

I would advise to make a new console with the new IP address instead of changing the current one.

Once the new console is working, you remove the old one.

Otherwise you risk loosing connectivity to the ESX server.

New-VMHostNetworkAdapter -VMHost $esx -VirtualSwitch $vsw -PortGroup "Service Console 2" -IP 192.168.0.1 -SubnetMask 255.255.255.0 -ConsoleNic


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Guv
Enthusiast
Enthusiast

We can make a new service console via the VI client, or is advised to create through the powercli.  Also can you add the second service console on the same vswitch or create a new vswitch and add the new service console from there.

0 Kudos
LucD
Leadership
Leadership

You can chose either, but since you're writing a script why not do everything from a script.

You can add a 2nd console to the same switch.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos