Hi All,
how do i check the virtaul disk of the virtual machine is an RDM or a virtual disk using SDK ???
Regards,
SHILPA
You want to query the VM(s) disks to ensure it's a VirtualDisk & its disk backing is of VirtualDiskRawDiskMappingVer1BackingInfo. From here you can get more information about the RDM to see if its physical or virtual compatibility mode,etc: http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.vm.device.VirtualDisk....
Here's a quick snippet of Perl code that shows how you can query by obtaining a VM view and look at the configured disks:
my $devices = $vm_view->config->hardware->device; foreach my $device (@$devices) { my $device_name = $device->deviceInfo->label; if ( ($device->isa('VirtualDisk')) && ($device->backing->isa('VirtualDiskRawDiskMappingVer1BackingInfo')) ) { print $device_name, " is an RDM\n"; } }
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
You want to query the VM(s) disks to ensure it's a VirtualDisk & its disk backing is of VirtualDiskRawDiskMappingVer1BackingInfo. From here you can get more information about the RDM to see if its physical or virtual compatibility mode,etc: http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.vm.device.VirtualDisk....
Here's a quick snippet of Perl code that shows how you can query by obtaining a VM view and look at the configured disks:
my $devices = $vm_view->config->hardware->device; foreach my $device (@$devices) { my $device_name = $device->deviceInfo->label; if ( ($device->isa('VirtualDisk')) && ($device->backing->isa('VirtualDiskRawDiskMappingVer1BackingInfo')) ) { print $device_name, " is an RDM\n"; } }
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
Thank you:)