Upgrade, backup, and restore SDN infrastructure

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Azure Stack HCI, versions 21H2 and 20H2

In this topic, you learn how to update, backup and restore an SDN infrastructure.

Upgrade the SDN infrastructure

SDN infrastructure can be upgraded from Windows Server 2016 to Windows Server 2019. For upgrade ordering, follow the same sequence of steps as mentioned in the section "Update the SDN infrastructure". Before upgrade, it is recommended to take a backup of the Network Controller database.

For Network Controller machines, use the Get-NetworkControllerNode cmdlet to check the status of the node after the upgrade has been completed. Ensure that the node comes back to "Up" status before upgrading the other nodes. Once you have upgraded all of the Network Controller nodes, the Network Controller updates the microservices running within the Network Controller cluster within an hour. You can trigger an immediate update using the update-networkcontroller cmdlet.

Install the same Windows updates on all of the operating system components of the Software Defined Networking (SDN) system, which includes:

  • SDN enabled Hyper-V hosts
  • Network Controller VMs
  • Software Load Balancer Mux VMs
  • RAS Gateway VMs


If you use System Center Virtual Manager, you must update it with the latest update rollups.

When you update each component, you can use any of the standard methods for installing Windows updates. However, to ensure minimal downtime for workloads and the integrity of the Network Controller database, follow these steps:

  1. Update the management consoles.

    Install the updates on each of the computers where you use the Network Controller PowerShell module. Including anywhere that you have the RSAT-NetworkController role installed by itself. Excluding the Network Controller VMs themselves; you update them in the next step.

  2. On the first Network Controller VM, install all updates and restart.

  3. Before proceeding to the next Network Controller VM, use the get-networkcontrollernode cmdlet to check the status of the node that you updated and restarted.

  4. During the reboot cycle, wait for the Network Controller node to go down and then come back up again.

    After rebooting the VM, it can take several minutes before it goes back into the Up status. For an example of the output, see

  5. Install updates on each SLB Mux VM one at a time to ensure continuous availability of the load balancer infrastructure.

  6. Update Hyper-V hosts and RAS gateways, starting with the hosts that contain the RAS gateways that are in Standby mode.

    RAS gateway VMs can't be migrated live without losing tenant connections. During the update cycle, you must be careful to minimize the number of times tenant connections failover to a new RAS gateway. By coordinating the update of hosts and RAS gateways, each tenant fails over once, at most.

    a. Evacuate the host of VMs that are capable of live migration.

    RAS gateway VMs should remain on the host.

    b. Install updates on each Gateway VM on this host.

    c. If the update requires the gateway VM to reboot then reboot the VM.

    d. Install updates on the host containing the gateway VM that was just Updated.

    e. Reboot the host if required by the updates.

    f. Repeat for each additional host containing a standby gateway.

    If no standby gateways remain, then follow these same steps for all remaining hosts.

Example: Use the get-networkcontrollernode cmdlet

In this example, you see the output for the get-networkcontrollernode cmdlet run from within one of the Network Controller VMs.

The status of the nodes that you see in the example output is:

  • NCNode1.contoso.com = Down
  • NCNode2.contoso.com = Up
  • NCNode3.contoso.com = Up


You must wait several minutes until the status for the node changes to Up before you update any additional nodes, one at a time.

Once you have updated all of the Network Controller nodes, the Network Controller updates the microservices running within the Network Controller cluster within an hour.


You can trigger an immediate update using the update-networkcontroller cmdlet.

PS C:\> get-networkcontrollernode
Name            : NCNode1.contoso.com
Server          : NCNode1.Contoso.com
FaultDomain     : fd:/NCNode1.Contoso.com
RestInterface   : Ethernet
NodeCertificate :
Status          : Down

Name            : NCNode2.Contoso.com
Server          : NCNode2.contoso.com
FaultDomain     : fd:/ NCNode2.Contoso.com
RestInterface   : Ethernet
NodeCertificate :
Status          : Up

