Script to Configure vSphere Supervisor Cluster using REST APIs

Last week I introduced you to vSphere Supervisor cluster APIs and also had a post on how to use DCLI for managing vSphere Supervisor cluster. In this post, I am going to show you how to enable/configure vSphere Supervisor cluster and also create namespace on the top of vSphere Supervisor cluster.
These key APIs are demonstrated using couple of python scripts. This time I thought let me try little different style of writing. I am sure you will enjoy learning.

1. Enable/configure vSphere Supervisor cluster :

What/Where/HowLink/Info
Where to refer REST
API documentation?
Official API documentation
or H5C –> Developer Center –> API Explorer
How do I land from VCF 4.0 on to vSphere for configuring this key workflow? Refer this cool short video
VCF 4.0 SDDC manager by Cormac
How do I create base setup for
labs, learning purpose?
Refer this cool deployment script
by William
My python script to configure Supervisor cluster on base setup configure_supervisor_cluster.py script.
Used python library “requests” to call APIs. We can use other “vSphere Automation SDKs” as well

or

Automating supervisor cluster workflows using Java SDK
Enable vSphere Supervisor cluster API POST https://{server}/api/vcenter/namespace-management/clusters/{cluster} ?action=enable
Complete API Spec/payload for above POST call API Spec
Enable API Spec/Payload I passed in my scriptGithub link for spec
you can use the same for postman call
How did I fetched inputs needed to be passed into POST Call? Refer line 139 through 178 in script
Sample runShown below
How it looks in UI before & after ?Shown below

How to run script :
C:\vThinkBeyondVM\vcpy>python configure_supervisor_cluster.py -s “10.x.x.x” -u “Administrator@vsphere.local” -cl “WCP-cluster-1” -mnw “VM Network” -sip “10.x.x.x” -sm “255.255.x.x” -gw “10.x.x.x” -dns “10.x.x.x” -ntp “10.x.x.x” -sp “k8s-gc-policy” -egress “10.x.x.x” -ingress “10.x.x.x”

Password will be asked on CLI. You might wonder, am I not passing VDS and Edge cluster? please refer the line 161 through 170. REST APIs allowed me to use some trick.

Which UI workflow is automated?
This python script automates below UI worklow, where user will configure workload network, management network, storage etc.


How it looks from UI
once Super visor cluster is enabled, this is how it looks (H5C > Menu > Workload Management)

2. Creating your first namespace using script

Create namespace URL POST https://{server}/api/vcenter/namespaces/instances
API payload/specpayload
Python scriptcreate_namespace.py
How to runShown below
How it looks from UIShown below

How to run script:
C:\vThinkBeyondVM\vcpy>python create_namespace.py -s 10.x.x.x -u Administrator@vsphere.local -cl WCP-cluster-1 -role EDIT -st USER -subject Administrator -domain vsphere.local -sp k8s-gc-policy -ns my-ns-2

How it looks from UI ?

I hope you enjoyed learning. Please stay tuned for upcoming posts around vSphere with K8s and other vSphere 7.0 functionality. Let me know if you have any queries, feedback.

Further reading:
1. REST API documentation
2. How to get vSphere with Kubernetes?
3. Introduction to manage vSphere Supervisor Cluster using API
4. Automating supervisor cluster workflows using Java SDK
5. vSphere with Kubernetes 101 is here
6. Official documentation for vSphere with Kubernetes is here

