VMware vCloud Networking and Security Upgrade to VMware NSX : Migration Considerations : 4.2 vCloud Director Legacy Edge Compatibility : 4.2.2 vCloud Director 8.10
   
4.2.2 vCloud Director 8.10
In vCloud Director 8.10, edge gateways and vApp edges are deployed as full NSX Edge nodes (version 6.x) with the same feature set, accessible through the user interface or API, as legacy NSX Edge nodes.
vCloud Director 8.10 also supports legacy edges deployed before upgrade to vCloud Director 8.10. VMware recommends redeploying the old edges in vCloud Director or upgrading them in VMware NSX to leverage the more efficient message bus communication mode with NSX Manager as opposed to the legacy VIX API mode. If the NSX Edge nodes are upgraded directly in VMware NSX, verify that vCloud Director is still running because it needs to be notified about the NSX Edge version change.
The following PowerShell script shows how the VMware NSX API can be used to automate the upgrade of all NSX Edge nodes (shown for informational purposes only).
$Username = "admin"
$Password = "default"
$NSXManager = "nsx01.gcp.local"
$TargetVersion = "6.2.3"
 
### Create authorization string and store in $head
$auth = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($Username + ":" + $Password))
$head = @{"Authorization"="Basic $auth"}
 
##Get total number of edges
$Request = "https://$NSXManager/api/4.0/edges"
$r = Invoke-WebRequest -Uri ($Request+"?startIndex=0&pageSize=1") -Headers $head -ContentType "application/xml" -ErrorAction:Stop
if ($r.StatusCode -eq "200") {Write-Host -BackgroundColor:Black -ForegroundColor:Green Status: Connected to $NSXManager successfully.}
$TotalNumberOfEdges = ([xml]$r.content).pagedEdgeList.edgePage.pagingInfo.totalCount
 
##Get all edges
$r = Invoke-WebRequest -Uri ($Request+"?startIndex=0&pageSize="+$TotalNumberOfEdges) -Headers $head -ContentType "application/xml" -ErrorAction:Stop
[xml]$rxml = $r.Content
$Edges = @()
foreach ($EdgeSummary in $rxml.pagedEdgeList.edgePage.edgeSummary)
{
$n = @{} | select Name, Id, Version
$n.Name = $edgeSummary.Name
$n.Id = $edgeSummary.objectId
$n.Version = $edgeSummary.appliancesSummary.vmVersion
$Edges += $n
}
 
##Upgrade all edges
foreach ($Edge in $Edges) {
if ($Edge.Version -ne $TargetVersion) {
## Upgrade edge
Write-Host "Upgrading Edge" $Edge.Name
$Uri = "https://$NSXManager/api/4.0/edges"+"/"+$Edge.Id+"?action=upgrade"
$r = Invoke-WebRequest -URI $Uri -Method Post -Headers $head -ContentType "application/xml" -Body $sxml.OuterXML -ErrorAction:Stop
}
}
 
Note: The upgrade (or redeploy) of an NSX Edge gateway impacts network traffic for a short time.