BillStreet00
Enthusiast
Enthusiast

Remove and Add a NIC

I have a couple hundred VM's that need to have their NIC's updated to vmxnet3.  I have a workflow that loops through a machine and records information on any NIC except the vmxnet3 which it just bypasses. I would like to remove the old NIC and add the new vmxnet3 NIC and pass the IP information back to the new NIC.  The problem I have is actually whacking the old NIC and creating the new one.  Any suggestions?

0 Kudos
4 Replies
daphnissov
Immortal
Immortal

You might want to be cautious with such a workflow for several reasons:

  1. Must ensure VMware tools are up-to-date on systems before you go adding a new paravirtualized device like VMXNet3. Otherwise it'll either not function or crash the VM (in some cases).
  2. Some OSs have problems with hot adding PCIe bus devices like VMXNet3. I remember Server 2008 R2 had some issues until MS issued a patch, so something else to watch.
  3. Harvesting IP settings and spitting them back out may not transfer any alterations that were done to that NIC (if any). If all VMs are simple and no one has monkeyed around with TCP/IP stack settings or driver changes, you're probably fine. In any case, something of which to be aware.

Not exactly vRO workflow help, but food for thought since I've done similar things in the past with PowerCLI and run into above issues.

0 Kudos
BillStreet00
Enthusiast
Enthusiast

Definitely food for thought.

I have a workflow that will snapshot the vm, update tools, shut down the vm and then upgrade the virtual hardware.  I plan to add the new nic while the machine is shut down to avoid instability.

0 Kudos
Hejahida82
VMware Employee
VMware Employee

This thread will give you a starter code for adding and removing nics. I have added them in the past using this code, powering off the VM first and then powering it on again afterwards.

Remove network adapter

I would then look at running a script inside the guest OS to apply IP information, I never had to do that as in my scenerio it was adding a nic during vRA deployment ready for clustering a VM which was then added manually by a separate team when they configured the windows cluster.

0 Kudos
BillStreet00
Enthusiast
Enthusiast

Thanks that helped alot.  Once I can figure out my dvPortGroup I think I have this issue solved.

0 Kudos