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 commanddcli +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 ?
As in my last post, let’s check the compatibility of the cluster to confirm whether key requirements are met or not on given clusterdcli> vcenter namespacemanagement clustercompatibility list
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 clusterdcli> 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 clusterdcli> vcenter namespacemanagement distributedswitchcompatibility list --cluster domain-c9
Command #3: Get compatible NSX-T edge cluster on given cluster and VDSdcli> 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 availabledcli> vcenter namespaces instances list
Command #5: Get available Kubernetes versions dcli> vcenter namespacemanagement clusteravailableversions list
ordcli> vcenter namespacemanagement software clusters get --cluster <cluster-identifier/moid>
or 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.
Further reading:
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 (by Broadcom) India R&D. He currently contributes to core VMware products such asĀ vSphere, VMware Private AI foundation and partly VCF . He is an AI and Kubernetes enthusiast. He is passionate about helping VMware customers & enjoys exploring automation opportunities around core VMware technologies. He has been a vExpert since last 11 years (2014-24) in row for his significant contributions to the VMware communities. He is author of 2 VMware flings & holds multiple technology certifications. He is one of the lead contributors to VMware API Sample Exchange with more than 35000+ downloads for his API scripts. He has been speaker at International conferences such as VMworld Europe, USA, Singapore & was designated VMworld 2018 blogger as well. He was the lead technical reviewer of the two books “vSphere design” and “VMware virtual SAN essentials” by packt publishing.
In addition, he is passionate cricketer, enjoys bicycle riding, learning about fitness/nutrition and one day aspire to be an Ironman 70.3
One thought on “Introduction to managing vSphere Supervisor Cluster using DCLI”
Comments are closed.