230 thoughts on “Script to Configure vSphere Supervisor Cluster using REST APIs

  1. About register Proactive Provider (the form module doesn’t work, this is why I write here) with register_provider.py, I’ve got this error message:
    Traceback (most recent call last):
    File “register_provider.py”, line 31, in
    providerId = heath_update_mgr.RegisterHealthUpdateProvider(name,health_updates)
    File “/usr/local/lib/python3.7/site-packages/pyVmomi/VmomiSupport.py”, line 706, in
    self.f(*(self.args + (obj,) + args), **kwargs)
    File “/usr/local/lib/python3.7/site-packages/pyVmomi/VmomiSupport.py”, line 512, in _InvokeMethod
    return self._stub.InvokeMethod(self, info, args)
    File “/usr/local/lib/python3.7/site-packages/pyVmomi/SoapAdapter.py”, line 1397, in InvokeMethod
    raise obj # pylint: disable-msg=E0702
    pyVmomi.VmomiSupport.InvalidArgument: (vmodl.fault.InvalidArgument) {
    dynamicType = ,
    dynamicProperty = (vmodl.DynamicProperty) [],
    msg = ‘A specified parameter was not correct: providerId’,
    faultCause = ,
    faultMessage = (vmodl.LocalizableMessage) [
    (vmodl.LocalizableMessage) {
    dynamicType = ,
    dynamicProperty = (vmodl.DynamicProperty) [],
    key = ‘com.vmware.vim.healthUpdateManager.associatedEntity’,
    arg = (vmodl.KeyAnyValue) [
    (vmodl.KeyAnyValue) {
    dynamicType = ,
    dynamicProperty = (vmodl.DynamicProperty) [],
    key = ‘arg’,
    value = ‘ProHAProvider1’
    }
    ],
    message = ‘Entity ProHAProvider1 is already associated.’
    }
    ],
    invalidProperty = ‘providerId’
    }

  2. Trulife Distribution – Nutrition Distribution helps our clients achieve success in a complex, competitive retail environment. Our team of nutrition industry experts takes care of everything from importation compliance to marketing, sales and distribution at the ground level. There is no need to navigate the complicated intricacies of the American market when we have already done the work. Let us use our experience to expand your brand and put your product into the hands of American consumers. https://trulifedist.com/

  3. Great goods from you, man. I have be aware your stuff previous to and you’re simply extremely
    wonderful. I really like what you’ve bought here, really like what
    you’re saying and the best way during which you are saying it.
    You’re making it enjoyable and you still care for to stay it wise.
    I can’t wait to read much more from you. This is really a terrific website.

  4. When I initially commented I clicked the “Notify me when new comments are added”
    checkbox and now each time a comment is added I get three e-mails with the same
    comment. Is there any way you can remove people from that service?
    Thanks a lot!

    my web blog: gema club suncity

  5. I have to thank you for the efforts you’ve put in writing
    this site. I really hope to see the same high-grade blog posts by you in the future as well.

    In truth, your creative writing abilities has inspired me to
    get my very own website now 😉

    my blog – kiss918 test id

  6. My developer is trying to persuade me to move to
    .net from PHP. I have always disliked the idea because of the
    expenses. But he’s tryiong none the less. I’ve been using WordPress on several websites
    for about a year and am concerned about switching to another platform.
    I have heard very good things about blogengine.net. Is there a way
    I can transfer all my wordpress posts into it? Any kind of help would be
    greatly appreciated!

    my web-site gem 918kaya

  7. I don’t even know how I finished up here, but I assumed this
    put up was once good. I do not recognize who you are but certainly you are going to a
    famous blogger in the event you aren’t already. Cheers!

    Here is my page: joker688

  8. I’ve been exploring for a bit for any high quality
    articles or blog posts in this kind of space . Exploring
    in Yahoo I ultimately stumbled upon this site. Studying this information So i am glad to convey that I’ve a very just right uncanny feeling
    I came upon just what I needed. I such a lot without a doubt will make sure to
    do not put out of your mind this website and provides
    it a look regularly.

    Feel free to visit my web-site – Download Aaa1188

  9. My developer is trying to convince me to move to .net from PHP.

    I have always disliked the idea because
    of the costs. But he’s tryiong none the less.
    I’ve been using WordPress on several websites for about a year and am worried about switching to another platform.

    I have heard fantastic things about blogengine.net. Is
    there a way I can import all my wordpress posts into it?
    Any help would be greatly appreciated!

    Also visit my site http://forum.yawfle.com/index.php?action=profile;u=66814

  10. Ꭲerrific articlе! That iss the tʏpe of information that
    are suрposed to be sharеd acroѕs the net. Ѕhame on Googⅼе for now not positioning this submit higher!

    Come on oѵer and seek adcice from myy web site
    . Thank you =)

  11. My programmer is trying to convince me to move to .net from PHP.
    I have always disliked the idea because of the expenses. But
    he’s tryiong none the less. I’ve been using WordPress on numerous websites for about a year
    and am concerned about switching to another platform.
    I have heard fantastic things about blogengine.net. Is there a way I can transfer all my wordpress content into
    it? Any kind of help would be really appreciated!

    Here is my page :: http://www.leadclub.net

  12. I’m really enjoying the design and layout of your blog.
    It’s a very easy on the eyes which makes it much more pleasant
    for me to come here and visit more often. Did you hire
    out a designer to create your theme? Exceptional work!

    Feel free to surf to my web site; Silvia

  13. Hi there, just became alert to your blog through
    Google, and found that it’s truly informative.
    I?m gonna watch out for brussels. I?ll appreciate
    if you continue this in future. A lot of people will be benefited from your writing.
    Cheers!

    Also visit my blog … mintjasia.com

  14. Undeniably believe that which you stated. Your favorite reason seemed to be on the web the simplest thing to be aware of.
    I say to you, I certainly get annoyed while people think about worries that
    they just do not know about. You managed to hit the nail upon the
    top and defined out the whole thing without having side effect ,
    people could take a signal. Will likely be back
    to get more. Thanks

    Visit my webpage … https://equipifieds.com/author/arnoldstern/

  15. I’ll immediately grab your rss as I can not to find your
    e-mail subscription hyperlink or e-newsletter service.
    Do you have any? Kindly let me know in order that I may just subscribe.
    Thanks.

    Feel free to visit my web-site … grautocar.com

  16. I simply wished to appreciate you once again. I do not know the things that I could
    possibly have created without the recommendations shown by you about such a
    problem. It was before a very daunting difficulty in my position, however ,
    encountering a professional mode you managed it forced me to cry over gladness.

    I’m happier for the information and then trust you comprehend what a great job that you are
    putting in teaching most people using a blog.
    I know that you have never met any of us.

    Look at my blog post … http://www.digitalnomadads.com

  17. This design is steller! You most certainly know how to
    keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.

    I really enjoyed what you had to say, and more than that, how you presented it.
    Too cool!

    My blog post … Bernadine

  18. Thank you, I have recently been searching for information about this topic for
    ages and yours is the greatest I’ve discovered till now.
    But, what concerning the conclusion? Are you positive in regards to the source?

    Also visit my webpage: interleads.net

  19. Oh my goodness! Awesome article dude! Thanks, However I am having
    difficulties with your RSS. I don’t understand why I cannot subscribe
    to it. Is there anybody else having the same RSS issues?
    Anybody who knows the solution can you kindly respond? Thanx!!

    Have a look at my web-site … bettyjostarke.net

  20. Wonderful items from you, man. I’ve take into accout
    your stuff previous to and you’re just extremely fantastic.
    I really like what you’ve acquired right here, certainly like what you’re stating and the way through which
    you are saying it. You are making it entertaining and you continue to take care of to stay it smart.
    I can’t wait to read much more from you. That is actually a terrific website.

    my web site: biblioray.pusku.com

  21. Wonderfuⅼ goօds from you, man. I’ve unnderstand your stuff previous to and you’re just too magnificent.
    I really like what you have aquired here, certainly like what you are stating and
    thee way iin which yoou say it. You make іt entеrtaining
    and you still take carе of to keep it sensible. I can’t wsit tօ read far more from you.
    This is really ɑ tremendous sіte.

  22. Thanks a lot for giving everyone an extremely special possiblity
    to discover important secrets from this web site. It is often so good
    and also packed with a great time for me personally and my office
    acquaintances to search your web site on the least thrice in one week
    to read the fresh guides you will have. And of course, I’m always astounded with the splendid principles served by you.
    Some 2 facts on this page are easily the most suitable we have all had.

    my blog – diecast.org

  23. Write more, thats all I have to say. Literally, it seems as
    though you relied on the video to make your point.

    You definitely know what youre talking about, why waste
    your intelligence on just posting videos to your site
    when you could be giving us something informative to read?

    Feel free to visit my web-site https://kodeforest.net/wp-demo/disaster-relief/community/profile/hardwicktina

  24. Good website! I really love how it is simple on my
    eyes and the data are well written. I am wondering how I might be notified
    whenever a new post has been made. I have subscribed to your RSS feed which must do the trick!
    Have a nice day!

    Here is my web-site :: Lester

  25. Wonderful goods from you, man. I have understand your stuff previous to
    and you’re just too excellent. I really like what
    you have acquired here, certainly like what you’re stating and the way in which you say it.

    You make it entertaining and you still care for to keep it wise.
    I cant wait to read far more from you. This is really a wonderful web site.

    My webpage; Shirley

  26. Hello there I am so grateful I found your blog page, I really found
    you by error, while I was looking on Digg for something else, Regardless I am here now and would just like to say thanks a lot for a
    marvelous post and a all round thrilling blog (I also love the theme/design), I don’t have time
    to read through it all at the minute but I have bookmarked it and also included your RSS
    feeds, so when I have time I will be back to read a great deal more, Please do keep up the
    superb job.

    my webpage :: conorneill.com

  27. Wow that was unusual. I just wrote an extremely long comment but after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over
    again. Anyways, just wanted to say wonderful blog!

    Here is my homepage … axomo.com

  28. Hello, i read your blog occasionally and i own a similar one and i was
    just wondering if you get a lot of spam comments? If so
    how do you protect against it, any plugin or anything you can recommend?
    I get so much lately it’s driving me crazy so any assistance is
    very much appreciated.

    Here is my web blog biomicrobics.com

  29. What’s up every one, here every person is sharing such experience, so it’s fastidious to read this weblog,
    and I used to visit this website daily.

    Have a look at my web page; Junko

  30. Hello are using WordPress for your site platform? I’m new to
    the blog world but I’m trying to get started and set up my own.
    Do you need any html coding knowledge to make your own blog?
    Any help would be really appreciated!

    Visit my blog post biomicrobics.com

  31. Hi my family member! I want to say that this article
    is amazing, nice written and include approximately
    all vital infos. I’d like to look extra posts like this .

  32. I was just looking for this information for some time.
    After 6 hours of continuous Googleing, at last I got it
    in your website. I wonder what is the lack of Google strategy
    that don’t rank this kind of informative web sites in top of the list.
    Usually the top web sites are full of garbage.

    My web blog – endurancefam.com

  33. Excellent post. Keep writing such kind of information on your
    site. Im really impressed by it.[X-N-E-W-L-I-N-S-P-I-N-X]Hey there,
    You have performed an excellent job. I’ll certainly digg it and in my
    view recommend to my friends. I am confident they will be benefited from
    this web site.

    Review my site :: returngain.com

  34. My programmer is trying to convince me to move to .net from PHP.

    I have always disliked the idea because of the
    costs. But he’s tryiong none the less. I’ve been using Movable-type on various websites for about a year
    and am nervous about switching to another platform. I have heard
    great things about blogengine.net. Is there a way I can transfer all my
    wordpress posts into it? Any kind of help would be really appreciated!

    Have a look at my site https://alichehade.net/community/profile/byersali/

  35. Hello! I realize this is kind of off-topic but I had to ask.
    Does building a well-established website such as yours require a lot of work?

    I am brand new to blogging but I do write in my
    diary everyday. I’d like to start a blog so I can share my experience and
    thoughts online. Please let me know if you have any kind of ideas or tips for new aspiring
    blog owners. Thankyou!

    Feel free to surf to my webpage – diecast.org

  36. That is a really good tip particularly to those new to the blogosphere.

    Brief but very accurate information… Many thanks for
    sharing this one. A must read article!

    Also visit my web blog: Loren

  37. Please let me know if you’re looking for a article writer
    for your blog. You have some really good posts and I
    think I would be a good asset. If you ever want to take some
    of the load off, I’d absolutely love to write some content for your blog in exchange for a link back to mine.
    Please blast me an email if interested. Many thanks!

  38. Does anyone know what happened to Dime Piece LA celebrity streetwear brand? I cannot proceed to the checkout on Dimepiecela site. I have read in Vogue that the brand was acquired by a UK hedge fund in excess of $50m. I’ve just bought the Dimepiece Fire & Desire Makeup Bag from Ebay and totally love it xox

  39. Before you purchase your outdoor projector, you should check out the price at several retail stores. Once you find the best outdoor projector for your viewing needs at a price you can afford, you will be ready to make the purchase.

  40. Choosing a baby stroller doesn’t have to be difficult if you know what type of quality you’re looking for. By doing so, you’re more likely to find a stroller that will suit your needs. Once you have found the best strollers on the market, remember to give a newborn your full attention.

  41. It’ѕ remarkable tօ pay a գᥙick visit thiѕ webѕite and reading the views of all matеs about this paragraph,
    while I am alsߋ eager of getting know-how.

  42. I seldom write comments, but i did a few searching and wound up here Script to Configure
    vSphere Supervisor Cluster using REST APIs | vThinkBeyondVM.
    And I actually do have a couple of questions for you if
    you usually do not mind. Could it be only me or does it look like
    some of the responses appear as if they are left by brain dead
    people? 😛 And, if you are posting at additional sites, I’d like to follow everything fresh you have to post.

    Would you make a list of all of all your public pages like your twitter
    feed, Facebook page or linkedin profile?

    my web site; http://haojiafu.net/

  43. It is appropriate time to make a few plans for the long run and it’s time to be happy.
    I have read this post and if I may just I want to suggest you some interesting
    things or tips. Maybe you could write next articles regarding this article.

    I desire to read even more issues about it!

    Feel free to surf to my blog post http://www.saraykapi.com/

  44. Hi, i feel that i saw you visited my site so i came to ?return the
    want?.I’m attempting to in finding things to
    improve my website!I suppose its good enough to make use of a few of your ideas!!

    Here is my page … bgmobile.eu

  45. I don’t leave a response, but I read a great deal of responses
    here Script to Configure vSphere Supervisor Cluster
    using REST APIs | vThinkBeyondVM. I do have a couple
    of questions for you if it’s allright. Could it be just me or does it look as if like a few of
    the responses come across like they are written by brain dead folks?
    😛 And, if you are posting at other sites, I’d like to follow everything fresh you have to post.
    Could you make a list of all of your social sites like your linkedin profile, Facebook
    page or twitter feed?

    Check out my blog post; http://www.craksracing.com

  46. Remember…

    Goodbyes are only for those who love with their eyes.

    Because for those who love with heart and soul

    there is no such thing as separation.
    ———————————————–

    Award Winning Health Alert Site.
    Be in the know before the rest.

    https://bit.ly/3uh4Qf2

  47. Merchant Accounts For Trực Tuyến Smoke Shops|Best Trực Tuyến Headshop 2021|#1 Online Headshop|Zerona Smoke Shop|Denver’s Premier Smoke Cửa Hàng online head shop bath salts smartphone app, you can find everything you need to know on the #DopeBoo blog. The problem with most trực tuyến head shops is they’re only the middlemen for other sellers. Everything you see here is from a genuine trực tuyến smoke shop staffed by a professional team of experts who use the same products you do.|We’ve made the world’s best smoke cửa hàng with only the best bongs, vapes, and dab rigs. They all of the new and hottest brands, our new favorite being Mathematix Glass. They stock a long list of American made glass and offer không tính phí U.S. shipping on all products. Another plus is that their hassle-không tính phí returns and customer service are remarkable.

Leave a Reply

Your email address will not be published. Required fields are marked *