Automation

 View Only

Set UUID (bios uuid) with REST api

  • 1.  Set UUID (bios uuid) with REST api

    Posted May 20, 2022 10:45 AM

    Hi!

    I want to change the UUID (bios uuid) of a VM using the vcenter rest api.
    There is no problem _fetching_ this UUID. I do it with:

    def get_vm_uuid(vmid: str) -> str:
        """
        Get uuid for vm: value.identity.bios_uuid
        """
        vm_by_id = SESSION.get(f"{VCENTER_URL}/rest/vcenter/vm/{vmid}")
        return vm_by_id.json()['value']['identity']['bios_uuid']

    However, there is no PUT method for this call that I can find.

    This seems very straight forward in this example:
    https://community.broadcom.com/vmware-cloud-foundation/discussion/change-uuid-biosuuid-of-a-vm#bm053477d5-a7ab-4c8b-b352-b6b9364a0452

    But for the life of me, I cannot find any reconfigVM_Task in the REST documentation.

    If possible, I would like to avoid pyvmomi, but if that is the only way to do this, I would be very grateful for any hints on how to achieve this by using pyvmomi as well.

    Thanks for reading!