During vSphere 4.x to 5.x updates I occasionally run into the situation where dvSwitches are used on the current vCenter4 and the customer wants to install a fresh copy of vCenter5 (with a new dvSwitch).
Within this article I will describe a minimum downtime (1 ping-loss or less) procedure to cover this, guided by pictures to get a clear understanding.
Step 1 – Starting point
First of all we got the ESXi Host and VM’s connected to the dvSwitch.
Create a new vSwitch and add virtual machine portgroups to it with the same VLAN’s that are available on the dvSwitch. Add “local” to the naming convention to ensure easy identification.
Detach one of the vmnic’s from the dvSwitch and add it to the newly created vSwitch. This ensures the same network connectivity on the vSwitch as on the dvSwitch (assuming network is configured as it supposed to be.)
- Ensure that load balancing is active on the dvSwitch (no standby vmnics) before detaching one of the vmnics.
- Detaching one vmnic from the dvSwitch basically means interrupting possible the network traffic. It’s recommended to first do this on an ESXi Host with some test VM’s (or less critical VM’s) to measure possible ping-loss. The environments I migrated all lost either no or a maximum of 1 ping, which was acceptable for the customer.
Change the VM’s portgroup to the corresponding new “local” portgroup you created on the vSwitch (within step 2).
This can be done either manually or via the “Migrate Virtual Machine Networking” wizard within the dvSwitch.
- Changing the portgroup of a VM basically means interrupting the network traffic. It’s recommended to first try this on some test VM’s (or less critical VM’s) to measure possible ping-loss. The environments I migrated all lost either no or a maximum of 1 ping, which was acceptable for the customer.
Detach the remaining vmnic from the dvSwitch (the dvSwitch will not have any uplinks anymore at this time).
Delete the ESXi Host from the dvSwitch configuration.
From this point on all VM’s are moved towards the vSwitch and the ESXi Host is disconnected from the dvSwitch, which means that it can easily be moved over to the new vCenter5 server.
This process can be reversed to get the VM’s back on the new dvSwitch within vCenter5.
Please be advised that this article just outlines a procedure and does not describe any automated processes for certain steps. Check out Gabes blog over here for samples scripts to partially automate this procedure.