WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / New vSphere 6.5 APIs worth checking out

New vSphere 6.5 APIs worth checking out

11.03.2016 by William Lam // 11 Comments

With the upcoming new release of vSphere, there are quite a few new vSphere APIs to look forward to and consume from an Automation standpoint. Similiar to what I had done in the past with previous major releases of vSphere, here is a list of of some of the new vSphere APIs (SOAP based) that I think are worth checking out whether they are new features vSphere 6.5 will introduced or new enhancements to existing functionality which will benefit our vSphere Administrators and/or Developers.

If you would like to see the complete list of new vSphere 6.5 (SOAP based) APIs, be sure to check out the vSphere 6.5 API Reference Guide which will include a "What's New" section on all the new Managed Objects, Methods, Properties, etc. when vSphere 6.5 is generally available.

CryptoManager / CryptoManagerKmip - VM Encryption is one of the new features in vSphere 6.5 and with these APIs, you will be able to manage and configure the VM Encryption settings including associating with KMIP server. For enabling/disabling VM Encryption at the VM and disk level, have a look at VirtualMachine->crypto and VirtualMachine->deviceChange->backing property.

  • GenerateClientCsr
  • GenerateKey
  • GenerateSelfSignedClientCert
  • ListKmipServers
  • MarkDefault
  • RegisterKmipServer
  • RemoveKmipServer
  • RetrieveClientCert
  • RetrieveClientCsr
  • RetrieveKmipServerCert
  • RetrieveKmipServersStatus_Task
  • RetrieveSelfSignedClientCert
  • UpdateKmipServer
  • UpdateKmsSignedCsrClientCert
  • UpdateSelfSignedClientCert
  • UploadClientCert
  • UploadKmipServerCert

FailoverClusterConfigurator - To setup the new vCenter Server High Availability (VCHA) feature which is only available in the VCSA, use these APIs which include deploying and configuring the passive and witness nodes.

  • configureVcha_Task
  • createPassiveNode_Task
  • createWitnessNode_Task
  • deployVcha_Task
  • destroyVcha_Task
  • getVchaConfig
  • prepareVcha_Task

FailoverClusterManager -  Have a look at these APIs to initiate a failover or view the current VCHA configuration.

  • getClusterMode
  • GetVchaClusterHealth
  • initiateFailover_Task
  • setClusterMode_Task

HostVStorageObjectManager - An API only feature in vSphere 6.5 which will allow you to create and manage Virtual Disks as a "First Class" citizen. This particular API is for managing First Class Disks (FCD) when talking directly to an ESXi host.

  • HostCloneVStorageObject_Task
  • HostCreateDisk_Task
  • HostDeleteVStorageObject_Task
  • HostExtendDisk_Task
  • HostInflateDisk_Task
  • HostListVStorageObject
  • HostReconcileDatastoreInventory_Task
  • HostRegisterDisk
  • HostRelocateVStorageObject_Task
  • HostRenameVStorageObject
  • HostRetrieveVStorageObject
  • HostRetrieveVStorageObjectState
  • HostScheduleReconcileDatastoreInventory

VcenterVStorageObjectManager - An API only feature in vSphere 6.5 which will allow you to create and manage Virtual Disks as a "First Class" citizen. This particular API is for managing First Class Disks (FCD) when talking directly to a vCenter Server.

  • AttachTagToVStorageObject
  • CloneVStorageObject_Task
  • CreateDisk_Task
  • DeleteVStorageObject_Task
  • DetachTagFromVStorageObject
  • ExtendDisk_Task
  • InflateDisk_Task
  • ListTagsAttachedToVStorageObject
  • ListVStorageObject
  • ListVStorageObjectsAttachedToTag
  • ReconcileDatastoreInventory_Task
  • RegisterDisk
  • RelocateVStorageObject_Task
  • RenameVStorageObject
  • RetrieveVStorageObject
  • RetrieveVStorageObjectState
  • ScheduleReconcileDatastoreInventory

