Greetings all...
I have a bunch of hosts where I need to change the IP (not netmask, gw, etc..) and the VM PortGroup of my vMotion vmk interfaces.
I have a list of servernames, new IPs, and the vm portgroup. I'm assuming powercli can do it but don't know where to start as all my hosts are now on a vDS.
Any suggestions?
Thanks!
Which PowerCLI version are you using ? Do a
Get-PowerCLIVersion
The latest version at the moment is 5.1 R2
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm not sure I understand what you mean by "...VM PortGroup of my vMotion vmk interfaces" ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sorry-- I didn't exactly word that very well.
Host > Configuration > Networking > vDS > Manage Virtual Adapters > vmk1 (my vMotion VMK interface) > Edit > Port Group & IP Settings.
The Set-VMHostNetworkAdapter supports vDS portgroups.
Did you try that already ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm able to set the IP with something like
Get-VMHost $vmhost | Get-VMHostNetworkAdapter -name $vMotvmk| Set-VMHostNetworkAdapter -IP $vMotIP
But I can't figture out how to change the portgroup of vmkx from "old-vmotion-portgroup" to "new-vmotion-portgroup".
Any ideas there? I tried the -PortGroup switch in Set-VMHostNetworkAdapter but it doesn't work. Looks like that's only for migrating from vSwitch to vDS.
The IP and Portgroup parameters belong to different parametersets, you can't use those 2 together.
Did you try using the Set-VMHostNetworkAdapter with the Portgroup parameter in a seperate line ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yeah, here's what I'm trying to run...
Get-VMHost $vmhost | Get-VMHostNetworkAdapter -name $vMotvmk | Set-VMHostNetworkAdapter -PortGroup $vmpg
Get-VMHost $vmhost | Get-VMHostNetworkAdapter -name $vMotvmk | Set-VMHostNetworkAdapter -IP $vMotIP
Second line works but the first says the -PortGroup parameter can't be found. Strange though, doing a get-help set-vmhostnetworkadapter doesn't show -PortGroup; yet, in the online reference, it shows it's there.
Which PowerCLI version are you using ? Do a
Get-PowerCLIVersion
The latest version at the moment is 5.1 R2
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
VMware vSphere PowerCLI 5.1 Release 1 build 793510
I'll grab R2 and see if that works.
Bingo-- R2 worked. Man, I didn't even know it was released! LOL I thought R1 was still really new.
So for the record -
#Change the host's vmk interface portgroup on a vDS --> Get-VMHost $vmhost | Get-VMHostNetworkAdapter -name $vMotvmk | Set-VMHostNetworkAdapter -PortGroup $vmpg
#Change the host's vmk interface IP on a vDS --> Get-VMHost $vmhost | Get-VMHostNetworkAdapter -name $vMotvmk | Set-VMHostNetworkAdapter -IP $vMotIP