WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Search Results for: content library

govmomi (vSphere SDK for Go), govc CLI & Kubernetes on vSphere

09.04.2014 by William Lam // 15 Comments

go-sdk-for-vsphere
One of the exciting announcements that was made last week at VMworld was the joint partnership between Docker, Google, Pivotal and VMware. Paul Strong (Office of the CTO) wrote a great blog post Better Together – Containers are a Natural Part of the Software-Defined Data Center where he goes into more details about the partnership. The really neat part of the announcement which I think some people may have missed is that this was more than just an announcement. There are actually active projects currently being worked on, most notably a working prototype for a Kubernetes vSphere Provider.

For those of you who are not familiar with Kubernetes, it is an open-source project that was started by Google which provides Container Cluster Management. You can think of Kubernetes as a placement engine/scheduler for Containers, similar to how vSphere DRS is responsible for scheduling Virtual Machines. The Kubernetes vSphere Provider allows you to run a Kubernetes Cluster on top of a vSphere based infrastructure and provides a platform for scheduling Docker Containers running on top of vSphere.

Kubernetes is completely written in Go (short for Golang), a programming language developed by Google. To be able to easily integrate with Kubernetes, a Go library needed to be written for the vSphere API and hence govmomi was born! Similar to pyvmomi and rbvmomi which are vSphere SDKs for Python and Ruby respectively, govomimi is the vSphere SDK equivalent for Go. The govmomi project is an open source project lead by VMware and you can find the Github repository at https://github.com/vmware/govmomi.

In addition to govmomi, I also learned about a neat little CLI that was built on top of the SDK called govc (currently an Alpha release) which provides a simplified command-line interface to a vSphere environment leveraging govmomi. You can find the source code under the govmomi Github repository https://github.com/vmware/govmomi/tree/master/govc. The Kubernetes vSphere Providers leverages govc to be able to orchestrate the deployment of a Kubernetes Cluster on top of vSphere leveraging the vSphere API.

To use govc, you will need to ensure you have Go 1.2+ installed on your system. Here are the steps on installing Go and govc

Step 1 - Download the latest Go package installer for your OS here and once you have Go installed, you can verify that everything is working by running the following command:

go version

Screen Shot 2014-09-03 at 4.00.10 PM
Step 2 - Setup your build environment by running the following commands:

export GOPATH=$HOME/src/go
mkdir -p $GOPATH
export PATH=$PATH:$GOPATH/bin

Screen Shot 2014-09-03 at 4.02.17 PM
Step 3 - Check out govc source code by running the following command:

go get github.com/vmware/govmomi/govc

Screen Shot 2014-09-03 at 4.03.00 PM
At this point, govc has been installed. You can now connect to either a vCenter Server or ESXi host. The easiest way is to specify the vSphere API endpoint and credentials is by setting a couple of environmental variables, so you do not have to specify it on the command-line.

Step 4 - Run the following command and specify the username, password and either the hostname or IP Address of your vCenter Server or ESXi host:

export GOVC_URL='https://[USERNAME]:[PASSWORD]@[ESXI-OR-VCENTER-HOSTNAME-OR-IP]/sdk'

Step 5 - To verify that everything is working, you can run the following command to query the endpoint you have connected to:

govc about

Screen Shot 2014-09-03 at 4.45.06 PM
If everything was successful, you should see some basic information about the vSphere API endpoint you have connected to. In the example above, I am connected to a VCSA (vCenter Server Appliance). The govc CLI is quite similar to RVC with commands broken up into various namespaces. However, one feature that is not there today is the ability to tab complete the commands which is something I just love about RVC!

You can also just run "govc" and it will provide a list of available commands:
Screen Shot 2014-09-03 at 4.45.19 PM
You can get more details about each command by specifying --help command, here is an example of the host.info
Screen Shot 2014-09-03 at 4.45.58 PM
To get information about one of my ESXi hosts, I need to specify --host.ip option along with the IP:
Screen Shot 2014-09-03 at 4.46.20 PM
As you can see from the screenshot above, some basic information is displayed about my ESXi host which is running on a Mac Mini. If you would like to learn more about govc, I highly recommend you check out the govc repository on Github which has additional documentation. You can also file any bugs or feature requests you would like to see on the project page.

