How to emulate esxcfg-vmhbadevs - m with the Perl API?

I have an iSCSI target that has been formatted and divided into a volume. I want to be able to map to the UUID volume iSCSI target LUN.

esxcfig-vmhbadev - m do it directly, for example in the LUN low, 207 maps line the UUID 4ac128de-d4b8f7c3-a4a5-001ec9ab7607.

vmhba0:1:0:1/dev/sdb1 47a3995d-bf8312ea-aa8a-0019b9f36fbf

vmhba0:0:0:3/dev/sda3 479f6ab3 - 636688 b 2-277 - 0019b9f36fc1

vmhba1:4:200:1/dev/sdc1 4ac127e9-81fb1fcf-1138-001ec9ab7607

vmhba1:15:207:1/dev/sdd1 4ac128de-d4b8f7c3-a4a5-001ec9ab7607

How can I do this using the Perl API? I can get both halves of the information, but I do not see how to associate.

This snippet gives me information on the LUN and the SCSI UUID

Print "canonical name, UUID\n;

My $scsiLUN = $storageSystem - & gt; storageDeviceInfo - & gt; scsiLun;

{foreach (@$scsiLUN)}

Print "". " $_ - & gt; canonicalName

. ", " . $_ - & gt; UUID

. "\n";

}

Canonical name, UUID

vmhba1:15:207, 0100cf000020202020564952545541

vmhba0:1:0, 020000000050014ee0004544c3574443205744

vmhba0:0:0, 020000000050014ee0004544d2574443205744

vmhba1:4:200, 0100 c 8000020202020564952545541

Then this excerpt gives me information on the volume:

My $mountInfo = $storageSystem - & gt; fileSystemVolumeInfo - & gt; mountInfo;

print 'Volume Name, Path, Type, Capacity\n';

{foreach (@$mountInfo)}

Print "". " $_ - & gt; volume - & gt; name

. ", " . $_ - & gt; mountInfo - & gt; path

. ", " . $_ - & gt; volume - & gt; type

. ", " . $_ - & gt; volume - & gt; capacity

. "\n";

}

Volume name, Path, Type, capacity

esx7_local_storage2, / vmfs/volumes/47a3995d-bf8312ea-aa8a-0019b9f36fbf, VMFS, 79725330432

esx7_local_storage1, / vmfs/volumes/479f6ab3 - 636688b 2-277 b-0019b9f36fc1, VMFS, 71672266752

vol_2_1, / vmfs/volumes/4ac127e9-81fb1fcf-1138-001ec9ab7607, VMFS, 805306368

snap-0e22598d-vol_2_1, / vmfs/volumes/4ac128de-d4b8f7c3-a4a5-001ec9ab7607, VMFS, 805306368

But then how to map vmhba1:15:207 to/vmfs/volumes/4ac128de-d4b8f7c3-a4a5-001ec9ab7607?

Thank you

From vSphere 4.0, esxcfg-vmhbadevs has been replaced by a new order with a lot more information called esxcfg-scsidevs. This script is available on the classic ESX 4.0 w/Service Console of course but also in the context of the new vCLI which uses the new vSphere SDK for Perl 4.0 which can take a look at how this new information is extracted.

The command works on ESX 4.0 and 3.5 and here is the output of ESX 3.5 system example:

[vi-admin@scofield ~]$ esxcfg-scsidevs -m --server bertha.primp-industries.com. --username root
Enter password:
vmhba1:0:200:1   /vmfs/devices/disks/vml.0200c80000600508b40008dd5b0000800000640000485356333030:1   48e1cd81-81223593-6cd8-00215acaa2b2   0  dlgCore-FC-LUN200.Templates
vmhba1:0:202:1   /vmfs/devices/disks/vml.0200ca0000600508b40008dd5b0000800000bd0000485356333030:1   48e1a4a6-3b55e69b-02a9-001f29c948e2   0  dlgCore-FC-LUN202.VMstorage2
vmhba1:0:204:1   /vmfs/devices/disks/vml.0200cc0000600508b40008dd5b0000a00000810000485356333030:1   495e986b-b61cc1d6-27b1-00215ab08a79   0  dlgCore-FC-LUN204.VMstorage4
vmhba1:0:203:1   /vmfs/devices/disks/vml.0200cb0000600508b40008dd5b0000800000b50000485356333030:1   48e16ed0-420158d5-5601-00215acaa2b2   0  dlgCore-FC-LUN203.VMstorage3
vmhba1:0:201:1   /vmfs/devices/disks/vml.0200c90000600508b40008dd5b0000800000c30000485356333030:1   48e1b819-3443974c-03c4-001f29c948e2   0  dlgCore-FC-LUN201.VMstorage1
vmhba0:0:0:5     /vmfs/devices/disks/vmhba0:0:0:0:5                                                 4913e014-62bc3b90-da2e-001f29c948f8   0  esx-1-local-SAS.Storage

