VMware {code} Community
ii00907
Contributor
Contributor
Jump to solution

Change Device Display Name

Hi everyone,

my request for help in the management of names LUN on my datacenter.

Currently on my ESX are attached more than 100 Lun and I wish I could edit the entry with the name Device Display Name LUN created on the storage.

When i run the command "esxcfg-mpath -l" i have this display;

Runtime Name: vmhba0:C0:T0:L0

Device: naa.6006016055351f00506decc0459cde11

Device Display Name: DGC Fibre Channel Disk (naa.6006016055351f00506decc0459cde11)

etc.

etc.

etc.

With vCenter Client i rename the "Device Display Name" on Configuration -> Storage Adapters -> and after run "esxcfg-mpath -l" ;

Runtime Name: vmhba0:C0:T0:L0

Device: naa.6006016055351f00506decc0459cde11

Device Display Name: LUN20_100GB_VM_W2003

etc.

etc.

But is possible to effect by command line ?

Thanks

Reply
0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

So the method should be called from the host's storageSystem, take a look at the API method to see what parameter it requires. I don't have the time to create a sample script but after VMworld, I should have some free cycles hopefully.

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

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".

View solution in original post

Reply
0 Kudos
8 Replies
lamw
Community Manager
Community Manager
Jump to solution

Yes, there is a method called UpdateScsiLunDisplayName

This functionality does not exists in any canned VMware scripts.

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

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
ii00907
Contributor
Contributor
Jump to solution

Hi William,

Thanks, your info are always correct.

Unfortunately i do not know how to invoke method UpdateScsiLunDisplayName

You know give me some Web-Link where understand what?

Thanks in advance

P.S. For all user: Remember

Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

So the method should be called from the host's storageSystem, take a look at the API method to see what parameter it requires. I don't have the time to create a sample script but after VMworld, I should have some free cycles hopefully.

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

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
ii00907
Contributor
Contributor
Jump to solution

Thanks William,

I'm trying to understand something, but I see very difficult.

Thanks in advance if your return can help me with a Sample Script.

Good VMworld!!!

P.S. For all user: Remember

Reply
0 Kudos
njain
Expert
Expert
Jump to solution

Hi,

I have written a small sample perl script that updates the display name of the ScsiLun. You need to provide the device id of the ScsiLun (as seen in "Device" field of esxcfg-mpath -l output) for which you wish to update the name.

Hope this helps!

Neha

Reply
0 Kudos
ii00907
Contributor
Contributor
Jump to solution

Hi,

very thanks for your help!

I have run your script on my vMA machine but i have this error;

$ perl updateScsiLunDisplayName.pl --url --username administrator --password dosi2006 192.23.11.1 --device naa.6006016055351f00506decc0459cde11 LUN_IVAN_TEST

Can't locate AppUtil/HostUtil.pm in @INC (@INC contains: /home/vi-admin/../ /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at updateScsiLunDisplayName.pl line 15.

BEGIN failed--compilation aborted at updateScsiLunDisplayName.pl line 15.

Can you help me understand where I wrong?

Thanks in advance

Reply
0 Kudos
KostyantynUA
Contributor
Contributor
Jump to solution

vi-admin@itrmvma ~$ perl updateScsiLunDisplayName.pl --url --username administrator --password dosi2006 192.23.11.1 --device naa.6006016055351f00506decc0459cde11 LUN_IVAN_TEST

Can't locate AppUtil/HostUtil.pm in @INC

From this you can find out that some of perl modules is missing, in this case HostUtil.pm. First of all you need to find out if you have this library. And then put it in one of known library directories or for example modify first line of the script from

>#!/usr/bin/perl -w

to

>#!/usr/bin/perl -w -I {path to missing library AppUtil/HostUtil.pm}

In my case it looks like this:

>#!/usr/bin/perl -w -I /usr/lib/vmware-vcli/apps/

ii00907
Contributor
Contributor
Jump to solution

Very very thanks,

this script is perfect.

I made a small modification, which also pass the parameter of the "new display name" --new_name , so you do not get the prompt and schedule your scripts.

in attach your script with my change.

Thanks again for your help

Reply
0 Kudos