Hosts/VMs get automatically configured on the DVS, when the DVS is exported and imported in a VCenter
search cancel

Hosts/VMs get automatically configured on the DVS, when the DVS is exported and imported in a VCenter

book

Article ID: 384017

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

vCenter Server provides the ability to backup and restore the configuration of a vSphere Distributed Switch. 

You can import or export a configuration of a distributed switch including its port groups.

Hosts/VMs are configured automatically on the DVS when a DVS is imported on a existing VCenter or new VCenter seamlessly resolving the proxy errors.

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.

Environment

VMware ESXi 7.x

VMware ESXi 8.x

Resolution

Export vSphere Distributed Switch Configurations

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.

 

Use the exported configuration file to do the following tasks:

Create a copy of the exported distributed switch in a vSphere environment. See Import a vSphere Distributed Switch Configuration.
Overwrite the settings on an existing distributed switch. See Restore a vSphere Distributed Switch Configuration.
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

You can 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 below for conditions and reasoning) check box and click Next.
  5. Review the settings for the switch and click Finish.

 

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. 

VMs are also mapped to the imported DVS portgroups automatically.

Reasoning:

When importing the distributed virtual switch (DVS) with the "Preserve original distributed switch" option selected, the cSwitch ID and VM port ID are retained.

As a result, when the switch is imported and the host is added (either automatically or manually if importing into a different vCenter), the host recognizes the DVS.

This is because it retains a proxy copy of the same switch, creating the impression that it is identical to the one the host previously used. Consequently, VMs and port groups are automatically configured, and any proxy-related errors are resolved seamlessly.

 

Disclaimer: This procedure should not be used to move hosts from one VCenter to the other when its a part of the DVS. For the standard procedure recommended by VMware by Broadcom to move the host  gracefully refer Moving an ESXi host with DVS from one VCenter to another