Policy > Inventory > Virtual Machines

Associated URIs:

API Description API Path

Return the List of Virtual Machines


Returns information about all virtual machines.
If you have not added NSX tags on the VM or removed
all the NSX tags that were earlier added to the VM,
then tags property is not returned in the API response.
GET /api/v1/fabric/virtual-machines

Perform action on specified virtual machine e.g. update tags


Perform action on a specific virtual machine. External id of the virtual machine needs to be
provided in the request body. Some of the actions that can be performed are update tags, add
tags, remove tags.
To add tags to existing list of tag, use action parameter add_tags.
To remove tags from existing list of tag, use action parameter remove_tags.
To replace existing tags with new tags, use action parameter update_tags.
To clear all tags, provide an empty list and action parameter as update_tags.
The vmw-async: True HTTP header cannot be used with this API.
POST /api/v1/fabric/virtual-machines?action=add_tags

Perform action on specified virtual machine e.g. update tags


Perform action on a specific virtual machine. External id of the virtual machine needs to be
provided in the request body. Some of the actions that can be performed are update tags, add
tags, remove tags.
To add tags to existing list of tag, use action parameter add_tags.
To remove tags from existing list of tag, use action parameter remove_tags.
To replace existing tags with new tags, use action parameter update_tags.
To clear all tags, provide an empty list and action parameter as update_tags.
The vmw-async: True HTTP header cannot be used with this API.
POST /api/v1/fabric/virtual-machines?action=remove_tags

Perform action on specified virtual machine e.g. update tags


Perform action on a specific virtual machine. External id of the virtual machine needs to be
provided in the request body. Some of the actions that can be performed are update tags, add
tags, remove tags.
To add tags to existing list of tag, use action parameter add_tags.
To remove tags from existing list of tag, use action parameter remove_tags.
To replace existing tags with new tags, use action parameter update_tags.
To clear all tags, provide an empty list and action parameter as update_tags.
The vmw-async: True HTTP header cannot be used with this API.
POST /api/v1/fabric/virtual-machines?action=update_tags

Return the list of tools and agents installed in VMs.


This API returns the list of tools and agents installed in VMs.
GET /api/v1/fabric/virtual-machines/tools-info

Listing of Virtual machines on the NSX Manager


This API filters objects of type virtual machines from the specified NSX Manager.
This API has been deprecated. Please use the new API
GET /infra/realized-state/virtual-machines
GET /policy/api/v1/infra/realized-state/enforcement-points/<enforcement-point-name>/virtual-machines (Deprecated)

Apply tags on virtual machine


Allows an admin to apply multiple tags to a virtual machine. This operation
does not store the intent on the policy side. It applies the tag directly
on the specified enforcement point. This operation will replace the existing
tags on the virtual machine with the ones that have been passed. If the
application of tag fails on the enforcement point, then an error is
reported. The admin will have to retry the operation again. Policy
framework does not perform a retry. Failure could occur due to multiple
reasons. For e.g enforcement point is down, Enforcement point could not
apply the tag due to constraints like max tags limit exceeded, etc.
POST /policy/api/v1/infra/realized-state/enforcement-points/<enforcement-point-name>/virtual-machines?action=update_tags

Read the details of a virtual machine on the NSX Manager


This API return optional details about a virtual machines (e.g. user login session) from the
specified enforcement point.
In case of NSXT, virtual-machine-id would be the value of the external_id of the virtual machine.
GET /policy/api/v1/infra/realized-state/enforcement-points/<enforcement-point-name>/virtual-machines/<virtual-machine-id>/details

Lists all the system excluded virtual machines.


Lists all the system virtual machines that are auto excluded in
firewall exclude list (example -Partner and Edge VMs etc)
GET /policy/api/v1/infra/realized-state/system-excluded-virtual-machines

Lists all the system virtual machines.


Lists all the system virtual machines (example -Partner and Edge VMs etc)
GET /policy/api/v1/infra/realized-state/system-virtual-machines

List all virtual machines which are not part of any group


This API filters objects of type virtual machine which are not part of any group. This API also gives some VM
details such as VM name, IDs and the current state of the VMs.
GET /policy/api/v1/infra/realized-state/unassociated-virtual-machines

List all virtual machines


This API filters objects of type virtual machine. This API also gives some VM
details such as VM name, IDs and the current state of the VMs.
GET /policy/api/v1/infra/realized-state/virtual-machines