VMware Cloud Community
Godwin_Christop
Enthusiast
Enthusiast
Jump to solution

Automation required for changing VM network adaptor from e1000 to VMXNET3

we are planning to change the network adaptor from e1000 to vmxnet3, if there is a script that will change the nic type and also configure the IP in the OS level.

Labels (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Those are 2 completely different requirements.

Changing the vNIC type can be done with the Set-NetworkAdapter cmdlet and the Type parameter.

Configuring the IP settings inside the Guest OS depends on the Guest OS.
You can, if the VMware Tools are installed, use the Invoke-VMScript cmdlet to run a script inside the Guest OS.
But which script depends on the type of Guest OS.


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

View solution in original post

8 Replies
LucD
Leadership
Leadership
Jump to solution

Those are 2 completely different requirements.

Changing the vNIC type can be done with the Set-NetworkAdapter cmdlet and the Type parameter.

Configuring the IP settings inside the Guest OS depends on the Guest OS.
You can, if the VMware Tools are installed, use the Invoke-VMScript cmdlet to run a script inside the Guest OS.
But which script depends on the type of Guest OS.


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

Godwin_Christop
Enthusiast
Enthusiast
Jump to solution

Thanks for the Reply @LucD 

 the Set-NetworkAdapter cmdlet, will it affect the IP configuration on the OS level.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

No, but changing the vNIC type will inside the Guest OS make the NIC appear appear as a new NIC, and hence all settings will be lost.


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

Reply
0 Kudos
Godwin_Christop
Enthusiast
Enthusiast
Jump to solution

do you have any script that can use Invoke-VMScript also for the ip configuration part.

Thanks in Advance 🙏

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

The script to use depends on what kind of Guest OS you have running on the VM.

And there are quite a few examples available for both Windows and Linux in this community.


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

Reply
0 Kudos
Godwin_Christop
Enthusiast
Enthusiast
Jump to solution

Got that @LucD,

I will check and work on the same.

correct if I'm wrong on the flow mentioned below or if I miss something.

we have VMs on both(WIN and Linux),

  1. Regardless of OS, we have to get the network configuration with Invoke-VMScript.
  2. use set-networkadaptor to change the network adaptor type.
  3. we have to set the network configuration with Invoke-VMScript.
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That flow is correct.
You will need Windows and Linux versions of the scripts used in 1 and 3.


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

Godwin_Christop
Enthusiast
Enthusiast
Jump to solution

Got that @LucD 

 

thanks again. 🙏

Godwin_Christop_3-1647010746717.png

Reply
0 Kudos