vmware / vsphere-automation-sdk-python

Python samples, language bindings, and API reference documentation for vSphere, VMC, and NSX-T using the VMware REST API
MIT License
745 stars 313 forks source link

Add "Rename" to VM operations #413

Closed davidanizar closed 7 months ago

davidanizar commented 7 months ago

Is your feature request related to a problem? Please describe.

The possibility to rename a VM would be very helpful to improve test automation.

Describe the solution you'd like

rename could be added as a VM.attribute Example: self.vsphere_client.vcenter.VM.rename(VM.FilterSpec(names=names))

Describe alternatives you've considered

I try to wrap code: vmkfstools -i originalname.vmdk newname.vmdk or even: set-vm

Additional context

No response

kunalpmj commented 7 months ago

This feature is available via the VI JSOAP API. Kindly refer to the API Documentation. https://developer.vmware.com/apis/vi-json/latest/sdk/vim25/release/VirtualMachine/moId/Rename_Task/post/

You can also use the SOAP client for the same : https://vdc-repo.vmware.com/vmwb-repository/dcr-public/d1902b0e-d479-46bf-8ac9-cee0e31e8ec0/07ce8dbd-db48-4261-9b8f-c6d3ad8ba472/vim.ManagedEntity.html#rename