Solved

Missing IP when requested

  • 9 February 2017
  • 4 replies
  • 2607 views

Userlevel 1
Badge +6
Hello,

Version 5.0.0.2 using AHV. v2.0 API.

I've got a running VM and in the console I can see the NICs and their IP addresses. When I use the /vms/{uuid}/nics endpoint if I request the IP assignment I don't get that information:

[25] pry(main)> u.base_url=> "https://HOST:PORT/PrismGateway/services/rest/v2.0/vms/14de53b6-793c-483c-abcd-bb076677ee64/nics/?include_address_assignments=true"[26] pry(main)> u.response.body=> "{"metadata":{"grand_total_entities":1,"total_entities":1},"entities":[{"mac_address":"50:6b:8d:da:a8:da","network_uuid":"90d60590-9283-4eb6-85ae-08d5c7e7136e","model":""}]}"
The console states that this information is on a best effort basis and may not always be available, however I'd expect that if I can see the IP information in the console, I should also be able to see it when making a request with "include_address_assignments=true" via the API. Is that correct?

I see the same behaviour via the REST explorer.

I also see the same behavior on the "/vms/{vm_uuid}/nics/{nic_id}" endpoint.

Any help or information would be appreciated as I'd love to be able to get this information out of the system when making REST calls.

Cheers, Gavin
icon

Best answer by tfindelk 10 February 2017, 08:12

Hello,

you are right. It seems it only displays the ip which are managed by AHV itself. I prooved that PRISM GUI is using the v1 for this info.
So as a workaround you could use:
https://192.168.178.130:9440/PrismGateway/services/rest/v1/vms

and should retrieve:

"ipAddresses":["192.168.178.222"] in the response.

Best regards,
Thomas

View original

This topic has been closed for comments

4 replies

Userlevel 1
Badge +6
Hello,

That's excellent, thanks for the information.

Cheers, Gavin
Userlevel 1
Badge +6
Hello,

you are right. It seems it only displays the ip which are managed by AHV itself. I prooved that PRISM GUI is using the v1 for this info.
So as a workaround you could use:
https://192.168.178.130:9440/PrismGateway/services/rest/v1/vms

and should retrieve:

"ipAddresses":["192.168.178.222"] in the response.

Best regards,
Thomas
Userlevel 1
Badge +6
Hi,

Thanks for you're reply. Unfortunately I still don't see the information when I use that endpoint:

[35] pry(main)> u.base_url=> "https://HOST:PORT/PrismGateway/services/rest/v2.0/vms/14de53b6-793c-483c-abcd-bb076677ee64/nics/50:6b:8d:da:a8:da/?include_address_assignments=true"[36] pry(main)> u.response.body=> "{"mac_address":"50:6b:8d:da:a8:da","network_uuid":"90d60590-9283-4eb6-85ae-08d5c7e7136e","model":""}"
Does the IP address only get shown under certain circumstances? Does AHV need to be managing the IP address assignment?

Cheers, Gavin
Userlevel 1
Badge +6
Hi,

it should work when GET on
/vms/{vm_uuid}/nics/{nic_id}

You need to use MAC address as nic_id!

hope that helps!