WilliamLam.com

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

Programmatically interact with the VMware Product Lifecycle Matrix

12.01.2020 by William Lam // 2 Comments

I recently came across a really cool automation solution from Dale Coghlan who built a PowerShell module to interact with the VMware Configuration Maximum (Config Max) Tool.

So, I published a thing today.... VMware.CfgMax - A PowerShell module to interact with https://t.co/NBrbCO3hcf https://t.co/RRQkh7ma1q

— Dale Coghlan (@DaleCoghlan) December 1, 2020

Although the Config Max tool does not currently provide an API, there is still a way to interact with it programmatically. Behind the scenes, the application uses JSON for its payload which can then be retrieved programmatically using PowerShell or any other language for that matter to perform an HTTP GET. I also know the Config Max team quite well, as I had worked with them to incorporate the VMware Cloud on AWS configuration maximums which also required a few enhancements to the tool. If you have any feedback, feel free to drop a comment and I will be happy to share it with them and one of my first asks when I met the team, was to provide a public REST API šŸ™‚

After sharing Dale's tweet, I saw a question about doing something similiar for the VMware's Product Lifecycle Matrix, which is a website that helps customers understand the support lifecycle of a given VMware product/solution. The product lifecycle site has also been recently revamped and although it also does not have a public API, using Chrome Developer Tools (super useful tool) to quickly inspect, it looks like you can also programmatically grab the payload which also happens to be using JSON šŸ™‚

Disclaimer: The VMware Product Lifecycle Matrix does not provide a public API, this also means there are no guarantees or compatibility that the trick outlined below will continue to work going forward. This is why you want to have a public, documented and supported API.

[Read more...]

Categories // Automation Tags // curl, powershell, product lifecycle matrix

Cheatsheet for the entire VMware AppCatalyst API using cURL

01.22.2016 by William Lam // 1 Comment

There were a few questions recently about the required syntax for specific VMware AppCatalyst operations when consuming the REST API using cURL. I figured I put together a quick "cheatsheet" that contains cuRL examples for the entire VMware AppCatalyst API which not only would it help me in future but could also benefit others. Like many, I also learn by example and having explicit samples to start with is a great way to get familiar with a new technology or product. If you are new to VMware AppCatalyst and would like a quick run down on how to quickly get started, be sure to check out my getting started article here for more details.

While going through the AppCatalyst API, I didĀ findĀ a couple of API operations which had some inconsistencies and did not strictly adhere to the JSON format. Thanks to Roman Tarnvski for providing the solution.Ā I am hopeful that these issues will be resolved in a future update of AppCatalyst as I do like the ease of use of their API. For the majority of the API, the self documentation via the AppCatalyst API ExplorerĀ is accurate, which you can see from the screenshot below.

appcatalyst-api-explorer
Before you can interact with the AppCatalyst REST API, you will need toĀ start the AppCatalyst Daemon by running the following command:

/opt/vmware/appcatalyst/bin/appcatalyst-daemon

Once the AppCatalyst Daemon is running, you can open a new terminal and start working with the REST API via cURL or any other tool of choice.

1. Create a new VM fromĀ the default Photon OS VM template:

You technically only need to specify the unique "id" property, but you can also give a display name for the VM by using the "name" property.

curl -d '{"id":"VM1", "name":"MyAppCat-VM1"}' -X POST localhost:8080/api/vms

1. CreateVM
2. Clone a VM from an existing VM:

Similar to creating a new VM, you also have option of using the "tag" property to associate additional metadata with the VM.

curl -d '{"id":"VM2", "parentid":"VM1", "name":"MyAppCat-VM2", "tag":"Development"}' -X POST localhost:8080/api/vms

2. Clone VM
3. List allĀ VMs

curl -X GET localhost:8080/api/vms

3. List VMs
4. Get a specific VM:

To retrieve a specific VM, you will need to power on the VM before this operation is allowed. I did find it strange that this was the case, but perhaps this could be enhanced in the future to not have this requirement, especially if you want to pull out details such as the "tag" property.

curl -X GET localhost:8080/api/vms/VM1

4. Get specific VM
5. Power OnĀ a VM:

curl -d 'on' -X PATCH localhost:8080/api/vms/power/VM1

Note: Other VM Power Operations: off, shutdown, suspend, pause & unpause

5. Power VM
6. Get the power state of a VM:

curl -X GET localhost:8080/api/vms/power/VM1

6. Get Power State
7. Get the IP Address of a VM:

curl -X GET localhost:8080/api/vms/VM1/ipaddress

