Upgrade NSX Manager via Rest API

By | 04/06/2018

VMware released NSX 6.4.0. this month and this version brought many features, improvements and bug fixes which are outlined in the Release Notes

Before upgrading to NSX 6.4.1, check VMware interop matrix to make sure your underlying infrastructure is compatible with this version. Your VMware vSphere should be at 6.0 U2 or greater to upgrade to NSX 6.4

nsx-upgrade-interop.PNG

I am currently running NSX 6.3.5 in my lab and I thought to upgrade it to 6.4. I wanted to play with Rest API option for NSX manager upgrade, as from GUI I have done several times.

nsx-up-1.PNG

You can find the instructions about upgrade via Rest API on page 124 of NSX-6.3-API-Guide

Lets walk through this step by step.

1: Download the NSX upgrade bundle: NSX 6.4 upgrade bundle can be downloaded from here

2: Upload the upgrade bundle: I have downloaded the upgrade bundle on one of my linux box where I have curl installed and I will be employing curl to fire Rest API.

# curl -sikv -u ‘admin’ -H ‘Accept:application/xml’ -F file=@VMware-NSX-Manager-upgrade-bundle-6.4.1-8599035.tar.gz -X POST https://nsxmgr-01a.corp.local/api/1.0/appliance-management/upgrade/uploadbundle/NSX 

You will see following output when upload of upgrade bundle completes.

nsx-up-2

3: Verify that the NSX bundle is uploaded: You can use following API call to verify successful upload of upgrade bundle.

# curl -sik -u ‘admin’ -H ‘Accept:application/xml’ -X GET https://nsxmgr-01a.corp.local/api/1.0/appliance-management/upgrade/information/NSX | tidy -xml -indent -quiet

If the upgrade bundle was uploaded successfully then you will see following output

nsx-up-3

4: Start the NSX Manager Upgrade: Fire below API call to initiate the upgrade process

# curl -sik -u ‘admin’ -H ‘Content-Type:application/xml’ -X POST https://nsxmgr-01a.corp.local/api/1.0/appliance-management/upgrade/start/NSX -d @nsxupgrade.xml

where contents of nsxupgrade.xml is as below

<?xml version=“1.0” encoding=“UTF-8”?>
<preUpgradeQuestionsAnswers>
<preUpgradeQuestionAnswer>
<questionId>preUpgradeChecks1:Q1</questionId>
<question>Do you want to enable SSH ?</question>
<questionAnserType>YESNO</questionAnserType>
<defaultSelection>NO</defaultSelection>
</preUpgradeQuestionAnswer>
<preUpgradeQuestionAnswer>
<questionId>preUpgradeChecks1:Q2</questionId>
<question>This product participates in VMware’s Customer Experience Improvement Program (“CEIP”). The CEIP provides VMware with information that enables VMware to improve its products and services, to fix problems, and to advise you on how best to deploy and use our products. As part of the CEIP, VMware collects technical information about your organization’s use of VMware products and services on a regular basis in association with your organization’s VMware license key(s). This information does not personally identify any individual. For additional information regarding the CEIP, please see the Trust and Assurance Center at http://www.vmware.com/trustvmware/ceip.html. You can select your participation preferences below. Do you want to join the VMware Customer Experience Improvement Program ?</question>
<questionAnserType>YESNO</questionAnserType>
<defaultSelection>YES</defaultSelection>
</preUpgradeQuestionAnswer>
</preUpgradeQuestionsAnswers>

5: Verify NSX Manager Upgrade Status: Upgrade status can be checked via below API

# curl -sik -u ‘admin’ -H ‘Accept:application/xml’ -X GET https://nsxmgr-01a.corp.local/api/1.0/appliance-management/upgrade/status/NSX

If the upgrade is successful, you will see below output for above call

<?xml version=”1.0″ encoding=”UTF-8″?>
<upgradeStatus>
<status>COMPLETE</status>
</upgradeStatus>

I logged in to NSX UI and verified that my NSX manager has been upgraded to 6.4.1

nsx-up-5.PNG

That’s it for this post. 

Additional Resources

Preparing for the NSX Upgrade

NSX 6.4 Upgrade Guide

NSX Documentation

I  hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing. Be sociable :)

Category: NSX

About Alex Hunt

Hi All I am Manish Jha. I am currently working in OVH US as Operations Support Engineer (vCloud Air Operations). I have around 7 Years of IT experience and have exposure on VMware vSphere, vCloud Director,vSphere Replication, vRealize Automation, NSX and RHEL. If you find any post informational to you please press like and share it across social media and leave your comments if you want to discuss further on any post. Disclaimer: All the information on this website is published in good faith and for general information purpose only. I don’t make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this blog is strictly at your own risk. The Views and opinions published on this blog are my own and not the opinions of my employer or any of the vendors of the product discussed.