VMware {code} Community
vohra
Contributor
Contributor

Problem with “deviceName” for virtual mode RDM?

<![endif]><![if gte mso 9]>

<!--

/* Font Definitions */

@font-face

{font-family:"Cambria Math";

panose-1:2 4 5 3 5 4 6 3 2 4;

mso-font-charset:0;

mso-generic-font-family:roman;

mso-font-pitch:variable;

mso-font-signature:-1610611985 1107304683 0 0 159 0;}

@font-face

{font-family:Calibri;

panose-1:2 15 5 2 2 2 4 3 2 4;

mso-font-charset:0;

mso-generic-font-family:swiss;

mso-font-pitch:variable;

mso-font-signature:-1610611985 1073750139 0 0 159 0;}

/* Style Definitions */

p.MsoNormal, li.MsoNormal, div.MsoNormal

{mso-style-unhide:no;

mso-style-qformat:yes;

mso-style-parent:"";

margin-top:0in;

margin-right:0in;

margin-bottom:10.0pt;

margin-left:0in;

line-height:115%;

mso-pagination:widow-orphan;

font-size:11.0pt;

font-family:"Calibri","sans-serif";

mso-ascii-font-family:Calibri;

mso-ascii-theme-font:minor-latin;

mso-fareast-font-family:Calibri;

mso-fareast-theme-font:minor-latin;

mso-hansi-font-family:Calibri;

mso-hansi-theme-font:minor-latin;

mso-bidi-font-family:"Times New Roman";

mso-bidi-theme-font:minor-bidi;}

.MsoChpDefault

{mso-style-type:export-only;

mso-default-props:yes;

mso-ascii-font-family:Calibri;

mso-ascii-theme-font:minor-latin;

mso-fareast-font-family:Calibri;

mso-fareast-theme-font:minor-latin;

mso-hansi-font-family:Calibri;

mso-hansi-theme-font:minor-latin;

mso-bidi-font-family:"Times New Roman";

mso-bidi-theme-font:minor-bidi;}

.MsoPapDefault

{mso-style-type:export-only;

margin-bottom:10.0pt;

line-height:115%;}

@page Section1

div.Section1

-->



I am a creating a virtual machine having one virtual mode RDM .


My problem is that I get an error message that the size of disk is exceeding the maximum file size supported by datastore. I have doubled checked the code that correct disk capacity is set. To debug this I compared the hostd.log when I am creating the virtual machine programmatically with the same creation via vSphere Client manually. I found that the only difference is in the virtualdevicedevicebackinginfo-&gt;deviceName string. I am using a string of the format “vml.XXXXX…” which I got from the virtual machine MO and the successful creation of disk needs something like “/vmfs/devices/naa.YYYYYYY…” , hardcoding this value actually made my program work.


Further I found that “/vmfs/devices/naa.YYYYY…” is a link to “vml.XXXXXX…” .


I do not know how to get needed deviceName programmatically.


Any ideas how to resolve this will be appreciated. Thanks in advance.</span>

Reply
0 Kudos
4 Replies
lamw
Community Manager
Community Manager

Take a look at this script on querying for the deviceName -

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
vohra
Contributor
Contributor

Hi William

Thanks a lot for your reply. The script is very helpful but in my case I want to record the needed "deviceName" (in the format of "vmfs/devices/naa.YYYYY....")

when lun is actually being used by a virtual machine so as to be able to re-create the exactly same virtual machine at a later time when the lun is free. Thus since

the lun is in use when I am calling "QueryAvailableDisksForVmfs" on the HostDatastoreSystem of the host MO the needed lun does not show up.

Any ideas in this regard will be highly appreciated. Thanks in advance.

vohra

Reply
0 Kudos
lamw
Community Manager
Community Manager

Recording the deviceName is pretty simple, please take a look at the script to see where you can extract the information and print it out. If the LUN is already in use, then I believe it will not show up per the query.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
vohra
Contributor
Contributor

Thanks William, the issue has been resolved.

Reply
0 Kudos