Virtual Distributed Switch Upgrade

Blog: Automating the Upgrade of the Virtual Distributed Switch

Automating the Upgrade of the Virtual Distributed Switch

 

We are on the home stretch of our Automating your vSphere Upgrade blog series. The final step of completing our upgrade will be upgrading our Virtual Distributed Switch (VDS). When upgrading your VDS on vSphere 6.7 the version is actually 6.6 (we will cover the details later). Please make sure prior to upgrading your VDS to 6.6 all ESXi hosts have been upgraded to ESXi 6.7, if you still have hosts on ESXi 6.5 you will only be able to upgrade to version 6.5.

Considerations for Upgrading your Virtual Distributed Switch

The first consideration we would like to think about is why would I want to upgrade my VDS? Well if you had previously upgraded from vSphere 5.5 your VDS still may be on version 5.5 and this is not compatible with vSphere 6.7. Another reason is that we can review the new features that are listed below, we can see this when we click on the (i) within the VDS GUI. We can see that upgrading to version 6.0 gets us NIOC v3 and IGMP/MLD snooping, version 6.5 gives us port mirroring enhancements and version 6.6 gets us mac learning. If you run any nested virtualization in your environment this is a great enhancement as we no longer require you to enable promiscuous mode on your VM port group.

Another consideration I like to recommend is that you keep your VDS upgraded to the same version as your ESXi hosts whenever possible. Previously in most vSphere versions it has always been said that upgrading your VDS can be done at anytime and is a non-disruptive upgrade., but we always want to use caution and do this within a maintenance window. The VDS upgrade is also something that has no rollback, once it is complete it is permanent unless you have completed a backup.

With vSphere 6.7 and the introduction of VDS version 6.6 there are some known issues and considerations I want to mention prior to getting started upgrading our switch. A question I get asked quite frequently is why is vSphere 6.7’s VDS version 6.6? The answer is quite simple, VMware on AWS (VMC) shares quite a bit of the same code as vSphere On-Perm and since there were no major changes to the VDS features or functionality the version stayed the same. Prior to upgrading our VDS version to 6.6 we definitely want to make sure we review KB52621. This KB covers considerations around known issues upgrading to version 6.6. Some of these considerations are making sure to put DRS into partially automated mode since if a vMotion occurs during the upgrade the VDS upgrade will fail. To take these considerations into account, we will make sure to include this in our Upgrading your Virtual Distributed Switch automation.

Prior to upgrading we also need to verify that all hosts have been upgraded to vSphere 6.7 so we do not have any errors. If there is a incompatible host attached the upgrade will not be allowed to proceed.

To validate our ESXi host version for all hosts attached to our VDS we can do so as follows.

We can see here that one of our hosts is not upgraded to 6.7 so if we were to proceed with upgrading our VDS it would fail. Before we proceed on to our next section we will make sure to upgrade our ESXi host to vSphere 6.7. If we were to attempt to upgrade our VDS prior to upgrading we would have encountered an error such as below.

Upgrading your Virtual Distributed Switch

Now that we are ready to move forward with upgrading our VDS, we will take some of the above considerations into place. Since we know if a vMotion is occurring during upgrade it will fail. We will make sure that if DRS is enabled we will put it into Partially Automated mode. Also, since we know we cannot rollback from a version upgrade we will make sure to take a backup prior to our upgrade. Unlike our previous blogs where we used simple one-liners, we will utilize a bit more logic in this upgrade that will be required as a script.

As an introduction to the below script we will outline what it does. At the top we define variables for the VDS Name, Version we wish to upgrade to and the cluster(s) in which the VDS is attached. We will then check if DRS is enabled on the vSphere Cluster. If DRS is enabled we will store the current DRS Automation level and set it to Partially Automated, Backup the VDS, Upgrade the VDS and then we will restore the DRS Level back to the original state. If DRS is disabled, we perform a Backup of the VDS and then Upgrade the VDS.

You can see the code below and grab the script from GitHub.

 

 1234567891011121314151617181920  Connect-VIServer "ds-vcsa-03.cpbu.lab" | Out-Null$VDSwitch = "VDS"$VDVersion = "6.6.0"$Cluster = Get-Cluster "Cluster"If ($Cluster.DrsEnabled -like "True") {Write-Host "DRS is Enabled, it will be temporarily disabled during upgrade." -ForegroundColor "Green"$ClusterDRSLevel = $Cluster.DrsAutomationLevelWrite-Host "DRS Cluster is currently set to $ClusterDRSLevel. Will change back when complete." -ForegroundColor "Green"Get-Cluster $Cluster | Set-Cluster -DrsAutomationLevel "PartiallyAutomated" -Confirm:$falseGet-VDSwitch -Name $VDSwitch | Export-VDSwitch -Description "My Backup" -Destination "/PathToBackup/VDSBackup-$VDswitch-$((Get-Date).ToString(‘yyyy-MM-dd-hh-mm’)).zip"Get-VDSwitch -Name $VDSwitch | Set-VDSwitch -Version $VDVersionWrite-Host "Upgrade is complete. Setting Cluster to $ClusterDRSLevel." -ForegroundColor "Green"Get-Cluster $Cluster | Set-Cluster -DrsAutomationLevel $ClusterDRSLevel -Confirm:$false}ElseIf ($Cluster.DrsEnabled -like "False") {Write-Host "DRS is Disabled, No additional action needed." -ForegroundColor "Green"Get-VDSwitch -Name $VDSwitch | Export-VDSwitch -Description "My Backup" -Destination "/PathToBackup/VDSBackup-$VDswitch-$((Get-Date).ToString(‘yyyy-MM-dd-hh-mm’)).zip"Get-VDSwitch -Name $VDSwitch | Set-VDSwitch -Version $VDVersion}

