Translation of the naa.id in ESX datastore name tag

Hello world

Is it possible to translate the NAA.id in the name of the data store to make more useful information
So instead of display naa.60060160e31027923fdea652e3512345 it should show the name as in the cmdlet Get-data store?

I changed the last line of the script as follows:
New-VIProperty -Name lunID -ObjectType ScsiLun -Value {
     param($lun)
     [int](Select-String ":L(?<lunID>\d+)$" -InputObject $lun.RuntimeName).Matches[0].Groups['lunID'].Value
} -Force | Out-Null

Get-VMHost | Get-ScsiLun | Select -Unique CanonicalName, CapacityMB, lunID | Sort lunID | ft -AutoSize
FYI: The script above is created by the Almighty LucD of: http://www.lucd.info/2011/07/26/the-making-of-a-new-viproperty-called-lunid

I created a new property that displays the datastorename.

New-VIProperty -Name lunDatastoreName -ObjectType ScsiLun -Value {
    param($lun)

    $ds = $lun.VMHost.ExtensionData.Datastore | %{Get-View $_} | `        where {$_.Summary.Type -eq "VMFS" -and
            ($_.Info.Vmfs.Extent | where {$_.DiskName -eq $lun.CanonicalName})}
    if($ds){
        $ds.Name
    }
} -Force | Out-Null

But attention is a new very slow property.

Use it as a

Get-VMHost -Name $esxName | Get-ScsiLun | Select CanonicalName, CapacityMB, lunDatastoreName

Tags: VMware

Similar Questions

  • How to get the present host ESX VM name

    Dear friends,

    I have script Powercli which information on all virtual machines, how to include where the virtual machine introduced ESX host name and the name of the data store.

    $MyCollection = @)

    $AllVMs = get-View - ViewType VirtualMachine. Where {-not $_.} Config.Template}

    {ForEach ($VM)

    $Details | Add-Member-Name name-value $VM.name - Membertype NoteProperty

    }

    You can try like this

    $MyCollection = @()$AllVMs = Get-View -ViewType VirtualMachine | where {-not $_.Config.Template}
    
    foreach ($VM in $AllVMs) {    $Details = New-Object PSObject    $Details | Add-Member -Name Name -Value $VM.name -Membertype NoteProperty    $Details | Add-Member -Name Host -Value (Get-View $vm.Runtime.Host).Name -Membertype NoteProperty    $Details | Add-Member -Name Datastore -Value ([string]::Join(',',($vm.Datastore | %{Get-View $_} | %{$_.Name}))) -Membertype NoteProperty    $MyCollection += $Details}$MyCollection
    
  • Relationship between the naa and the number LUN? (And SCSI id and mpx)

    When you look at a map of storage on a Fibre Channel network I see a few different "naa" id: s for each LUN. LUNs from the same SAN naa seems similar, but always unique.

    My first question is if the "naa" is based on something physical disks or if he comes an ID the SAN attached to each logic unit number as it is created?

    Is it true that a name of mpx is something an ESX host can produce when no naa is known?

    The final question is the SCSI id that could be seen of a LUN in the storage of vCenter views. There seems to be a SCSI id for each disk/LUN, and I wonder what this SCSI id? If it was only a single disc, it might be a physical serial number of the drive itself, but when you look at a LUN composed of several discs there must be something else.

    Its just only usually know the WWN for each unit number logic is unique.

    Channel is a former SCSI reference - very rarely used nowadays, and, as you mention, is almost always '0'.

    -Matt

    VCP, VCDX #52, Unix Geek, Nerd of storage

  • Script to list the information under Configuration/Storage/datastore details

    Hello, I'm trying to create a script that returns the details data Configuration/Storage/Datastore/store info. The thing I want the script to do is list my ESX:s, data of list store names, list mpathpolicy and the details of the data store paths section in the VI client.

    Is it possible to get this in a script? Or if anyone knows how I can get information from the info of paths in Details of the data store to the VI client

    Thanks in advance

    This is possible if you use the SDK.

    The following script lists the name of host, name of DS, political path and the number of paths.

    If you need other information on the page of details in the report let me know.

    $report = @()
    
    Get-VMHost  | Get-View | %{
         $esx = $_
         $esx.Datastore | %{Get-View $_} | where {$_.SUmmary.Type -eq "VMFS"} | %{
                   $ds = $_
                   $ds.Info.Vmfs.Extent | %{
                        $ext = $_
                        $extKey = ($esx.Config.StorageDevice.ScsiLun | where {$_.CanonicalName -eq $ext.DiskName}).Key
                        $lun = $esx.Config.StorageDevice.MultipathInfo.Lun | where {$_.Lun -eq $extKey}
    
                        $row = "" | Select ESXname, DSname, "Path Selection","Paths Total"
                        $row.ESXname = $esx.Name
                        $row.DSname = $ds.Name
                        $row."Path Selection" = &{
                             switch($lun.Policy.Policy){
                                  "VMW_PSP_FIXED"{"Fixed"}
                                  "VMW_PSP_RR"{"Round Robin"}
                                  "VMW_PSP_MRU"{"Most Recently Used"}
                             }
                        }
                        $row."Paths Total" = $lun.Path.Count
                        $report += $row
                   }
         }
    }
    $report
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • How to configure the agent to monitor performance only the vcenter vmware and esx, not need to monitor virtual machines

    How to configure the agent to monitor performance only the vcenter vmware and esx, not need to monitor virtual machines

    This is not possible with the way in which we collect information.

  • Avoid the translation in the browser - Adobe Muse

    Hello!

    I made a web page that contains information in English and Spanish. My mother has their browser set to translate all the pages to Spanish for texts in English are also translated into Spanish. I imagine that many people who do not speak English have this setting in their browsers. How can I avoid this in adobe Muse?

    Thank you

    This adds the HTML codesection of your page master properties (or individual pages).

    It will automatically prevent tranlating the Google/Google Chrome page and also disables the bar translate.

    I hope this helps.

    David

    Creative muse

  • Since yesterday, I can't export to Flickr more. The following message (I translate from the french, so probably different from the original English message): "an internal error: comma symbol was expected.»

    Since yesterday, I can't export to Flickr more. The following message (I translate from the french, so probably different from the original English message): "an internal error: comma symbol was expected.»

    Flickr is flaky again.  You'll just have to wait (minutes, hours, or even days).   It happens more often that Yahoo is falling apart.

  • mount the partition root to esx 4.1 in rescue livecd mode

    Hi guys! I have problem with recovery of esx 4.1 upd 3 Server. To my shame, I deleted /lib64/libc-2.5.so--> link lib64/libc.so.6, then restarted a server. So now, esx makes a core dump and does not start (Kernel panic not syncing kill init). I thought it was a piece of cake to boot from livecd linux, mount the partition root of esx and recreate the link but it was not as simple as that. In rescue of the livecd mode (redhat 5), I can only mount/boot partition for esx. Command fdisk-l shows a single device (/ dev/sda1) with linux fs and other devices sdaX with extended and uknown fs types and mount error on these devices. Mount/dev/sda1 gives me a partition/boot of esx. On another host esx 4.1 with a similar configuration command df shows partition/Boot resides on the device/dev/sdd1 while other partitions as root/var/log are located on/dev/sdeX devices. After having investigated further, I found that/dev/sdd is a local protected by car while/dev/sde does not match any network SAN or raid connected locally to the readers. Tomorrow I will try to boot from the esx installation media and see if there is something simillar to rescue mode and try and do something here. I have no idea what to do if it won't help. In the hope to hear a good advise to you guys!

    Do a new installation on a disk SAN and after booting from it, I was able to solve the problem with the link. Old server is running. But after all I agree with you markdjones82 - it would be faster and easier to reinstall from scratch.

  • How to identify the LUN WWN of ESX 3.5

    Hi all

    We have Vcenter 2.5 environment with 3 groups each cluster with 4 ESX 3.5 hosts. LUN is assigned to each group of EMC clariion and VNX storage boxes. I want to know how can I identify the LUN WWN of ESX console numbers. I tried esxcfg-vmhbadevs - m and esxcfg-mpath - l, but I'm not able to identify the LUN WWN here numbers are these commands HBA cards. I have numbers of WWN of the two clariion LUN and provided VNX nby our storage from these WWN team I want to identify what data store is using storage?

    any suggestions

    You can try running the command console and after the release?

    Run the following command

    esxcfg-mpath-lv | grep ^ disc | grep - v vmhba0 | AWK '{print $2} '.

    then choose a vmhba unit... IE: vmhba1:02:03...

    Run the following command (replace $entry by the vmhba you chose)

    esxcfg-mpath-lv | grep disc | grep - v vmhba0 | AWK '{print $3, $5, $2} "|  cut - b15 | Cup c - 1-32, 45 | Sort + 3 | grep w $entry | AWK '{print $1} '.

    Let me know if you still get the error...

    Otherwise, it is also a way to get what you need to use powerCLI... I have scripts on my other computer, but it is currently not available...

  • How to view the ESX host name as well as the information on the material (see text)

    I would like to see the ESX host name in the first column.

    Is there a better way to do it?

    Any help is very appreciated.  Thank you

    The section of my script for the hardware looks like this:

    #######################
    # VMware ESX hardware #.
    #######################
    Get-VMHost | Get-View | ForEach-Object {$_.} Summary.Hardware} | Select-object name vendor, model, MemorySize, CpuModel, CpuMhz, NumCpuPkgs, NumCpuCores, NumCpuThreads, NumNics, NumHBAs | ConvertTo-Html-title "Configuration of VMware ESX server Hardware" - body "< H2 > VMware ESX server Hardware configuration." "< / H2 > ' | Out-file - add $filelocation

    And My on put currently looks like this:

    (I want to see the name of the ESX host as the first column)

    Hardware configuration of VMware ESX server.

    Name of the vendor Model MemorySize CpuModel CpuMhz NumCpuPkgs NumCpuCores NumCpuThreads NumNics NumHBAs
    HPProLiant DL360 G734348974080Intel Xeon E5640 CPU @ 2.67GHz2666281643
    HPProLiant DL360 G734348974080Intel Xeon E5640 CPU @ 2.67GHz2666281643
    HPProLiant BL460c G625758969856Intel Xeon E5540 2.53 GHz CPU253314883
    HPProLiant BL460c G625758969856Xeon of Intel (r) CPU X 5570 @ 2.93 GHz293314883
    HPProLiant BL490c G7137428156416Xeon of Intel (r) CPU X 5675 3.07 GHz30662122442
    HPProLiant BL490c G7137428156416Xeon of Intel (r) CPU X 5675 3.07 GHz30662122442
    HPProLiant BL490c G7137428156416Xeon of Intel (r) CPU X 5675 3.07 GHz30662122442

    Not a more elegant solution, but it should produce the desired result

    &{foreach ($esx in Get-VMHost){
      ForEach-Object { $esx.ExtensionData.Summary.Hardware } |
      Select-object @{N="ESX Name";E={$esx.Name}},Vendor, Model, MemorySize, CpuModel, CpuMhz, NumCpuPkgs, NumCpuCores, NumCpuThreads, NumNics, NumHBAs}} |ConvertTo-Html -title "VMware ESX server Hardware configuration" -body "

    VMware ESX server Hardware configuration.

    " | Out-File -Append $filelocation
  • You will need to run the script for some ESX hosts.

    Dear team,

    I m connected to 4 esx host, but I want to run the script only 2 esx host asking you to help me how to do?

    concerning

    Mr. VMware

    You could start the script with the cmdlet Get-VMhost to select only the two hosts that you want to output to. For example:

    Get-VMHost host1, host2. Get - VM

    Displays only the virtual machine running on host1 and host2.

  • How do I uninstall the agent, VPXA in ESX 4.1 I

    Hi Experts,

    How do I uninstall the agent, VPXA in ESX 4.1 I.

    Thank you

    SIV

    td_sk wrote:

    Hi Experts,

    How do I uninstall the agent, VPXA in ESX 4.1 I.

    Thank you

    SIV

    ./opt/vmware/uninstallers/VMware-vpxa-uninstall.sh

  • Need to install the latest patch on ESX 3.5.0

    Dear Expert VMware,

    I have an ESX 3.5.0 64607 host, I want to install the latest patch or the latest version of ESX 3.5. can you please help me with the following

    (1) what is the last path or build of ESX 3.5.0 and please help me with the link of the same thing.

    (2) Please help me with the installation procedure step by step.

    Concerning

    MrVMware.

    You will need to should not change your ESX 3.x license as you move between versions.  vCenter will not need to change as long as ESX 3.x is licensed OK.

    PS - your message has been moved to the forum ESX 3.5.

  • Reassign the crash of post ESX license

    Hello...

    I am facing a problem! I installed 3 HP DL - 380 7 (double take) with ESXi 4.1. I installed a vCenter server, installed my license file (ordered for 8 servers) and said my ESX 3.

    Then I had a problem & reinstalled my ESX servers, from scratch... I forgot to leberate licenses!

    So after reinstalling my 3 servers, I have only 4 CPU on the left instead of 10! & I can't find where is the option for 'invisible' ESX unregistered

    Could someone help me on this matter?

    Thank you!

    Simply remove the license and again reinstall the same license. The "assessment" to the ESX host fresh installed license, you can assign temporary before removing the license file.

  • Resxtop - view of the camera: how to view the naa?

    When executing RESXTOP and looking at the camera discovers 'u' we have the "Device" column where you can see the disks of different blocks.

    However, I see only the first 15 characters in the id of the NAA, and since the NAA is much longer, it is not possible to see which device is which. Isn't it possible to change?

    Hello.

    To increase the width of the device name field:
    1. Esxtop start by running the command esxtop.
    2. Press u to display of the disk device.
    3. Press L (note this is a capital letter) to change the size of the name field.
    4. Enter the value 36 to display the identifier full naa.

    -of Ko 1035989

    Good luck!

Maybe you are looking for

  • Satellite Pro 6070 Slim Select Bay Drive doesn't regonize CD

    I have a problem with my Slim Select Bay DVD. The drive motor is running and the laser unit moves, but it does not recognize the discs until I flip the whole notebook on the right side.Then, after a few attempts with opening and closing of the drive,

  • HP Deskjet Ink Advantage 4645: ePrint does not work

    I bought HP Deskjet Ink Advantage 4645. Start ePrint feature is impossible. I do the following: (1) press (ePrint) buttons at the front. ((2) I get a failure... as ' proxy or Internet to check connection settings). (3) given that I see the work perfe

  • Cannot install drivers etc for HP deskjet F4580 on Windows Vista

    Try to install the software for hp deskjet F4580 get the following: error 'write to c:\windows\installer\1397b.msi. MSI.NET error Fatal 40 "Device Manager there are results for windows 7, but I have VISTA.

  • W500 - win7 64 bit - "fuzzy program."

    Hello! I have upgradet my 4061 series w500 to a 32-bit vista to windows7 64 bit. So far, my biggest problem is that some of my software, for example; iTunes, Spotify, Adobe cs 4 Illustrator and InDesign, Avg free, more... ARE BLURRY! While the rest o

  • SQLite DB in 10 bb

    IAM, develop an application with SQlite as db. Is this possible in bb 10 waterfalls. I have found no useful link where I can start with Sqlite db creation. (Create db tables, how to get data from db, how to set the db data). Can someone help me pleas