Migrate resources to a new vCenter Server – Methods for Migrations (Part 2)

My first walk through is for a cluster migrating to a different vCenter Server. This is the traditional vDS to standard switch to vDS. The reason for this way is to maintain up time for  my VMs and supportability. Moving a host to a new vCenter Server without first going to a standard switch is not supported. I will go over each step. In my case case, management and vMotion VMkernel ports are already on dedicated standard switches. Though, there is also a method to migrate the VMkernel ports with no downtime that is very similar. Only VM network traffic is on my vDS.

Each host needs to already have at least two physical NICs to avoid downtime for VMs and VM traffic. If you keep a continuous ping on a few VMs during this process, you will only see one ping drop during each major step. Make sure you verify the root password before removing hosts from vCenter.

Source vCenter Server

  1. Export the vDS configuration
    1. Go to the vDS -> Right click the vDS
    2. Export Configuration
    3. Select the Export the distributed switch configuration and all port groups option
  2. Create a Standard Switch and the virtual machine port groups
    1. No physical uplinks on every host at this moment
    2. A new port group that matches every port group that’s on the vDS
  3. Remove one of the physical NICs from all hosts
    1. Go to the vDS -> Manage Hosts
    2. Select all of the hosts
    3. Remove one of the two physical NICs
    4. Next -> Next -> Finish
  4. Add the physical NIC that was removed to the new standard switch on each host
  5. Migrate VMs in bulk in each port group
    1. Go to the vDS -> Migrate Virtual Machine Networking
    2. Select the source vDS port group
    3. Select the destination standard switch port group
    4. Select all VMs
    5. Finish
    6. Repeat these steps for each port group
  6. Remove the last physical NIC on the vDS
    1. Ensure no VM is connected to the vDS
    2. Go to the vDS -> Manage Hosts
    3. Select all of the hosts
    4. Remove the last physical NICs
    5. Next -> Next -> Finish
  7. Remove the hosts from the vDS
    1. Go to the vDS -> Click the host tab
    2. Right click each host and click remove
  8. Remove the hosts from the vCenter Server
    1. Right click a host -> Disconnect
    2. Right click a host -> Remove
    3. Repeat for each host

Destination vCenter Server

  1. Create a new cluster
  2. Add hosts to the new cluster
    1. Right click on the cluster
    2. Add host -> next through wizard
    3. Repeat for each host
  3. Import the vDS configuration at the destination vCenter Server
    1. Do not preserve the original vDS and port group identifiers
    2. Preserving the vDS and port group identifiers is used when restoring the vDS within the same vCenter Server
  4. Remove one physical NIC from the standard switch on each host
  5. Add the hosts to the vDS
    1. Go to the vDS -> Manage Hosts
    2. Select all of the hosts
    3. Add the physical NIC that was previously disconnected
    4. Next -> Next -> Finish
  6. Migrate VMs back to the vDS
    1. Go to the vDS -> Migrate Virtual Machine Networking
    2. Select the destination standard switch port group
    3. Select the source vDS port group
    4. Select all VMs
    5. Finish
    6. Repeat these steps for each port group
  7. Ensure no VMs are on the standard switches
  8. Remove one physical NIC from the standard switch on each host
  9. Add the last physical NICs to the vDS
    1. Go to the vDS -> Manage Hosts
    2. Select all of the hosts
    3. Add the physical NIC that was previously disconnected
    4. Next -> Next -> Finish
  10. Delete the unused standard switches

Now all VMs are running in the new vCenter Server on the vDS with no downtime. I will go over another method in my next article that I used for a different cluster.

Migrate Resources to a New vCenter Server (Part 1)
Migrate resources to a new vCenter Server – Methods for Migrations (Part 2)
Migrate resources to a new vCenter Server – Cross vCenter vMotion Utility (Part 3)
Migrate resources to a new vCenter Server – Unregister old vCenter Servers (Part 4)

Error removing host from vDS

VMware has an article for this error, but I think it should also mention to check templates. I had a template that was not showing it was being used by the vDS. The template was still tied to the vDS since it was using a port group on the vDS before it was converted to a template. I converted template to a VM, changed the port group, and converted the VM back to a template.  Then I was able to remove the host from the vDS.

The resource ‘XXXX’ is in use. vDS NAME port XXXX is still on host NAME connected to NAME nic=4000 type-vmNic

vDS_port_error