-1

I want to change guest VM's(Windows) IP address on ESXi. One way I have known is using RDP to connect to the guest OS and modifying the network configuration.

However, I wish to make the process automated. Hence, does vCenter or ESXi contain similar functions or tools to perform this demand? (I have tried ovftool and vCLI but not work)

Thanks for ur reply.

Rocas

Rocas Yeh
  • 188
  • 2
  • 6

2 Answers2

1

It can be done using VMware Power CLI. See: https://my.vmware.com/web/vmware/details?downloadGroup=VCLI550&productId=353

You should use: Set-VMGuestNetworkInterface command for this. I think the Guest has to be running VMware Tools though.

Also see this VMware forum post: https://communities.vmware.com/message/1787660

Gabrie
  • 537
  • 1
  • 5
  • 15
1

I would recommend using the following, also VMware recommends the use of PowerCLI, which is PowerShell interface with vSphere-specific additions.

http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli

One of the simplest PowerCLI examples, and something which is actually extremely useful on its own, is the Get-VM cmdlet. Which lists VMs.

PowerCLI can be a bit overwhelming to use, But it can be enhanced with a nice toolset and a library of preconfigured scripts to jump-start your mass changes, which is possible with PowerGUI

http://powergui.org/index.jspa

and then the following script:-

Get-VM VMName | Get-VMGuestNetworkInterface -GuestUser Administrator -GuestPassword -HostUser root -HostPassword | Set-VMGuestNetworkInterface -IPPolicy Static -Ip -Netmask 255.255.252.0 -Gateway -GuestUser Administrator -GuestPassword -HostUser root -HostPassword