vCenter Server provides the ability to backup and restore the configuration of a vSphere Distributed Switch. Learn how to restore the virtual network configuration in cases of database or upgrade failure. You can also use a saved switch configuration as a template to create a copy of the switch in the same or a new vSphere environment.

You can import or export a configuration of a distributed switch including its port groups. For information about exporting, importing, and restoring a port group configuration, see Export, Import, and Restore vSphere Distributed Port Group Configurations.

Note: You can use a saved configuration file to restore policies and hosts associations on the distributed switch. You cannot restore the connection of physical NICs to uplink ports or ports of link aggregation groups.

Export vSphere Distributed Switch Configurations

Learn how to export vSphere Distributed Switch and distributed port group configurations to a file. The file preserves valid network configurations, enabling transfer of these configurations to other environments.

Procedure

  1. On the vSphere Client Home page, click Networking and navigate to the distributed switch.
  2. Right-click the distributed switch and select Settings > Export Configuration.
  3. Choose to export the distributed switch configuration, or export the distributed switch configuration and all port groups.
  4. (Optional) Enter notes about this configuration in the Descriptions field.
  5. Click OK.
  6. Click Yes to save the configuration file to your local system.

What to do next

Use the exported configuration file to do the following tasks:

You can also export, import, and restore only port group configurations. See Export, Import, and Restore vSphere Distributed Port Group Configurations.

Import a vSphere Distributed Switch Configuration

Learn how to import a stored configuration file to create a new vSphere Distributed Switch or to restore a switch that has been deleted earlier.

The configuration file contains the networking settings of the switch. By using it you can also replicate the switch in other virtual environments.

Note: You can use a saved configuration file to replicate the switch instance, its host associations, and policies. You cannot replicate the connection of physical NICs to uplink ports or ports on link aggregation groups.

Procedure

  1. In the vSphere Client, navigate to a data center.
  2. Right-click the data center and select Distributed Switch > Import Distributed Switch.
  3. Browse to the location of the configuration file.
  4. To assign the keys from the configuration file to the switch and its port groups, select the Preserve original distributed switch and port group identifiers check box and click Next.

    You can use the Preserve original distributed switch and port group identifiers option in the following cases:

    • Recreate a deleted switch.
    • Restore a switch whose upgrade has failed.

    All port groups are recreated and the hosts that have been connected to the switch are added again.

  5. Review the settings for the switch and click Finish.

Results

A new distributed switch is created with settings from the configuration file. If you have included distributed port group information in the configuration file, the port groups are also created.

Restore a vSphere Distributed Switch Configuration

Learn how to use the restore option to reset the configuration of an existing distributed switch to the settings in the configuration file. Restoring a distributed switch changes the settings on the selected switch back to the settings saved in the configuration file.

Note: You can use a saved configuration file to restore policies and hosts associations on the distributed switch. You cannot restore the connection of physical NICs to uplink ports or ports of link aggregation groups.

Procedure

  1. On the vSphere Client Home page, click Networking and navigate to the distributed switch.
  2. Right-click the distributed switch in the navigator and select Settings > Restore Configuration.
  3. Browse for the configuration backup file to use.
  4. Select Restore distributed switch and all port groups or Restore distributed switch only and click Next
  5. Review the summary information for the restore.
    Restoring a distributed switch will overwrite the current settings of the distributed switch and its port groups. It will not delete existing port groups that are not part of the configuration file.
  6. Click Finish.
    The distributed switch configuration has been restored to the settings in the configuration file.