WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / Automating subscription and usage retrieval for vSphere+ and vSAN+ Cloud Service

Automating subscription and usage retrieval for vSphere+ and vSAN+ Cloud Service

02.09.2023 by William Lam // 2 Comments

As a follow-up from my earlier blog post which helps customers inventory their current on-premises vSphere/vSAN CPU usage for use with vSphere+, vSAN+ and VCF+ Cloud Services, this post will focus on how customers can easily inventory their vSphere+ and vSAN+ subscription usage, both manually and through some automation.


Once your on-premises vCenter Server has been converted into a subscription, all usage and billing information is now managed through the VMware Cloud Console (vmc.vmware.com), rather than the License section of the vSphere UI. In fact, you will find that the vSphere UI will be updated to include a new Subscriptions tab which provides a direct link to both the vSphere+ and vSAN+ Cloud Service.

To view your current vSphere+ and vSAN+ subscription commitments, navigate to the Subscriptions tab as shown in the screenshot below.


Here you will get a summary of all the subscriptions along with the amount of CPU cores that you have purchased for both vSphere+ and/or vSAN+ Cloud Service including the terms and other useful pieces of information.

To view your current vSphere+ and vSAN+ usage, navigate to the Subscription Usage tab as shown in the screenshot below.


Here you will get a summary of the overall total vSphere+ and vSAN+ CPU core usage and below that information, individual break down for each vCenter Server and its respective vSphere+ and vSAN+ core consumption.

As you can see, all of your vSphere+ and vSAN+ subscription and usage information can easily be viewed from within the VMware Cloud Console, but what if you wanted to retrieve this information periodically using automation? While there is currently not anAPI for the vSphere+ and vSAN+ Cloud Service, we can interact with the VMware Cloud Console by using the public Cloud Services Platform (CSP) API and a valid refresh token that contains the appropriate permissions to extract information from both the subscriptions and usage pages from within the VMware Cloud Console for automation purposes.

To demonstrate the same functionality as shown above from an automation perspective, I have created a simple PowerShell module called VMware.Community.VPlus, which can be used to retrieve both the subscription and usage information for both the vSphere+ and vSAN+ Cloud Service.

Step 1 - Install the PowerShell module from the PowerShell Gallery by running the following command:

Install-Module VMware.Community.VPlus

Step 2 - Generate a CSP Refresh Token with CloudAdmin access for vSphere+ and vSAN+ Cloud Service. You can refer to the VMware Cloud documentation for detailed instructions.

Step 3 - Import the module by running the following command:

Import-Module VMware.Community.VPlus

Step 4 - Connect to the service using Connect-VPlus function and provide the CSP Refresh Token (from Step 2) and the Organizational ID (you can copy that in upper right hand corner of the VMware Cloud Console) that has the vSphere+/vSAN+ service enabled

Connect-VPlus -RefreshToken $REFRESH_TOKEN -OrgID $ORG_ID

To view vSphere+ and vSAN+ subscriptions, use the Get-VPlusSubscription function as shown in screenshot below:


You can also filter out a specific subscriptions by using the -SubscriptionId parameter.

To view vSphere+ and vSAN+ usage, use the Get-VPlusDeployment function as shown in screenshot below:


You can also filter out a specific deployments by using the -DeploymentId parameter.

More from my site

  • How to check if your vCenter Server is using vSphere+ / vSAN+ Subscription?
  • Quick Tip - Inventory core count for vSphere+, vSAN+ & VCF+ Cloud Service
  • A first look at the new vSphere+ & vSAN+ Cloud Service
  • Logging into vCenter when vCenter Cloud Gateway (VCGW) is disconnected from vSphere+ Cloud Service
  • Intel NUC 9 Pro & Extreme - First "Modular" NUC

Categories // Automation, VMware Cloud, VSAN, vSphere Tags // VMware Cloud, VSAN, vSphere

Comments

  1. GBMaryland says

    02/15/2023 at 4:40 am

    Curiously, what happens if you have a disconnected private cloud? Does that mean you'll need to use VCP going forward? When I was part of VMware working for the NS Team out of Reston, we had a lot of customers that were not and never would be connected to the internet... (The team that did the VCP appliance development seemed to have a hard time with that concept.)

    Reply
    • William Lam says

      02/15/2023 at 5:05 am

      What is VCP in this context?

      Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

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 © 2023

 

Loading Comments...