API

Welcome to the Nutanix NEXT community. To get started please read our short welcome post. Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: 

v2/vms query parameters?

Adventurer

v2/vms query parameters?

The docs for GET v2/vms state the following:

Virtual Machine disk information and network information are not included by default as fetching these are expensive operations. These can be included by setting the include_vmdisk_config and include_vmnic_config flags respectively.

 

Based on this I was planning on leveraging these flags for performance reasons when listing VM's, but I'm not sure they are working. I'm testing against a Acropolis system running 5.0.0.2.

 

I diffed the JSON responses from Swagger when include_vmdisk_config and include_vmnic_config were:

  1. both excluded
  2. both set to true
  3. both set to false

The JSON is identical for 1 and 3, which I expected, but for every VM the vm_disk_info and vm_nics fields are populated for each VM. When I diffed 1 and 2 the only difference is that each disk reports its size.

 

Is this expected?

10 REPLIES
Adventurer

Re: v2/vms query parameters?

Also looks like GET v2/vms does not return guest_os.

Nutanix Employee

Re: v2/vms query parameters?

Hi,

 

I tried this with 5.0 and the output is different when using

 

https://192.168.178.70:9440/PrismGateway/services/rest/v2.0/vms/?include_vm_disk_config=true&include...

 

compared to

 

https://192.168.178.70:9440/PrismGateway/services/rest/v2.0/vms/

 

I am using 5.0 and ESXi 6.0

 

output:

 

flags.PNG

 

 

noflags.PNG

 

 

Adventurer

Re: v2/vms query parameters?

Interesting...so the query parameters behave different depending on the underlying hypervisor?

Nutanix Employee

Re: v2/vms query parameters?

Let´s try to double check this with eng. But I believe the output should be similar with AHV. I will try to test it as soon I have an AHV cluster available.

 

The CE edition does not provide the v2.0 API right now.

 

regards,

Thomas

Adventurer

Re: v2/vms query parameters?

I have Acropolis 5.0.0.2 running if you want to see the API output?

I also have CE running which has the v2.0 API (it does not have the v3 API).

Nutanix Employee

Re: v2/vms query parameters?

Okay. 

 

Which version are you using regarding the CE edition. 

 

CE AOS 2016.10.12 and Nutanix Hypervisor 20150513 do not accept https://192.168.178.130:9440/PrismGateway/services/rest/v2.0/  requests at my lab. Would be nice to understand the difference.

 

Regards,

Thomas

Adventurer

Re: v2/vms query parameters?

I'm running the 2016.12.22 build. I believe that was the first non-EA build with Asterisx functionality. I'm planning on upgrading to the latest which is 2017.01.10 at some point.

Nutanix Employee

Re: v2/vms query parameters?

I tested with CE edition today. You are right. The details with parameters are only a little bit more. Maybe the assumption that include disk statistics etc. is only expensive using vsphere? And the output with including ?include_vm_disk_config=true&include_vm_nic_config=true is a little bit different at my homelab. for example size is included!

Moderator Moderator
Moderator

Re: v2/vms query parameters?

hey @regana - following up on old threads tonight, did you ever get to the bottom of this or is this still outstanding?

Jon Kohler | Principal Architect, Nutanix | Nutanix NPX #003, VCDX #116 | @JonKohler
Please Kudos if useful!