As a new VMUG Leader I was able to travel to VMware Headquarters and participate in the VMUG Leader Summit. …
Add VMKernal Ports to ESXi Host connected to vCenter
1 2 3 4 5 6 7 8 9 10 11 | #Configure VMKernal Ports on ESXi Host CLS Connect-VIServer {vCenter FQDN} -User {Username} -Password {Password} $vDS1 = Get-VirtualSwitch -VMHost {ESXi Host} -Name {"vDS Name"} New-VMHostNetworkAdapter -VMHost {ESXi Host} -VirtualSwitch $vDS1 -PortGroup {'PortGroup1 Name'} -IP {PortGroup1 IP} -SubnetMask 255.255.255.0 -MTU {MTU Size 1500} New-VMHostNetworkAdapter -VMHost {ESXi Host} -VirtualSwitch $vDS1 -PortGroup {'PortGroup2 Name'} -IP {PortGroup2 IP} -SubnetMask 255.255.255.0 -MTU {MTU Size 9000} New-VMHostNetworkAdapter -VMHost {ESXi Host} -VirtualSwitch $vDS1 -PortGroup {'vMotion PortGroup Name'} -IP {vMotion IP} -SubnetMask 255.255.255.0 -VMotionEnabled $true Disconnect-VIServer -Server * -Force -Confirm:$false |
Add iSCSI Targets to ESXi Host
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | CLS Connect-VIserver {ESXi Host IP} -User {Username} -Password {Password} $targets = "iSCSI Targer IP","iSCSI Targer IP","iSCSI Targer IP","iSCSI Targer IP" $hba = Get-VMHostHba -Type iScsi | Where {$_.Model -eq "iSCSI Software Adapter"} foreach ($target in $targets) { # Check to see if the SendTarget exist, if not add it if (Get-IScsiHbaTarget -IScsiHba $hba -Type Send | Where {$_.Address -cmatch $target}) { Write-Host "The target $target does exist on $esx" -ForegroundColor Green } else { Write-Host "The target $target doesn't exist on $esx" -ForegroundColor Red Write-Host "Creating $target on $esx ..." -ForegroundColor Yellow New-IScsiHbaTarget -IScsiHba $hba -Address $target } } Write "`n Done - Disconnecting " Disconnect-VIServer -Server * -Force -Confirm:$false |