My last post was about introduction to vSphere Supervisor Cluster Kubernetes REST APIs, where I briefed about key constructs such as “vSphere Supervisor Cluster” and “Tanzu Kubernetes cluster” but major focus was to introduce REST APIs around it and how to execute these APIs using H5C built-in API Explorer. As per me, it is must to read that post before you proceed. This post is about how to manage vSphere Supervisor Cluster using DCLI (Datacenter CLI). As you might already know that DCLI is a CLI exclusively for REST APIs and it supports vSphere Automation APIs (REST APIs for vSphere), VMware cloud on AWS and even NSX as well. Beauty of the DCLI is that it comes by-default as part of VCSA installation though we can install it in other Guest OSes also.
As I mentioned in the last post , “vSphere Supervisor Cluster” REST APIs are exposed by vCenter server i.e. every DCLI command we execute would be executed against vCenter server, where vSphere Supervisor cluster is configured or going to be configured. Let’s dive into it. In my case, I am going to access DCLI that comes automatically with VCSA.
First step is to SSH VCSA 7.0 and run below command
dcli +interactive +server 10.20.30.40 +skip-server-verification
We need to pass vCenter server IP as a server. I will be running DCLI in interactive mode so that we get automatic help on available options with press of space or it gets showed as you type. This is very useful if you do not know where to start for new APIs as this.
We are now in DCLI console. As I showed in my last post, these REST APIs are identified as “namespace management” & “namespaces”. Since these are “vcenter” APIs, when we just type “vcenter” and press “space”, you will get auto-populated list of options available as shown below, is not that cool ?
You can see cluster “domain-c9” (its moid) is compatible but cluster “cluster-c19” does not meet any basic requirements.
Below are few more basic commands (mostly GET calls)
Command #1: Disabling “vSphere with K8s” on given cluster
dcli> vcenter namespacemanagement clusters disable --cluster <cluster moid>
cluster moid/identifier looks like “domain-cx”. You can get it from UI (click on cluster and just check URL in browser or REST API/SOAP/MOB can help as well)
Command #2: Know compatible VDS on given cluster
dcli> vcenter namespacemanagement distributedswitchcompatibility list --cluster domain-c9
Command #3: Get compatible NSX-T edge cluster on given cluster and VDS
dcli> vcenter namespacemanagement edgeclustercompatibility list --cluster domain-c9 --distributed-switch "50 13 e2 3b 7d 5e 59 4b-63 1c c5 d9 ab 25 cd 7e"
VDS uuid you get from command #2 above.
Command #4: Get list of namespaces available
dcli> vcenter namespaces instances list
Command #5: Get available Kubernetes versions
dcli> vcenter namespacemanagement clusteravailableversions list
dcli> vcenter namespacemanagement software clusters get --cluster <cluster-identifier/moid>
dcli> vcenter namespacemanagement software clusters list
Command #6: Know what are sizes and resources requirements (TINY, SMALL, MEDIUM, LARGE )
dcli> vcenter namespacemanagement clustersizeinfo get
I hope this article was good head start for you on how to manage vSphere Supervisor cluster using DCLI. There are more advanced operations like enable, update, create (POST calls) etc that I will have deep dive into my future posts. Please stay tuned.
1. REST API documentation and my new post on automating Supervisor cluster configuration or Automating supervisor cluster workflows using Java SDK
2. How to get vSphere with Kubernetes?
3. vSphere with Kubernetes 101 is here
4. Introduction to vSphere Supervisor Cluster REST APIs
5. Official documentation for vSphere with Kubernetes is here
Vikas Shitole is a Staff engineer 2 at VMware India R&D. He currently focusses on vCenter server in general, vSphere with Tanzu, VCF and partly VMware cloud. He is passionate about VMware customers & automation around VMware technologies. He has been a vExpert since last 9 years (2014-22) in row for his significant community contributions around VMware. He is also part of BU driven vExpert sub-programs i.e. vExpert App modernization, vExpert VMware Cloud on AWS & vExpert PRO as well. He is author of 2 VMware flings & holds multiple technology certifications. He has been speaker at International conferences such as VMworld Europe, VMworld USA & was designated VMworld 2018 blogger as well.
In addition, he is passionate cricketer, bicycle rider & aspiring Ironman 70.3. He also enjoys learning about fitness & nutrition.