VMware {code} Community
jx
Contributor
Contributor

Virtual disk identifier

Hello there,

This is a question and an attempt to understand how it works under the hood.

I have an application running on a VM, trying to identify the locally attached hard disks. In the physical world, every disk has a serial number. But in cloud world they have names. My application has privileges to talk to vCloud and pull the vApp data. But I am wondering what is the best way to map the locally detected disks to the disk names available in the vApp structure. For instance suppose there are two hard disks HD1 and HD2, attached as /dev/sda and /dev/sdb. How can my application know HD1 is /dev/dsa and HD2 is the other one??

Here is an extract from a vApp structure which (I believe) describes the virtual disk

.....

<ElementName xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Hard Disk 1</ElementName>

<HostResource xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">4194304</HostResource>

<InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">9</InstanceID>

<VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">4194304</VirtualQuantity>

.....

What does this mean to a running OS? How would it get translated to a disk serial number or anything that the OS can use to uniquely map to a locally available disk?

If I do a fdisk -l it gives

root@ubuntu-srv:~/test# fdisk -l

Disk /dev/sda: 4294 MB, 4294967296 bytes

255 heads, 63 sectors/track, 522 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x0006f361

I am curious about the "Disk identifier" field. Who generates that number, and what is the lifecycle ?

Can anyone provide some insight here ??

Thanks

~jx

0 Kudos
0 Replies