VMware vCloud Networking and Security Upgrade to VMware NSX : Migration Considerations : 4.6 VMware NSX VIB Upgrade
   
4.6 VMware NSX VIB Upgrade
VMware NSX must replace the vShield VMkernel modules and install new VMware Installation Bundles (VIBs) on every vCloud Director managed ESXi host. This is done in the VMware NSX user interface by clicking Update next to each vSphere cluster.
Figure 11. VMware NSX VIB Upgrade
 
The upgrade of vShield or VMware NSX VIBs requires a reload of the new ESXi image and, therefore, a reboot of the ESXi host. VMware NSX automatically tries to put each host into maintenance mode and reboot it. This action, however, is not recommended in vCloud Director environments for two reasons:
Before a host is put into a vSphere maintenance mode, disable it in vCloud Director so that vCloud Director does not try to schedule tasks on the host (for example, to perform image uploads).
All workloads (not only running VMs) must be evacuated during the maintenance mode. A customer who decides to power on a VM or clone a VM that is registered to a rebooting (and temporarily unavailable) host would be otherwise impacted.
Therefore, VMware recommends the following steps instead:
1. Before a VIB upgrade, change the VMware vSphere Distributed Resource Scheduler™ (DRS) automation mode to manual on each vSphere cluster to prevent VMware NSX from attempting to put hosts in maintenance mode.
Caution Do not disable DRS. Disabling DRS will delete your resource pools and corrupt your vCloud Director installation.
2. After the VIB installation finishes, change the DRS automation mode to the initial setting. In the VMware NSX user interface, hosts will be in the Not Ready state and will require a reboot in vSphere.
Figure 12. Not Ready State in VMware NSX User Interface
 
Figure 13. Reboot Required in vSphere
Reboot Required
 
3. Make sure that each vSphere cluster has enough capacity to temporarily run without one host. (It is very common to have at least N+1 HA redundancy.)
4. Disable the host in vCloud Director.
5. Put the host into vSphere maintenance mode while evacuating all running, suspended, and powered-off VMs.
6. Reboot the host.
7. When the host comes up, exit the maintenance mode.
8. Enable the host in vCloud Director.
9. Repeat with other hosts.
Steps 4-9 can be easily automated and scripted, for example, with VMware vSphere PowerCLI™.
 
The following script is shown for informational purposes only.
## Connect to vCloud Director and all vCenter Servers it manages
Connect-CIServer -Server vcloud.gcp.local -User Administrator -Password VMware1!
Connect-VIServer -Server vcenter.gcp.local -User Administrator -Password VMware1!
$ESXiHosts = Search-cloud -QueryType Host
foreach ($ESXiHost in $ESXiHosts) {
$CloudHost = Get-CIView -SearchResult $ESXiHost
Write-Host
Write-Host "Working on host" $CloudHost.Name
Write-Host "Disabling host in vCloud Director"
$CloudHost.Disable()
Write-Host "Evacuating host"
Set-VMHost $CloudHost.Name -State Maintenance -Evacuate | Out-Null
Write-Host "Rebooting host"
Restart-VMHost $CloudHost.Name -Confirm:$false | Out-Null
Write-Host -NoNewline "Waiting for host to come online "
do {
sleep 15
$HostState = (get-vmhost $CloudHost.Name).ConnectionState
Write-Host -NoNewline "."
}
while ($HostState -ne "NotResponding")
do {
sleep 15
$HostState = (get-vmhost $CloudHost.Name).ConnectionState
Write-Host -NoNewline "."
}
while ($HostState -ne "Maintenance")
Write-Host
Write-Host "Host rebooted"
Set-VMHost $CloudHost.Name -State Connected | Out-Null
Write-Host "Enabling Host in vCloud Director"
$CloudHost.Enable()
}