PowerShell oneliner: Change the VMotion vNic

I tried for over an hour to use the Set-VMHostNetworkAdapter for the life of me I can’t get it to work. Fortunately the SDK is both well documented and wide open thanks to the get-view cmdlet!

that’s it… Now the cool thing here is that let’s say vnic vmk1 is currently selected. The SelectVnic method will unselected vmk1, and select vmk0. As with everything in the VI toolkit once you figure out how to do one, scale is suddenly a trivial task.

Personally, I always test automation task like this on a ‘test cluster’.

If you haven’t figured it out yet… We’re making a concerted effort to solve any issue we find. From both the view point of a Windows (PowerShell) and a *nix(perl) administrator’s point of view. All of this stuff is really just a stop gap until the RCLI has matured. We’ll at least the perl is (have you seen how long that stuff is :))

Leave a Reply