Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 179681

I am in need to adding new vmotion nic and IP for a project .. However i am not progressing further when it comes down to incremental IP of the vmotion network per host.

$
0
0

Here is the code developed -- till now.

 

I was hoping to change the $x in the for loop so that it would increment the IP by one each time it runs through configuring vmotion nic and ip on a host.

 

$i = Get-Cluster -Name "NPRDMGMT_CLU" | Get-VMHost

 

 

ForEach ($H in $i) {

 

 

 

New-VMHostNetworkAdapter -VMHost $H -PortGroup "VM VMOTION - x.x.x.x" -VirtualSwitch NPRD -VMotionEnabled $true -MTU 1500

$Vmotion = get-vmhostnetworkadapter | where { $_.portgroupname -eq "VM VMOTION - x.x.x.x" }

set-vmhostnetworkadapter -virtualnic $Vmotion -ip x.x.x.$x -SubnetMask x.x.x.0 -Confirm:$false

Get-VMHost $H | Get-VMHostNetworkAdapter -Name vmk1 |Set-VMHostNetworkAdapter -VMotionEnabled $false

 

}


Viewing all articles
Browse latest Browse all 179681

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>