DatastoreNamespaceManager->ConvertNamespacePathToUuidPath() - From a troubleshooting standpoint, do you ever wish you can easily translate the human readable VM path (e.g. /vmfs/volumes/vsanDatastore/myVM/myVM.vmx to the VSAN/VVOL equivalent identifier which is UUID based? Well, this is now possible with this new API!

AuthorizationManager->FetchUserPrivilegeOnEntities() - This is a pretty neat API as it allows you to easily query an existing user to see the current privileges has been assigned. This could could come in handy to quickly audit a particular privilege for a user.

HostImageConfigManager->installDate() - Have a look at this blog post Super easy way of getting ESXi installation date in vSphere 6.5 for more details.

HostImageConfigManager->fetchSoftwarePackages() - This is another nice API to easily retrieve all the VIBs installed on an ESXi host. This is the equilvenet of running "esxcli software vib list" and you will now have all the additional metadata info that was historically only available via ESXCLI. Here is an example PowerCLI function called Get-ESXInstalledVib which exercises this new API.

HostStorageSystem->UpdateVmfsUnmapPriority() - Have a look at the blog post Configure new automatic Space Reclamation (VMFS UNMAP) using vSphere 6.5 APIs for more details.

VirtualMachine->{AttachDisk_Task(),DetachDisk_Task()} - This API allows you to attach and detach First Class Disks that you may have created earlier using the FCD APIs as shown above.

VirtualMachine->config->bootOptions->EfiSecureBootEnabled - To take advantage of the new VM Secure Boot feature in vSphere 6.5, you simply just toggle this property. Here are two PowerCLI functions called Get-SecureBoot/Set-SecureBoot which exercises this new API.

In addition, vSphere 6.5 also introduces a new REST-based API that covers several areas such as basic VM Lifecycle Management (simliar to that of the existing vSphere SOAP-based API), vSphere Content Library, vSphere Tagging and Virtual Appliance Management for the vCenter Server Appliance (VCSA). You can interact with these new APIs by using any of the vSphere Automation SDKs (.Net, Java, Python, Ruby or Perl) or even just simply using cURL from the command-line. It is really that easy!

Lastly, to make exploring these new REST-based APIs easier for both administrators as well as developers, there is now a new API Explorer that is included specifically with the VCSA in vSphere 6.5. You can think of it like a vSphere MOB 2.0 but way easier to use. Some of you may recognize the interface as shown in the screenshot below which uses the Swagger UI. This interface allows you to quickly browse through all the APIs, no need to refer to the documentation as the APIs are self-documented and made available in this interface. Best of all, you can even try out the APIs by simply logging into your vCenter Server and then selecting an API and clicking on the "Try it out now" button!

To access the API Explorer, you simply open a web browser and enter the following URL: https://[VC-HOSTNAME-OR-IP]/apiexplorer/

vsphere-6-5-apis-apiexplorer
There will also be native PowerCLI cmdlets (Get-CisService) to these new REST API and below is a quick example of retrieving the version (GET /system/version) of the VCSA:

$vcsaVersion = Get-CisService -Name  'com.vmware.appliance.system.version'
$vcsaVersion.get()

vsphere-6-5-apis-powercli

More from my site

  • When to use Move-VM cmdlet vs xMove.ps1 script for performing Cross vCenter vMotions?
  • PowerCLI module for Proactive HA (including simulation)
  • An update on how to retrieve useful information from a vSphere login?
  • Configure new automatic Space Reclamation (VMFS UNMAP) using vSphere 6.5 APIs
  • Super easy way of getting ESXi installation date in vSphere 6.5

Categories // Automation, vSphere 6.5 Tags // API Explorer, PowerCLI, vSphere 6.5, vSphere API, vSphere SDK

Comments

  1. *protectedAntti says

    11/05/2016 at 3:10 pm

    Great post, one minir thing.
    "vSphere 6.5 API Reference Guide" link seems to be dead (404), working one available before GA ?

    Reply
    • William Lam says

      11/05/2016 at 6:33 pm

      Yes, that's because vSphere 6.5 has GA'ed yet 🙂 When it does, the link will work

      Reply
  2. *protectedagonzalez says

    11/07/2016 at 2:10 am

    When are vsphere replication APIs going to be open to public? i think it is the most requested API, hyperv can automate/orchestrate replication through API from years ago.

    I understand you want to sell SRM but many people dont need it and just want to do some basic automation over the replicas.

    Reply
  3. *protectedDaniel says

    11/08/2016 at 12:34 am

    Will these APIs also be available in vCenter Server on Windows? 🙂

    Reply
  4. *protectedJeff Couch says

    11/21/2016 at 11:31 pm

    William. Thanks for this. This is the only reference i have found to First Class Disks. I am trying to experiment with them but cannot seem to crack this API. Any help would be great.

    Connected to a 6.5 vCenter using powercli 6.5 and I can get-view any of the other new object managers. But this one doesn't seem to respond the same way:

    PowerCLI C:\> get-view VcenterVStorageObjectManager
    get-view : 11/22/2016 1:23:56 AM Get-View View with Id 'VcenterVStorageObjectManager-VcenterVStorageObjectManager' was not found on the server(s).
    At line:1 char:1
    + get-view VcenterVStorageObjectManager
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
    + FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    I have the following spec setup in hopes to create a FCD once i can find the manager to create the task off of:

    $datastore = Get-Datastore vsanDatastore

    $spec = new-object VMware.Vim.VslmCreateSpec
    $spec.BackingSpec = new-object VMware.Vim.VslmCreateSpecBackingSpec
    $spec.BackingSpec.Datastore = $datastore.ExtensionData.MoRef
    $spec.Name = "testFCD"
    $spec.CapacityInMB = 1024

    Reply
  5. *protectedRussell Fellows says

    11/22/2016 at 2:09 pm

    William,

    As always, thanks for your great help. You are without a doubt the best resource for developers trying to work with any of VMware's products. Mr. Gelsinger, if you are listening, please support Mr. Lam with anything he needs, this is how you get and keep developers.

    Reply
  6. *protectedUmesh says

    03/29/2017 at 10:44 am

    William,

    Thanks for all the information. Any idea if we can access the tags [Virtual Machine tags specifically] in the new SDK. I was planning to use govmomi but didn't find any way to access tags.

    Thanks

    Reply
    • *protectedKevin says

      04/19/2017 at 8:40 am

      As far as I can tell VMware still provides no access to tags in the webservices api, seems kind-of crazy that this is still the case 🙁

      Reply
  7. *protectedJorge Garcia says

    10/19/2017 at 2:39 pm

    hi WIlliam , do you know the endpoint name so that i can access the vSphere Web API via rest? I want to get stuff like VM disk sizes and drive letters and the automation API doesn't have that data.

    Reply
  8. *protectedLen says

    10/24/2017 at 4:56 pm

    Both this post and the API are very helpful indeed. My goal is to enable ssh and root login after an VM deployment, but I only found "put /appliance/access/ssh" under "Appliance". Where do I find similar things for VM? Thanks

    Reply
  9. *protectedwotsa says

    06/07/2018 at 12:34 pm

    Thanks for this article, William.

    Can CloneVStorageObject_Task API be used to copy a disk(vmdk file) from one data store to another?
    Can you please point me to any sample for usage of this API?

    Reply

Thanks for the comment!Cancel reply

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

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...