Name            : NCNode3.Contoso.com
Server          : NCNode3.Contoso.com
FaultDomain     : fd:/ NCNode3.Contoso.com
RestInterface   : Ethernet
NodeCertificate :
Status          : Up

Example: Use the update-networkcontroller cmdlet

In this example, you see the output for the update-networkcontroller cmdlet to force Network Controller to update.


Run this cmdlet when you have no more updates to install.

PS C:\> update-networkcontroller
NetworkControllerClusterVersion NetworkControllerVersion
------------------------------- ------------------------
10.1.1                          10.1.15

Backup the SDN infrastructure

Regular backups of the Network Controller database ensures business continuity in the event of a disaster or data loss. Backing up the Network Controller VMs is not sufficient because it does not ensure that the session continues across the multiple Network Controller nodes.


  • An SMB share and credentials with Read/Write permissions to the share and file system.
  • You can optionally use a Group Managed Service Account (GMSA) if the Network Controller was installed using a GMSA as well.


  1. Use the VM backup method of your choice, or use Hyper-V to export a copy of each Network Controller VM.

    Backing up the Network Controller VM ensures that the necessary certificates for decrypting the database are present.

  2. If using System Center Virtual Machine Manager (SCVMM), stop the SCVMM service and back it up via SQL Server.

    The goal here is to ensure that no updates get made to SCVMM during this time, which could create an inconsistency between the Network Controller backup and SCVMM.


    Do not re-start the SCVMM service until the Network Controller backup is complete.

  3. Backup the Network Controller database with the new-networkcontrollerbackup cmdlet.

  4. Check the completion and success of the backup with the get-networkcontrollerbackup cmdlet.

  5. If using SCVMM, start SCVMM service.

Example: Backing up the Network Controller database

$URI = "https://NC.contoso.com"
$Credential = Get-Credential

# Get or Create Credential object for File share user

$ShareUserResourceId = "BackupUser"