As we can see the upgrade is now complete. Even though the upgrade is itself a simple one-liner (Get-VDSwitch -Name $VDSwitch | Set-VDSwitch -Version $VDVersion), we can automate the pre-requisites, backups and considerations to make this a more seamless upgrade. If you are interested in understanding how you can upgrade your VDS through the UI please see my colleague Nigel Hickeys blog here.

You can find more information on Backing Up and Restoring your VDS here and more information on Upgrading your Virtual Distributed Switch here.

Conclusion

As we have now completed Automating our vSphere Upgrade we can see it wasn’t so bad after all. Im hoping this series has helped you better understand what it takes to Automate your vSphere Upgrade and for those of you with large environments it gives you an idea on how you can start to streamline the upgrades across your entire vSphere environment.

 Article: https://blogs.vmware.com/vsphere/2018/10/automating-upgrade-of-virtual-distributed-switch.html

 Date: 2018-10-29

Blog: vSphere Upgrade Series Part 6: Upgrading vSphere Networking

vSphere Upgrade Series Part 6: Upgrading vSphere Networking

 

Congratulations! You have made it to the final part of the vSphere Upgrade Series, Part 6: Upgrading vSphere Networking. To recap, I kicked off this series by reviewing our Upgrade prerequisites & compatibility, gathering our data, and Preparing to Upgrade. Next we continued by upgrading vCenter Server and migrating vSphere Update Manager (VUM) from vSphere 6.0 Update3 to 6.7. Continuing on from there we walked through preparing VUM with an Upgrade Baseline to remediate the vSphere ESXi hosts to vSphere 6.7. After the hosts were upgraded to vSphere 6.7 we moved on to upgrading VMware Tools and VM Compatibility followed by upgrading VMFS datastores.

Upgrading VDS

Virtual networking comes in as Step 6 in the overall vSphere Upgrade process. Because vSphere 6.7 is not compatible with vSphere 5.5 components, one requirement is making sure that the vSphere Distributed Switch (VDS) has been upgraded to at least a 6.x version during your upgrade journey. What I mean here is that since there is no upgrade path from 5.5 to 6.7 directly, the upgrade from 5.5 will bring you to 6.x before moving to 6.7. After getting up to vSphere 6.x and before upgrading to vSphere 6.7, you must update the VDS to a 6.x version. If this is not completed prior to upgrading your upgrade may fail.

When creating or updating a vSphere distributed switch in vSphere 6.7 you have 3 options or versions to move to.

  1. vSphere 6.0
  2. vSphere 6.5
  3. vSphere 6.6

Most updates to networking have been within ESXi itself, but some features require upgrading VDS as outlined above. When upgrading to VDS version 6.0 or 6.5 it’s quite simple and can be done with no disruption. However, when upgrading to VDS version 6.6 there are some considerations to take, KB52621 has considerations to review to prevent most issues.

Upgrading vSphere Networking

In my lab I will be upgrading a vSphere Distributed Switch (VDS) from version 6.0 to 6.6.

Step 1: First we will review what version the current VDS is running by viewing the Summary tab on the Networking screen. Once reviewed we will move to upgrading.

Upgrading vSphere Networking

Step 2: Here we click on the Upgrades Available link and can see an upgrade is needed.

Upgrading vSphere Networking

Step 3: Click on the Actions menu then browse to Upgrade, and choose Upgrade Distributed Switch

Upgrading vSphere Networking

Step 4: On the upgrade wizard, review the version choices by click on the “i” for more info. From here you can see the benefits that come with each VDS version. Once a selection is made, click Next to continue.

Upgrading vSphere Networking

Step 5: Once the switch upgrade completes, you can see the new version shown on the Summary tab of the Networking screen. The VDS upgrade is now finished.

Conclusion

Thats a wrap! From beginning to end of a vSphere Upgrade, component to component, screen by screen. I hope that this series has helped take some of the unknowns or complexity away from your vSphere Upgrade Journey. My job is to educate as well as help make things easier to understand and digest. If these blogs have helped in anyway, please leave a comment.

For review, please follow the below links to each part of the vSphere Upgrade Series:

Please do not hesitate to post questions in the comments section of this blog or reach out to me directly via Twitter @vCenterNerd.

Remember to always, FocusPlan, and Execute!

 Article: https://blogs.vmware.com/vsphere/2018/09/vsphere-upgrade-series-part-6-upgrading-vsphere-networking.html

 Date: 2018-10-29

Filter Tags