- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That will get you the VcGuestDiskInfo object (https://www.vmware.com/support/orchestrator/doc/vro-vsphere60-api/html/VcGuestDiskInfo.html), which just tells you the mount path and the size. Helpful. However, to be useful, you need to be able to get the VcVirtualDisk under vm.config.hardware.device.
For example, this will show you what the guest OS sees from a mount path standpoint:
for (var ix in u_vm.guest.disk)
{
System.log('----------');
System.log(ix.toString());
System.log('DiskPath: ' + u_vm.guest.disk[ix].diskPath);
System.log('Freespace (GB): ' + (u_vm.guest.disk[ix].freeSpace / 1024 / 1024 / 1024).toString());
System.log('Capacity (GB): ' + (u_vm.guest.disk[ix].capacity / 1024 / 1024 / 1024).toString());
}
However, none of that corresponds to anything I've been able to find in other objects. There is no order that universally works that I can find.
for (var ix in u_vm.config.hardware.device)
{
if (u_vm.config.hardware.device[ix] instanceof VcVirtualDisk)
{
System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].deviceInfo.label);
System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].deviceInfo.summary);
System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].diskObjectId);
}
}
So in general, we need to match these two for loops up.