hello,
I have a script that i use to configure hosts after they are built from the iso.
I tracked it down to the begining of the script but not sure how to fix. any ideas?
it looks like it fails right after I add second nic to the vswitch0. Host that I'm building looses network connectivity and when I go via ILO, there is no nic assigned to management network.
Here is my code:
basically what we do here is add vmotion portgroup to vswitch0 and then add second nic to the switch which will be active nic for vmotion and standby nic for management traffic.
Any help is greatly appriciated.
Remove the Default "VM Network" portgroup from vSwitch0
$vs = get-virtualswitch -vmhost $vmhost -name vSwitch0
$vpg = get-virtualportgroup -virtualswitch $vs -name 'VM Network'
remove-virtualportgroup -VirtualPortGroup $vpg -Confirm:$false
Add VMK PortGroup and Port for VMotion on vSwitch0
$vmovs = Get-VirtualSwitch -VMHost $vmhost -Name "vSwitch0"
New-VMHostNetworkAdapter -VMHost $vmhost -PortGroup VMotion -VirtualSwitch $vmovs -IP $vmoip -SubnetMask 255.255.255.0 -VMotionEnabled $true
Add A VLAN TAG for the VMotion Interface
$vs = Get-VirtualSwitch -VMHost $vmHost -Name vSwitch0
$vpg = Get-VirtualPortGroup -VirtualSwitch $vs -Name VMotion
$newVpg = Set-VirtualPortGroup -VirtualPortGroup $vpg -VLanId $vmoVLanId
echo " ## Add VMNIC2 to vSwitch0"
Adds VMNIC2 to vSwitch0
$vs = Get-VirtualSwitch -VMHost $vmHost -Name vSwitch0
Set-VirtualSwitch -VirtualSwitch $vs -Nic $vmonic