I'm using vcenter REST API (getVM) and each subresource of VM (such as disk, cdrom, sata_adapter....) has their own identifier.But i'm not sure what standard has been used to make those identifier.
such as ..
"disks": { "2000": { "scsi": { "bus": 0, "unit": 0 }, "backing": { "vmdk_file": "[datastore3] test.vmdk", "type": "VMDK_FILE" }, "label": "Hard disk 1", "type": "SCSI", "capacity": 322122547200 }, "2001": { "scsi": { "bus": 0, "unit": 1 }, "backing": { "vmdk_file": "[datastore3] ex1.vmdk", "type": "VMDK_FILE" }, "label": "Hard disk 2", "type": "SCSI", "capacity": 17179869184 }, "2002": { "scsi": { "bus": 0, "unit": 2 }, "backing": { "vmdk_file": "[datastore3] ex.vmdk", "type": "VMDK_FILE" }, "label": "Hard disk 3", "type": "SCSI", "capacity": 21474836480 } } "sata_adapters": { "15000": { "bus": 0, "pci_slot_number": 33, "label": "SATA controller 0", "type": "AHCI" } }
which order has been used for those identifier (key: 2000~2.15000)?
Key( integer ) = A unique key that distinguishes this device from other devices in the same virtual machine. Keys are immutable but may be recycled; that is, a key does not change as long as the device is associated with a particular virtual machine. However, once a device is removed, its key may be used when another device is added.
This property is not read-only, but the client cannot control its value. Persistent device keys are always assigned and managed by the server, which guarantees that all devices will have non-negative key values.
When adding new devices, it may be necessary for a client to assign keys temporarily in order to associate controllers with devices in configuring a virtual machine. However, the server does not allow a client to reassign a device key, and the server may assign a different value from the one passed during configuration. Clients should ensure that existing device keys are not reused as temporary key values for the new device to be added (for example, by using unique negative integers as temporary keys).
When editing or deleting a device, clients must use the server-provided key to refer to an existing device.