Vcenter REST API VM info - What measure has been used for disk,cdroms identifier

1.2k Views Asked by At

I'm using vcenter REST API to get VM information On Official documentation, 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.

Standard json response for VM information is like this

https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/api/vcenter/vm/vm/get/

you can see there are "key" in json response of disks, cdrom, sata_adapter and etcs.... and this is my real json response.

"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
        }
    },
    "parallel_ports": {},
    "sata_adapters": {
        "15000": {
            "bus": 0,
            "pci_slot_number": 33,
            "label": "SATA controller 0",
            "type": "AHCI"
        }
    },

Anyone knows how to measure those numbers at "key" (2000, 2001, 15000) ?

1

There are 1 best solutions below

0
On
2000  2:0:0:0  
SCSI number (X:X:X:X) 
/sys/class/scsi_device/2:0:0:0/