At this point you are now ready to proceed to the next steps which is to setup Kuberentes and deploy a Kubernetes Cluster onto your vSphere environment. Unfortunately I ran into a problem while going through the Kubernetes deployment and I did not know where to go next and decided to file a Github issue here. To my surprise, I immediately got a response back from the VMware Engineers who are working on the project. I had a couple of email exchanges with the team to debug the problem. It looks like we found the culprit and I was able to get Kubernetes up and running. There are a couple of minor caveats which I will explain in more detail in Part 2 of this post and walk you through the steps of deploying a Kubernetes Cluster running on top of vSphere.

Categories // Automation, Docker, ESXi, vSphere Tags // container, Docker, go, golang, govc, govmomi, Kubernetes, vSphere

How to finally inject OVF properties into VCSA when deploying directly onto ESXi?

05.27.2014 by William Lam // 40 Comments

One of my biggest pet peeve when it comes to deploying the VCSA (vCenter Server Appliance) and other OVF/OVA directly onto an ESXi host is the lack of OVF property support. If you have deployed the VCSA before, you are probably aware of the different user experience when deploying to a vCenter Server versus deploying directly to an ESXi host. For those of you who are not familiar, the difference is when you deploy an OVF/OVA that contains custom OVF properties such as the VCSA, you have the ability to provide input to these parameters when deploying to a vCenter Server as seen in the screenshot below.

[Read more...]

Categories // Automation, ESXi, OVFTool, VAMI, VCSA, vSphere Tags // ESXi, fusion, injectOvfEnv, ova, ovf, ovftool, VCSA, vcva, workstation

Check out the new and improved VMware Developer Center!

09.23.2013 by William Lam // 2 Comments

One common piece of feedback that we have heard from customers and partners over the years is how difficult it can be to get started with using VMware's API and SDKs. The biggest challenge is not actually using the API and SDKs, but actually finding out what is available for a particular product or the solution you are trying to develop. The other challenge of course is where to download the API/SDK, language support and their corresponding documentation.

In the past, this information would be scoured throughout VMware's website and Google searches will usually lead folks to the VMware Developer Center. The site has been in need of a major revamp for awhile now and I am glad to see that VMware has taken this feedback very seriously as I have provided similar feedback when I was a customer as well as employee.

I am happy see that we have re-launched the VMware Developer Center which now contains a wealth of useful information that has never been available before! I was one of the lucky few who received early access to the new VMware Developer Center to help provide feedback on how we can better improve our user experience with the site. This will continue to be a work in progress based on on-going feedback from customers and partners.

Here are a few things worth checking out ...

Development & Certification

The first thing I think everyone will just LOVE is that VMware is now listing EVERY single API/SDK that is available which includes public API/SDKs as well as what is known as "Gated API/SDK" that usually are available to partners only. The reason this is a big deal is if you are a new partner, how do you know what is available to you and how can you add value on top of the VMware eco-system? You now can get a list of all VMware API/SDKs under the Developement & Certification section and it provides you with a high level of what each API/SDKs provides. For gated API/SDK, you will see a tiny lock symbol next to it. When you login to MyVMware and you are supposed to have access to these API/SDKs, the icons will be unlocked and you will be able to get more details including downloads and documentation. You can also filter the views by specific API/SDKs as well as scripting/programming language.

vCloud Suite Library

Earlier I mentioned that it was quite difficult for someone to figure out exactly what API/SDKs are available for a particular product, especially within the vCloud Suite. One really neat feature is under the "Library" section which provides you with a high level diagram of the VMware vCloud Suite and it is an interactive diagram which you can hover over and it provides information about each product. If you click on one of the products, it will provide more information on the API/SDKs that can be used to integrate or access that particular product. This is a great way to learn about VMware products from a scripting/programmatic perspective and we also have one for the Horizon Suite.

VMware Standards

One other cool page to visit is the "Standards" page which currently just contains the UX design standards for the vSphere Web Client. If you want to learn more about the design principles used to create the vSphere Web Client or looking to build your own vSphere Web Client plugin, you may be interested in this section. I suspect over time we will be publishing more design standards that can be shared with the general community and hopefully useful for our partners and integrators.

Be sure to explore the rest of the site, though this is only the initial release of the VMware Developer Center, if you have any feedback feel free to leave a comment either on my blog or in the VMTN community forums. I know the team responsible for the VMware Developer Center has so much more planned including more sample code for each of our API/SDK as well as more content and interactions from each of the engineering teams. So stay tuned and check back often!

Categories // Uncategorized Tags // api, sdk, vmware

  • « Previous Page
  • 1
  • …
  • 37
  • 38
  • 39
  • 40
  • 41
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...