Solved

NGT with APIv2 AHV not supported

  • 7 December 2020
  • 6 replies
  • 246 views

Hi, I’m trying to create a automated NGT install script for my environment:

 

Code:

curl --insecure --request POST --url https://x.x.x.x:9440/PrismGateway/services/rest/v2.0/vms/ef064f22-7ac8-4221-96dd-4cc6f2433dfb/manage_vm_guest_tools --header 'authorization: Basic xxxxx' --header 'content-type: application/json' --data '{"operation":"MOUNT","override_guest":true,"uuid":"ef064f22-7ac8-4221-96dd-4cc6f2433dfb"}'

 

Response:

{"message":"Hypervisor ahv not supported","detailed_message":null,"error_code":{"code":1101,"help_url":"http://my.nutanix.com"}}

 

AOS: 5.15.1

icon

Best answer by Aleksander P 10 December 2020, 18:57

Hi, 

 

I resolved this with API v1. Thank you by your support.

 

Enabling NGT:

URL endpoint: https://x.x.x.x:9440/PrismGateway/services/rest/v1/vms/ef064f22-7ac8-4221-96dd-4cc6f2433dfb/guest_tools/

 

Body:
{
  "applications": {"Vss Snapshot": true},
  "enabled": true,
  "vmUuid": "ef064f22-7ac8-4221-96dd-4cc6f2433dfb"
}

 

Mounting NGT:

https://x.x.x.x:9440/PrismGateway/services/rest/v1/vms/ef064f22-7ac8-4221-96dd-4cc6f2433dfb/guest_tools/mount

 

View original

This topic has been closed for comments

6 replies

Userlevel 6
Badge +5

Nutanix Dev states that “This API works only for Esxi.”

Userlevel 6
Badge +5

You would have to use APIv3 but then you might as well use inbuilt PC capability to perform bulk installation Prism Central Guide: Installing NGT on Multiple VMs

Hi, 

 

I resolved this with API v1. Thank you by your support.

 

Enabling NGT:

URL endpoint: https://x.x.x.x:9440/PrismGateway/services/rest/v1/vms/ef064f22-7ac8-4221-96dd-4cc6f2433dfb/guest_tools/

 

Body:
{
  "applications": {"Vss Snapshot": true},
  "enabled": true,
  "vmUuid": "ef064f22-7ac8-4221-96dd-4cc6f2433dfb"
}

 

Mounting NGT:

https://x.x.x.x:9440/PrismGateway/services/rest/v1/vms/ef064f22-7ac8-4221-96dd-4cc6f2433dfb/guest_tools/mount

 

Userlevel 1
Badge +2

@Aleksander P  This worked for me too. I got a clue from this CALM script and then came across your post. Thank you. However, I do not have CALM and the bulk installation suggested by @Alona does not meet my requirement as I am enabling NGT using the API using a cloud-init script during Self-Service VM provisioning.

@Alona I am concerned that these NGT API calls are only available in v1 and not v2. Will NGT management via APIs be deprecated?

Userlevel 6
Badge +5

Hi CyberG,

I find it unlikely that NGT management via API is going to be deprecated soon as bulk upgrade from PC is handled on the background via API calls.

API versions are complementary to each other and not mutually exclusive.

Userlevel 1
Badge +2

Ok @Alona , that’s comforting to know. I was concerned due to the recommendation to migrate from v1 to v2.0 at https://www.nutanix.dev/reference/prism_element/v2/