Skip to content
This repository was archived by the owner on Feb 22, 2021. It is now read-only.
This repository was archived by the owner on Feb 22, 2021. It is now read-only.

Retrieving IPv4 address of deployed VM #42

@WinstonJake

Description

@WinstonJake

Hi guys. My org is currently using vSphere 6.7. I don't foresee any plans of upgrade so far.
When we deploy VM's in our org, the IPv4 address is set as an property under additional parameters in the request body of "https://{{vc}}/rest/com/vmware/vcenter/ovf/library-item/id:{{libraryitemID}}?~action=deploy" API. (please see the snippet below of the request body).

My question is, is there any way i can search vSphere client to retrieve VMs that are deployed on the same IP? is it possible to do a VM search based on, for example, "ip0" property in the below snippet? can i do a search by IP address using APIs? (i know this is possible using SDK, but needed it to work using APIs)

NOTE:

  1. https://{{vc}}/rest/vcenter/vm/vm-6768/guest/identity - This API returns only one IP, whereas i would need the entire list of IP addresses.
  2. I hear that the API to return ALL IP's was released in vSphere API version 7.0 but (i think) as i don't have that version, i get a 404 error.

SNIPPET:
{
"deployment_spec":
{
"additional_parameters":[
{
"@Class": "com.vmware.vcenter.ovf.property_params",
"properties":[
{
"instance_id": "xxxxx",
"class_id": "vami",
"description": "Network IPV4 address",
"id": "ip0",
"label": "Network IPV4 address",
"category": "xxxxx",
"type": "ip",
"value": "{{IPv4Address}}",
"ui_optional": false
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions