Solved

REST API v2 - /vms for Hyper-V not supported

  • 22 September 2021
  • 3 replies
  • 50 views

While trying to get the list of vms using the rest api v2 against a Hyper-V configuration
The api return the following error message  "Exception while retrieving entities : Hypervisor hyperv not supported"

 

https://www.nutanix.dev/reference/prism_element/v2/api/vms/get-vms-getvms
There is no mention of api v2 not supporting this, is it meant to be supported? If not how can we get the list of vms from it? Do we need to revert back to V1 api? This one returns the vm list but looking at the v1 v2 documentation the recommendation is to migrate to v2, so would just like some clarification.

Also if we need to go back to V1 for hyper-v will any of the endpoints for in api V2 that require a VM_uuid work for a vm hyper-v or not? Since those uuid were returned by the V1 api
For example:
https://www.nutanix.dev/reference/prism_element/v2/api/flr/get-flr-vm-uuid-attached-disks-getattachedflrsnapshotofvm
https://www.nutanix.dev/reference/prism_element/v2/api/flr/get-flr-vm-uuid-snapshots-getflrsnapshotsofvm


Thank you

icon

Best answer by Michael.Manuele 22 September 2021, 20:59

View original

This topic has been closed for comments

3 replies

Userlevel 2
Badge +4

Hi @abnr 

So if you are just trying to pull information about VMs on a Hyper-V cluster to have to query Hyper-V to get VM information.  

https://docs.microsoft.com/en-us/powershell/module/hyper-v/get-vm?view=windowsserver2019-ps

You must use powershell as far as I know.  There might be some APIs on Hyper-V you can utilize but not aware of them.  If you are looking to get cluster or node information then our V3 APIs are the way to go.  Hope this helps.

Hi @Michael.Manuele

I was trying to use the nutanix rest api to get the vm information, I was hoping it would work with any nutanix configuration ESXI, Hyper-V, etc
https://www.nutanix.dev/reference/prism_element/v2/api/vms/get-vms-getvms

So that I could then call other apis that use those uuids to get other information. Basically I’m trying to build a custom report based on the V2 and V1 apis from any Nutanix prism element. I would prefer to have my report app based solely on the nutanix apis instead of having to bring in other ways of getting the data. I also found that api V1 returned information for Hyper-V but not api V2 and was wondering why that was the case.

Userlevel 2
Badge +4

@abnr Unfortunately, V2 API will not support HyperV.  You will have to either leverage V1 APIs or utilize the powershell scripts.  

 

Sorry