7. Get IP Address
8. EnableĀ folder sharing for a VM:

curl -d "true" -X PATCH localhost:8080/api/vms/VM1/folders

8. Enable Shared Folders
9. Create a shared folder mapping for a VM:

The "guestPath" property is not an absolute path within the guestOS, but rather a logical name.Ā For more detailsĀ about shared folders in AppCatalyst, please have a look at this article here. Currently there is only one "flags" property with the value of 4 which enables read/write, please refer to the article in the link above for more details about folder sharing in AppCatalyst.

curl -d '{"guestPath":"shared-folder","hostPath":"/Users/wlam/git","flags":4}' -X POST localhost:8080/api/vms/VM1/folders

9. Create Shared Folder
10. ListĀ all shared folders to a VM:

curl -X GET localhost:8080/api/vms/VM1/folders

10. List all Shared Folders
11. List a specific shared folder for a VM:

curl -X GET localhost:8080/api/vms/VM1/folders/shared-folder

11. List specific shared folder
12. Delete a shared folder for a VM:

curl -X DELETE localhost:8080/api/vms/VM1/folders/shared-folder

12. Delete shared folder
13. Delete VM:

curl -X DELETE localhost:8080/api/vms/VM1

13. Delete VM

Categories // Automation, Cloud Native Tags // appcatalyst, curl, REST API

vCenter Server 6.0 Tidbits Part 12: New methods of downloading Support Bundles for VCSA / PSC

06.18.2015 by William Lam // Leave a Comment

Many of you are probably pretty familiar with the process of generating a VMware Support bundle for vCenter Server when it comes to troubleshooting or filing an SR with VMware GSS by using either the vSphere Web/C# Client UI. With the released of vSphere 6.0 and specifically with the vCenter Server Appliance (VCSA) there are now some additional methods in generating a VMware Support bundle which can come in handy if the vSphere Web Client is not running or if you wish to perform this simply through the command-line on a remote system.

Screen Shot 2015-06-14 at 7.06.39 AM
The first option is simply by pointing your web browser to the following URL of your VCSA:

  • https://192.168.1.60/appliance/support-bundle

vcsa-support-bundle
You will be prompted to login with a local account such as the "root" user which ensures that there is no dependency that SSO must be running which is the case when using the vSphere Web Client. Once authenticated, the VMware Support bundle will be generated and you will then be able to download it onto your system. The VMware Support Bundle is in the format of a compressed tar file which you can use gzip or tar to extract.

The second option is simply using cURL or wget from the command-line which you will also need to provide valid credentials to download. Here is an example of using curl and we will be saving the file as "support-bundle.tar.gz":

curl -k -u root -o support-bundle.tar.gz -O https://192.168.1.60/applmgmt/support-bundle

Once we have downloaded the VMware Support bundle to our desktop, we can then extract it using a variety of tools such as tar for example:

tar -zxvf support-bundle.tar.gz

In situations when you need to quickly resolve a problem by providing support logs to VMware, time is of the essence and being able to quickly generate the necessary support files can help lead to a quick resolution. Hopefully these additional methods of generating a VMware Support Bundle can help save you time when you may need to call upon them.

  • vCenter Server 6.0 Tidbits Part 1: What install & deployment parameters did I use?
  • vCenter Server 6.0 Tidbits Part 2: What is my SSO Domain Name & Site Name?
  • vCenter Server 6.0 Tidbits Part 3: Finding all deployed Platform Services Controller
  • vCenter Server 6.0 Tidbits Part 4: Finding all deployed vCenter Servers
  • vCenter Server 6.0 Tidbits Part 5: New method of patching the VCSA
  • vCenter Server 6.0 Tidbits Part 6: Customizing VCSA’s DCUI
  • vCenter Server 6.0 Tidbits Part 7: Connecting to SSO/PSC using JExplorer
  • vCenter Server 6.0 Tidbits Part 8: Useful ldapsearch queries for vmdird
  • vCenter Server 6.0 Tidbits Part 9: Creating & managing SSO users using dir-cli
  • vCenter Server 6.0 Tidbits Part 10: Automating SSO Admin configurations
  • vCenter Server 6.0 Tidbits Part 11: Automate SSO Admin password change
  • vCenter Server 6.0 Tidbits Part 12: New methods of downloading Support Bundles for VCSA / PSC

Categories // Automation, VCSA, vSphere 6.0 Tags // curl, support bundle, vcenter server appliance, VCSA, vcva

  • 1
  • 2
  • 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...