You have listed the vmhbaC:T:L:P mapped to the VML path and then store data UUID, then the readable name for the data store human. You can certainly create a copy of the script and only what you want exactly and that nobody is re - invent the wheel.

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

William Lam

VMware vExpert 2009

Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

repository scripts vGhetto

VMware Code Central - Scripts/code samples for developers and administrators

150 VMware developer

Twitter: @lamw

If you find this information useful, please give points to "correct" or "useful".

Tags: VMware

Similar Questions

  • Just bought a new computer. an old crashed. How can I sync my iphone with the new computer?

    just bought a new computer. an old crashed. How can I sync my iphone with the new computer?

    Original title: sync

    Ask the question in the Apple Forums:
    https://discussions.Apple.com/index.jspa

  • How can I share 'My images' with the other user accounts on my computer?

    How can I share 'My images' with the other user accounts on my computer?

    where are the 'experts' on these forums adverstised?  I can't get an answer to a simple question.  Does anyone know how to do this?

    Here we are, ok, I'm not an expert, but try this:

    Right click on 'My images' > share > specific people... > select that you want to share this folder with.

    ...

    After that, try to connect by using a different account. If you will not be able to open C:\Users\"FirstUser"\Pictures, you try to extend the network in the left pane of Windows Explorer > expand ComputerName > expand users > expand "FirstUser" > photos

  • How to start my subscription abroad with the foreign language and writing unknown?

    How to start my subscription abroad with the foreign language and writing unknown?

    These can also be useful:

    FAQ: Is creative cloud available in my country?

    FAQ: Why my purchase showing the wrong currency?

    FAQ: How can I view Adobe web pages in another language?

    FAQ: How can I change the country associated with my Adobe ID?

    FAQ: How can I change the language that appears in my creative cloud app?

  • I'd like to edit a PDF secure document did not change the text, or the layout at all I would do is highlight the text.  How can I do this?  With the help of Adobe Acrobat DC 15.9.20077.160923

    I'd like to edit a PDF secure document did not change the text, or the layout at all I would do is highlight the text.  How can I do this?  With the help of Adobe Acrobat DC 15.9.20077.160923

    You know the password? Otherwise, the security policy does not allow adding comments in the file, then there is nothing you can do about it.

  • How do I date stamp photo with the date that it was created?

    How do I date stamp photo with the date that it was created?

    donaldm80418165 wrote:

    How do I date stamp photo with the date that it was created?

    Use the text tool.

    Note that you can select the font, color, size of the pt.

  • How do monitors vecteurscopes and waveform with the new update in first Pro CC?

    How do monitors vecteurscopes and waveform with the new update in first Pro CC?

    Press the COLOR at the top of the interface or go to the window workspace and select Lumetri Scopes.

    If you are a reverence for the old spans: there have been removed in favor of the Lumetri Scopes.

  • I need to update the screenshots for a new version of an app existing Itune application to download a new version. Since I did not create the original version, can you guide me how to create a new version with the new version number?

    I need to update the screenshots for a new version of an existing iTunes Connect App asks me to download a new version. Since I did not create the original version, can you guide me how to create a new version with the new version number?

    You must call the assistance of the company and ask them to help you with this. You can find contact information by logging on http://digitalpublishing.acrobat.com/ and looking at the Middle at the bottom of the page.

    Neil

  • How are we supposed to work with the new motion tweens if there is no editor of motion more?

    How are we supposed to work with the new motion tweens if there is no editor of motion more? Without query editor, we can see what kind of key frames are defined and we cannot set acceleration anywhere. Adobe go us back and use the old motion tweens does want now?

    Hi all

    Flash Pro CC 2014 (v 14.0.0.110) is now available for download through the creative application of cloud.

    We have included a whole new motion editor and several other new features with this release of Flash Pro. The new query editor is completely redesigned, intuitive and easy to use while retaining the basic features and backward compatibility with Flash CS6

    To call the query editor, just double-click on your motion tweens on the timeline (or right click and select "Refine the Motion") and the motion Editor opens in the context of the scenario itself. Double click again to collapse once you have made your adjustments.

    Complete list of the new features of Flash Pro CC 2014 is available at these links:

    Overview: https://www.adobe.com/in/products/flash.html

    What's new: https://helpx.adobe.com/flash/using/whats-new.html

    Release notes: https://helpx.adobe.com/flash/release-note/flash-professional-cc-2014.html

    Videos: https://helpx.adobe.com/in/flash.html

    Thank you

    Mabrouk

  • How can I create a query with the data control to the web service?

    I need to create a query with the order of web service data, WSDL, it is query operation, there is a message of parameter with possible query criteria and a return message contains the results. I googled but can't find anything on the query with the web service. I can't find a criterion "named" to the data control of web service as normal data control. Blog of Shay, I saw the topics on the update with the data of web service command. How can I create a query with the data control to the web service? Thank you.

    Hello

    This might help

    * 054.     Search form using control data WS ADF and complex of entry types *.

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html

  • Accessible resources within a platform with the HQ API

    Hello

    I use the HQ API to build a custom Java monitoring tool.
    So far, I can easily access agents and its related settings.

    My problem is that I don't know how to access resources related to agent: Mount of the file server, servers, services... Is it impossible with the HQ API?

    How can I do?

    If you use this, it will be very easy!

    Get all your HQ server agents: this will return a list of the agents!

    listAgent = hq.getAgentApi () .getAgents () .getAgent ();

    Get all your HQ server platform: this will return a list of Resources (platform)!

    listPlatform = hq.getResourceApi () .getResources (listAgent.get (i), true, true) .getResource ();

    Get all your HQ Server server: this will return a list of Resources (server)!

    list server = listPlatform.get (j) .getResource ();

    get all your HQ Server services: this will return a list of Resources (services)!

    listServices = listServer.get (k) .getResources ();

    with this, you can have the agent (machines) and all the resources under it!

    Hope this will help u

  • Get members of the group with the Java API in LiveCycle

    I work with the Java API in LiveCycle (LiveCycle 8.2) and I am looking


    an example of how read the members of a group.

    I am able to get a group (Type GroupImpl) using the PrincipalSearchFilter.


    But how do I get the members of this group. I checked the
    DirectoryManagerServiceClient and classes of different search filters
    without success?

    As a solution, I can retrieve all users of my application area and
    check their membership to see if they are in the group concerned. But this
    is a dirty hack, I really don't want to use.

    Any ideas?

    Hello!

    I know you mentioned that you were watching in this without success, but it should work really.

    First make a GroupMemebershipSearchFilter, defining the groupoid be the ID of the group itself.  Using the DirectoryManagerServiceClient you can then call findGroupMembers using the searchFilter that will return a list of, as follows:

    DirectoryManager DirectoryManagerServiceClient = new DirectoryManagerServiceClient (serviceConnection.getFactory ());

    List userList = new ArrayList ();

    Try
    {
    userList = directoryManager.findGroupMembers (searchFilter);
    }
    catch (System.Exception e)
    {

    Animals mistake
    }

    return userList;

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • where to save the files under options the file name is duplicated how to remove an additional folder with the same name

    Under Options in Firefox, I clicked on save the files under downloads, but the file name twice and an additional file with the same name is created in the folder, i.e.:

    G:\Akbar's Songs\HAMARA DOWNLOADS\HAMARA FORUMS DOWNLOADS FORUMS

    As you can see the file repeats, how can I fix it?

    Also the music files, I download from a site of downloads as a WinRar file and I need to open it. Y at - it an option where the file opens automatically in the folder I chose?

    Thanks a lot for your help.

    Hi Akush, when you install 7 - zip, make itself the default application to open .zip and .rar files. So if you double click on the .rar file, it should open in 7 - zip. If you prefer to decompress immediately, right click the file and look for new 7 - zip items in the menu. I can't think of a way to do this automatically, however.

  • Windows XP Home edition has crashed - how to return WXP and use with the product key?

    Hello. I bought an Equium L20 last year and after 1 year my windows crashed due to a virus. I want to know how to get a real windows xp OS because the product under my laptop key is always saved for me and is a legitimate product but I can't get windows because it was obviously preinstalled and no CD was given to me with the package.

    How can I get back Windows to use with my product key on my WIN sticker below my laptop.

    Hello

    First of all, it is very strange that recovery CD is not delivered with your laptop. It's hard to believe, but anything is possible. As you know after buying a new product, it is very important to check all orders sent with it and if something is missing, you must call the local as soon as possible and not to wait a year.

    Sorry but this key code belongs to original recovery image and you can't use it with every installation of Windows XP Home edition CD. In your case, there are two options:
    -You can buy the CD of facilities Microsoft original WXP (with the key correctly code) or
    -Contact the partner of service allowed in your country and order the new CD from recovery for your laptop model.

    All that s!

    Bye and good luck!

Maybe you are looking for