VMware Cloud Community
GlDicaprio
Contributor
Contributor

Question about DirectPath I/O vCenter REST APIs

I couldn't find anywhere in the documentation how to connect/disconnect gpu via api using DirectPath I/O. Has anyone solved this problem?

 https://docs.nvidia.com/networking/display/public/SOL/HowTo+Configure+NVIDIA+Network+Device+in+Direc...

I just want to do the same thing, but using the vcentre api.

0 Kudos
2 Replies
lamw
Community Manager
Community Manager

vCenter has both a SOAP (backwards compat for almost 2 decades) and a relatively recent REST API endpoint (8yrs+). Not all functionality is in the REST API and if you don't see it in https://developer.vmware.com/apis/vsphere-automation/latest/ then you can assume its only available in SOAP API, which is the case for managing Direct/Dynamic Path I/O

With that said, in vSphere 8.0 Update 1, there's a new VI JSON API https://blogs.vmware.com/code/2023/06/10/introducing-vi-json-a-modern-wire-protocol-for-vsphere-mana... which provides a REST-like experience in using the existing vSphere SOAP API, which is typically consumed through language bindings like PowerCLI, Python, Go, etc. For any VM reconfiguration option, you will need to use the ReconfigVM_Task() API and provide the appropriate spec. Typically, the easiest way to understand HOW this API works is to use Code Capture in vSphere UI, which records the UI operation (only applies to vSphere SOAP API today) and can produce various output including PowerCLI, Python, etc. 

From that, you can then convert it to using the new VI JSON API https://developer.vmware.com/apis/vi-json/latest/sdk/vim25/release/VirtualMachine/moId/ReconfigVM_Ta... if you want REST-like experience or simply use the vSphere SOAP API with any of the supported vSphere SDK as that might be faster

GlDicaprio
Contributor
Contributor

Thanks for the quick response. We will familiarize ourselves with the new VI JSON API:)

0 Kudos