$ShareCredential = Get-NetworkControllerCredential -ConnectionURI $URI -Credential $Credential | Where {$_.ResourceId -eq $ShareUserResourceId }
If ($ShareCredential -eq $null) {
    $CredentialProperties = New-Object Microsoft.Windows.NetworkController.CredentialProperties
    $CredentialProperties.Type = "usernamePassword"
    $CredentialProperties.UserName = "contoso\alyoung"
    $CredentialProperties.Value = "<Password>"

    $ShareCredential = New-NetworkControllerCredential -ConnectionURI $URI -Credential $Credential -Properties $CredentialProperties -ResourceId $ShareUserResourceId -Force

# Create backup

$BackupTime = (get-date).ToString("s").Replace(":", "_")

$BackupProperties = New-Object Microsoft.Windows.NetworkController.NetworkControllerBackupProperties
$BackupProperties.BackupPath = "\\fileshare\backups\NetworkController\$BackupTime"
$BackupProperties.Credential = $ShareCredential

$Backup = New-NetworkControllerBackup -ConnectionURI $URI -Credential $Credential -Properties $BackupProperties -ResourceId $BackupTime -Force

Example: Checking the status of a Network Controller backup operation

PS C:\ > Get-NetworkControllerBackup -ConnectionUri $URI -Credential $Credential -ResourceId $Backup.ResourceId
| ConvertTo-JSON -Depth 10
    "Tags":  null,
    "ResourceRef":  "/networkControllerBackup/2017-04-25T16_53_13",
    "InstanceId":  "c3ea75ae-2892-4e10-b26c-a2243b755dc8",
    "Etag":  "W/\"0dafea6c-39db-401b-bda5-d2885ded470e\"",
    "ResourceMetadata":  null,
    "ResourceId":  "2017-04-25T16_53_13",
    "Properties":  {
                    "BackupPath":  "\\\\fileshare\backups\NetworkController\\2017-04-25T16_53_13",
                    "ErrorMessage":  "",
                    "FailedResourcesList":  [

                    "SuccessfulResourcesList":  [
                    "InProgressResourcesList":  [

                    "ProvisioningState":  "Succeeded",
                    "Credential":  {
                                        "Tags":  null,
                                        "ResourceRef":  "/credentials/BackupUser",
                                        "InstanceId":  "00000000-0000-0000-0000-000000000000",
                                        "Etag":  null,
                                        "ResourceMetadata":  null,
                                        "ResourceId":  null,
                                        "Properties":  null

Restore the SDN infrastructure from a backup

When you restore all the necessary components from backup, the SDN environment returns to an operational state.


The steps vary depending on the number of components restored.

  1. If necessary, redeploy Hyper-V hosts and the necessary storage.

  2. If necessary, restore the Network Controller VMs, RAS gateway VMs and Mux VMs from backup.

  3. Stop NC host agent and SLB host agent on all Hyper-V hosts:

    stop-service slbhostagent
    stop-service nchostagent
  4. Stop RAS Gateway VMs.

  5. Stop SLB Mux VMs.

  6. Restore the Network Controller with the new-networkcontrollerrestore cmdlet.

  7. Check the restore ProvisioningState to know when the restore had completed successfully.

  8. If using SCVMM, restore the SCVMM database using the backup that was created at the same time as the Network Controller backup.

  9. If you want to restore workload VMs from backup, do that now.

  10. Check the health of your system with the debug-networkcontrollerconfigurationstate cmdlet.

$cred = Get-Credential
Debug-NetworkControllerConfigurationState -NetworkController "https://NC.contoso.com" -Credential $cred

Fetching ResourceType:     accessControlLists
Fetching ResourceType:     servers
Fetching ResourceType:     virtualNetworks
Fetching ResourceType:     networkInterfaces
Fetching ResourceType:     virtualGateways
Fetching ResourceType:     loadbalancerMuxes
Fetching ResourceType:     Gateways

Example: Restoring a Network Controller database

$URI = "https://NC.contoso.com"
$Credential = Get-Credential

$ShareUserResourceId = "BackupUser"
$ShareCredential = Get-NetworkControllerCredential -ConnectionURI $URI -Credential $Credential | Where {$_.ResourceId -eq $ShareUserResourceId }

$RestoreProperties = New-Object Microsoft.Windows.NetworkController.NetworkControllerRestoreProperties
$RestoreProperties.RestorePath = "\\fileshare\backups\NetworkController\2017-04-25T16_53_13"
$RestoreProperties.Credential = $ShareCredential

$RestoreTime = (Get-Date).ToString("s").Replace(":", "_")
New-NetworkControllerRestore -ConnectionURI $URI -Credential $Credential -Properties $RestoreProperties -ResourceId $RestoreTime -Force

Example: Checking the status of a Network Controller database restore

PS C:\ > get-networkcontrollerrestore -connectionuri $uri -credential $cred -ResourceId $restoreTime | convertto-json -depth 10
    "Tags":  null,
    "ResourceRef":  "/networkControllerRestore/2017-04-26T15_04_44",
    "InstanceId":  "22edecc8-a613-48ce-a74f-0418789f04f6",
    "Etag":  "W/\"f14f6b84-80a7-4b73-93b5-59a9c4b5d98e\"",
    "ResourceMetadata":  null,
    "ResourceId":  "2017-04-26T15_04_44",
    "Properties":  {
                    "RestorePath":  "\\\\sa18fs\\sa18n22\\NetworkController\\2017-04-25T16_53_13",
                    "ErrorMessage":  null,
                    "FailedResourcesList":  null,
                    "SuccessfulResourcesList":  null,
                    "ProvisioningState":  "Succeeded",
                    "Credential":  null

For information on configuration state messages that may appear, see Troubleshoot the Windows Server 2016 Software Defined Networking Stack.