VMware
11 Replies Last post: Apr 23, 2009 12:55 PM by CITITECHS  

Script to find RDMs on ESX Hosts or VC posted: Mar 7, 2008 5:47 PM

Click to view lamw's profile Champion 2,803 posts since
Nov 27, 2007

Is it possible to go through a set of hosts and find which ESX Host have a Virtual Machine that is using an RDM (Raw Disk Mapping), I would like to be able to keep track of the RDM's that have been allocated, especially at multiple sites/clusters. From the Virtual Machines that currently have RDM's, theres no real way of telling if it's using an RDM, as there is no unique flag or file that specifies it's an RDM. I remember reading about RDMs and how it has a proxy file, but I believe thats probably embedded on the VMFS which is not viewable on the Service Console, unless someone knows how I can query that information through a batch script. I have not dived into the VCDB to see if this information can be queried.

Thanks in advanced.

Re: Script to find RDMs on ESX Hosts or VC

1. Mar 7, 2008 5:55 PM in response to: lamw
Click to view dominic7's profile Virtuoso 2,134 posts since
Jan 11, 2005
I'm zctuzlly writing a script to do this now. I'll have it done next week some time. The script will be written in perl and use the VIPerl API. If my pans don't pan out for this evening it might be done sooner ;p

Re: Script to find RDMs on ESX Hosts or VC

3. Mar 7, 2008 6:48 PM in response to: lamw
Click to view sthoppay_wipro's profile Enthusiast 43 posts since
Jan 25, 2008

vimsh -n -e '/vmsvc/device.getdevices 32'

shows the RDM LUNs used by that VM.

Re: Script to find RDMs on ESX Hosts or VC

5. Mar 8, 2008 4:49 AM in response to: lamw
Click to view sthoppay_wipro's profile Enthusiast 43 posts since
Jan 25, 2008

My server is ESX 3.5

Yes, 32 is the VMID.

Re: Script to find RDMs on ESX Hosts or VC

6. Mar 8, 2008 6:36 AM in response to: lamw
Click to view petedr's profile Master 1,408 posts since
Mar 18, 2006

Re: Script to find RDMs on ESX Hosts or VC

7. Apr 16, 2008 9:16 PM in response to: dominic7
Click to view BeelS's profile Lurker 1 posts since
Mar 13, 2005

How is that Perl script coming along to find RDMs on VC and Hosts


Re: Script to find RDMs on ESX Hosts or VC

9. Aug 7, 2008 1:23 PM in response to: dominic7
Click to view chuss's profile Master 974 posts since
Jul 2, 2004

Dominic,

Did you ever get a chance to finish that perl script? I've got a student in class this week looking for something that will scan the ESX server looking for all of the RDMs.

Thanks,

Chris


Re: Script to find RDMs on ESX Hosts or VC

11. Apr 23, 2009 12:55 PM in response to: lamw
Click to view CITITECHS's profile Novice 37 posts since
Feb 4, 2008

My coworker came up with the following as the posted one didnt work with 3.0.1

find /vmfs/volumes/*/*/*-rd*.vmdk | uniq | egrep -v /vmfs/volumes/[:digit:]

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities