Davoud Teimouri

Virtualization & Datacenter

[How To]: Change Linux IP Address via PowerCLI

How To Change Linux IP Address via PowerCLI


There is some reason that you want to change IP address on virtual machines as an example, moving virtual machines to a new VLAN or port-group or moving them to another site or replicate virtual machine to an offsite recovery site.

Changing IP on machines one by one is very difficult on more than one machine and it be tougher.

PowerCLI has cmdlet that it called “Invoke-VMScript”, the cmdlet lets you to run scripts on guest OS even when guest OS has no IP. But VMware Tools must be installed and also updated VMware Tools is recommended.

Also you must have guest OS credential to run your script.

Sample Script


Here is a sample script to change IP address on multiple VM and also change NFS mount point IP addresses on “fstab” file.

Before run, you must customize the below script and put proper network configuration file within the script:

Read More on Teimouri.Net:

Add existing virtual desktops to “Automated Pool” in VMware View manually

[PowerCLI]: Change Local Account Password on ESXi

[Script]: Find ESXi HBA WWN via PowerCLI

Veeam Backup & Replication – Re-IP Rule on Linux VM

7,854 total views, 2 views today

[How To]: Change Linux IP Address via PowerCLI
4 (80%) 1 Votes

Davoud Teimouri is as a professional blogger, vExpert 2015/2016/2017/2018, VCA, MCITP. This blog is started with simple posts and now, it has large following readers.

Updated: 11/07/2018 — 7:17 pm

2 Comments

Add a Comment
  1. Typo (“Credntial”) in code.

Leave a Reply

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

Teimouri.net © 2012 Frontier Theme
Read previous post:
FlexibleLOM - Rack Mount Servers
[Review]: What’s FlexibleLOM, FLR and FLB?

What's FlexibleLOM? FlexibleLOM is a standard for HPE network interface cards that using on ProLiant Blade servers and ProLiant Rack...

Close