Description
Discussed in #3692
Originally posted by naveenuk2411 February 10, 2025
Hi,
vcenter/vm/{vm}
GET API does not return the details of VM Template which is present inside the content library for VCenter client versions v7.0 and above.
However the same API does return the details for a VM template inside content library for lower versions that v7.0.
Our flow is the following:
- We hit
/vcenter/vm-template/library-items/{templateId}
GET API to get the details of VM Template present within content library, where we get the template name identifier asvm-<id>
. - We hit
/vcenter/vm/{vm}
GET API by passingvm-<id>
to get the VM details which returns us a lot of information about nics, cdroms, disks etc, the info for which is consumed by us.
On trying the same flow on v6.7.0.54000
, we get the responses for both the APIs as part of the above flow.
On trying the same flow on v7.0.3.01100
, we get a failure on "/vcenter/vm/{vm}" GET API with the following error
{ "error_type": "NOT_FOUND", "messages": [ { "args": [ "vm-2113587:7877af5f-b87e-4442-b5b6-8a4401177f99" ], "default_message": "Virtual machine with identifier 'vm-2113587:7877af5f-b87e-4442-b5b6-8a4401177f99' does not exist.", "id": "com.vmware.api.vcenter.vm.not_found" } ] }
A strange thing which I observed is that in the VCenter client UI, the same VM with identifier in the above error is used to get hardware related info for the VM Template present within the content library
API: ui/data/urn:vmomi:VirtualMachine:vm-2113587:7877af5f-b87e-4442-b5b6-8a4401177f99?model=com.vmware.vsphere.client.vm.model.HardwareViewData
I have the following questions:
- Can I get some info on release notes or breaking changes for v7.0 and above versions for this API
/vcenter/vm/{vm}
. - Is there an alternate way to get all the info returned by
/vcenter/vm/{vm}
API for a VM template present inside the content library.
API references:
- https://developer.broadcom.com/xapis/vsphere-automation-api/v7.0U2/vcenter/api/vcenter/vm/vm/get/
- https://developer.broadcom.com/xapis/vsphere-automation-api/latest/vcenter/api/vcenter/vm-template/library-items/template_library_item/get/
Thanks in advance for the help.