Get the device UID (naa) in the data store

Hello

I want to get the UID (naa) device from a data store (VcHostDatastoreSystem).

But I don't seem to find it.

Can someone help me with this?

Kind regards

Jonathan

Look at the code in this post: receive information from scsi to a data store if the data store is known

I used that as a starting point for the following... I put this code in a script task and passed in a VC:HostSystem object named "wfHostObject":

for each (var lun in wfHostObject.configManager.storageSystem.storageDeviceInfo.multipathInfo.lun) {
    for each (var path in lun.path) {
        if (path.state == "active") {
            // Get the mountinfo
            for each (var mount in wfHostObject.configManager.storageSystem.fileSystemVolumeInfo.mountInfo) {
                if (mount.volume.hasOwnProperty("extent")) {
                    for each (var extent in mount.volume.extent) {
                        var tmp = extent.diskName.split(/\./);
                        var regExp = new RegExp(tmp[1],'gi');
                        if (lun.id.match(regExp)) {
                            System.debug("=========== Mount Name: "+mount.volume.name);
  System.debug("Type: "+mount.volume.type);
                            System.debug("Extent diskName: "+extent.diskName);
  System.debug("vStorageSupport: "+mount.vStorageSupport);
  System.debug("---- Mount Info");
  var mountInfo = mount.mountInfo;
  System.debug("AccessMode: "+mountInfo.accessMode);
  System.debug("Accessible: "+mountInfo.accessible);
  System.debug("Inaccessible Reason: "+mountInfo.inaccessibleReason);
  System.debug("Mounted: "+mountInfo.mounted);
  System.debug("Path: "+mountInfo.path);
                        }
                    }
                }
            }
        }
    }
}

Example of output:

[2013-12-12 17:03:57.370] [D] =========== Mount Name: qnap-iscsi
[2013-12-12 17:03:57.370] [D] Type: VMFS
[2013-12-12 17:03:57.370] [D] Extent diskName: naa.60014055dbf2832dbc91d4bacdb356d9
[2013-12-12 17:03:57.370] [D] vStorageSupport: vStorageSupported
[2013-12-12 17:03:57.370] [D] ---- Mount Info
[2013-12-12 17:03:57.374] [D] AccessMode: readWrite
[2013-12-12 17:03:57.374] [D] Accessible: true
[2013-12-12 17:03:57.374] [D] Inaccessible Reason: null
[2013-12-12 17:03:57.374] [D] Mounted: true
[2013-12-12 17:03:57.374] [D] Path: /vmfs/volumes/528cbe4f-6ae388d8-6a9e-14dae927d5bb

Tags: VMware

Similar Questions

  • PowerCLI 5.0 - get the data store and VM information

    I am trying to reach the list of virtual machines and their data warehouses in a specific cluster. It seems that the name of the data store does not... Any ideas?

    PowerCLI C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI > Get-Cluster "NOMCLUSTER" | Get-VM-name * | Get-hard drive | Export-Csv - NoTypeInform

    c:\Scripts\***.csv creation

    Get-Cluster * | Get - VM | Select Name,
    @{N = 'Cluster'; {E = {Get-Cluster - VM $_}}, '

    @{N = "ESX host"; {E = {Get-VMHost - VM $_}}, '

    @{N = "Datastore"; E = {Get-Datastore - VM
    $_}}

  • Gets the data store size

    Hello, I do not know if here is righ place to my question if not please tell me where I can post it.

    I am attemping the information on the data store size by CLI with order tracking.

    c:\Program Files (x 86) \VMware\VMware vSphere CLI\bin > vmkfstools.pl "C:\Prograare\VMware vSphere CLI\Perl\bin\perl.exe" - serve
    queryfs-/ vmfs/volumes/v7ksas17 - vihost jvelnx - vm01.tigre.in

    work of starts but he asks me user and password for the moment that I run.

    I want to move this authentication directly by the CLI only after "ENTER".

    Is it possible? How?

    Thank you

    If you use the vCLI under Windows, you can use the passthroughauth - assuming you connect in Windows system with the same credentials that you would login to your vSphere environment.

    If this isn't the case, you can also specify the user name and password by specifying it only on the same command:

    for example

    vmkfstools.pl - Server [VC] - queryfs/vmfs/volumes/v7ksas17 - vihost jvelnx - vm01.tigre.in - username [USER] - password [COL]

    Also, you can create a session file and then specify that, in this way, you don't need to have your credentials in clear text.

    You can take a look at the additional documentation by auth options here - http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vcli.getstart.doc_50%2Fcli_run_remote.5.3.html

  • get the data store with details of mapped cluster

    Hi with the script below, I am able to do data store maps on which the cluster and its host details... but I'm having multiple LUNS how to write for everyone to get to each store data below the output...

    Get-data store 'testdatastore ' | Get-VMHost | Name,@{N="cluster select '; E={$_| Get-Cluster}}, version

    Output:

    Version of cluster name

    10.0.0.0 testcluster 5.1.0

    Desired output:

    I need the name of output data store because I check for several data stores... can someone help me to get .csv exit foreach datastore as below

    Data name cluster version store

    testdatastore 10.0.0.0 testcluster 5.1.0

    testdatastore 110.0.0.1 testcluster2 5.1.0

    What type of data store?

    I'm asking because there is no mentioned properties (. ExtensionData.Info.Vmfs.Extent) for data warehouses is of type NFS:

    PowerCLI C:\Windows\system32 > ((get-datastore_iscsi*).ExtensionData.Info.Vmfs.Extent). Diskname

    NAA.60a9800042594835695d453439742f53

    PowerCLI C:\Windows\system32 > ((get-datastore_NFS).ExtensionData.Info.Vmfs.Extent). Diskname

    So, you'll need probably something like this:

    Get-Datastore. % { $ds=$_; Get-VMHost - Datastore $ds | Select @{N = 'Data store name'; E = {$ds. Name}},@{N="NAA '; E = {if($ds.) Type - such as 'NFS') {'NFS'} elseif($ds.) Type - as "VMFS") {[String]: join (", ($ds.ExtensionData.Info.Vmfs.Extent|% {$_.}))} DISKNAME}))}}}, name, @{N = 'cluster'; E={$_| {Get-Cluster}}, version}

  • Impossible to disassemble the data store

    Hello

    I am getting below error when I was trying to United Nations set up the data store.

    Call "HostDatastoreSystem.RemoveDatastore" of object "datastoreSystem-15" on VCenter Server failed. ' "

    It seems there are two file inside the data store and I was not able to delete it also. This swap for old file
    models which does not exist now.

    Please let me know how I can remove this file from the shell of ESXi forcefully command so that I could not get the data store.

    Kind regards

    Hakim. B

    Check if it has deployed VM from this template and set the swapfile strategy to stay with the Virtual Machine. See also, if you are able to delete other files vswp with this command:


    rm - rf new model - 8d25d1fe.vswp

  • Script in time of latency list vm e/s and the data store the virtual machine is on

    Hello.  We have a vsphere 5.0 environment and we live a latency of IO heavy.  I'm looking for powercli script will get the latency of i/o for each virtual machine and get the data store name, to what it is now.  We will access our storage on optical fiber.  I'm trying to get a good overview of the latency of IO in a nice view in a csv file.  I found what could be a good basis to https://communities.vmware.com/thread/304827?start=0 & tstart = 0 , but I'm not sure how to get the name of the data store in the table and I think that it is written to the nfs in any case storage.  Thanks in advance for any info\advice!

    Try the next version, it includes the average latency time read/write for the virtual machine and PAHO are / s average for the virtual machine.

    Since the CSV has a row for each data store, the values for the virtual machine are repeated.

    I also added the host name

    $vmName = "VM*"
    
    $stat = "datastore.totalReadLatency.average","datastore.totalWriteLatency.average",  "datastore.numberReadAveraged.average","datastore.numberWriteAveraged.average"$entity = Get-VM -Name $vmName$start = (Get-Date).AddHours(-1)
    
    $dsTab = @{}Get-Datastore | Where {$_.Type -eq "VMFS"} | %{  $key = $_.ExtensionData.Info.Vmfs.Uuid  if(!$dsTab.ContainsKey($key)){    $dsTab.Add($key,$_.Name)  }  else{    "Datastore $($_.Name) with UUID $key already in hash table"  }}
    
    Get-Stat -Entity $entity -Stat $stat -Start $start |Group-Object -Property {$_.Entity.Name} | %{  $vmName = $_.Values[0]  $VMReadLatency = $_.Group |    where {$_.MetricId -eq "datastore.totalReadLatency.average"} |    Measure-Object -Property Value -Average |    Select -ExpandProperty Average  $VMWriteLatency = $_.Group |    where {$_.MetricId -eq "datastore.totalWriteLatency.average"} |    Measure-Object -Property Value -Average |    Select -ExpandProperty Average  $VMReadIOPSAverage = $_.Group |    where {$_.MetricId -eq "datastore.numberReadAveraged.average"} |    Measure-Object -Property Value -Average |    Select -ExpandProperty Average  $VMWriteIOPSAverage = $_.Group |    where {$_.MetricId -eq "datastore.numberWriteAveraged.average"} |    Measure-Object -Property Value -Average |    Select -ExpandProperty Average  $_.Group | Group-Object -Property Instance | %{    New-Object PSObject -Property @{      VM = $vmName      Host = $_.Group[0].Entity.Host.Name      Datastore = $dsTab[$($_.Values[0])]      Start = $start      DSReadLatencyAvg = [math]::Round(($_.Group |           where {$_.MetricId -eq "datastore.totalReadLatency.average"} |          Measure-Object -Property Value -Average |          Select -ExpandProperty Average),2)      DSWriteLatencyAvg = [math]::Round(($_.Group |           where {$_.MetricId -eq "datastore.totalWriteLatency.average"} |          Measure-Object -Property Value -Average |          Select -ExpandProperty Average),2)      VMReadLatencyAvg = [math]::Round($VMReadLatency,2)      VMWriteLatencyAvg = [math]::Round($VMWriteLatency,2)      VMReadIOPSAvg = [math]::Round($VMReadIOPSAverage,2)      VMWriteIOPSAvg = [math]::Round($VMWriteIOPSAverage,2)    }  }} | Export-Csv c:\report.csv -NoTypeInformation -UseCulture
    
  • How do you get the path of the data store or the URL of a virtual disk in vRealize Orchestrator?

    I need to eager zero a virtual disk while building a virtual machine. I found the eagerZeroVirtualDisk_Task() under VcVirtualDiskManager function, which takes in 2 parameters:

    name - (String) the name of the disk, is a path to the data store or a URL pointing to the virtual disk that needs to be inflated.

    Data Center - (VcDatacenter) if the name is a path of data store, the data center for the path of the data store. Not necessary when called directly on ESX. If not specified on a call to VirtualCenter, the name must be a URL.

    How can I get the correct path of data store given the virtual disk? I intend to iterate through the features of the virtual machine to get the disks.

    Thank you!

    Actually figured out how to get the path of the data store, and how a drive zeros. In case it is useful to share the code here:

    var vimHost = vm.vimHost; VM instanceof VCVirtualMachine

    var vDiskMgr = vimHost.virtualDiskManager;

    for each disk

    var features = vm.config.hardware.device;

    for each {(dev var in devices)

    dev.backing contains a lot of useful things...

    If (dev instanceof VcVirtualDisk) {}

    a disc!

    var dsPath = dev.backing.fileName;

    System.log ("path of disk:" + dsPath);

    Data var Center =

    System.getModule('com.vmware.library.vc.datastore').getDatacenterForDatastore (dev.backing.datastore);

    var vcTask = vDiskMgr.eagerZeroVirtualDisk_Task (dsPath, datacenter);

    wait

    var waitResult =

    System.getModule('com.vmware.library.vc.basic').vim3WaitTaskEnd (vcTask, true, 5);

    }

    }

  • How can I get the data view to display the same amount of time I save?

    I use the Sound and Vibration Measurement Suite.  In the data view, I display a graph of time, the power spectrum, the Color Map and the waterfall.  I am also showing strength in numbers group for several bands and doing cutting-edge research.  I record 100 ms of the transient wave.  In the data view, why the temporal plots show several seconds of data?  What determines how much time will appear in the data view?  More important, the power spectrum reflects the power for the entire of several seconds of data displayed?  Same question for power in the values of band and cutting-edge research.  I want to just this data displayed for 100 ms of the wave that I record.  So, how can I get the data displayed (waveforms) and power numbers come only 100 ms of the recorded wave?

    Finally, what is the best way to make account concisely the recorded data?  By slide numbers on the Documentation tab is not concise, because it comes with graphics, etc..  I tried save as ASCII/LVM, but I get a bunch of stuff intermiated I don't care.  Help?

    Hi TimRsandiego,

    SignalExpress is programmed to display graphs with default scales based on the type of action, it's reading. These scales and settings can be changed by right-clicking on the graph, and then select Properties.

    If you are interested to learn more about how to use SignalExpress, I would recommend checking out some demonstrations/tutorials on NI.com. You can find some of these demos at the following location:

    Let me know if you have any other questions.

    Kind regards

  • Can someone show me how to get the data of this vi in four columns in a spreadsheet file.

    I'm trying to get the data into four columns on a worksheet. The data consists of two channels and two measures, a maximum voltage and a voltage after x seconds. I enclose the code. Any help would be great. Thank you.


  • Cannot get the date system. My input format is %d %m %Y and the output is also a format "YYYYMMDD"?

    Hi all

    I'm using Labview 8.5.

    I'm trying to get the date system.

    I use the Format Date/time string in a "%Y %m %d' format.

    The PROBLEM is the Format Date/time string return "YYYYMMDD" only.

    Please see my attachment to see.

    Please help me with this, whenever I encounter this problem it force to reinstall labview program.

    Best thanks!


  • How to get the Date, month, year of the DateTimePicker

    Hi, I am using the DateTimePicker.

    There are several question about this command:

    1. how to get the Date, month and year?

    -With the help of myDateTime.value, I get this string ' Wed May 08 14:45 ICT 2013 '-> I have to manually analyze this? Because I need in format yyyy/mm/dd. Or can set the format of dateTimePicker.value?

    2 format on dateTimePicker self (on the user interface) is d/m/YY, I can't change to another format?

    Thank you

    dateTimePicker.value return a QDateTime not a string.

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__datetimepicker.html#property-value

    See more:

    https://developer.BlackBerry.com/Cascades/reference/QDateTime.html#date

    https://developer.BlackBerry.com/Cascades/reference/QDate.html

    You can get

    day = dateTimePicker.value.date().day()
    month = dateTimePicker.value.date().month()
    year= dateTimePicker.value.date().year()
    dateYYYYMMDD = dateTimePicker.value.date().toString(Qt::ISODate)
    dateYYYYMMDD2 = dateTimePicker.value.date().toString("YYYY/MM/DD")
    dateYYYYMMDD3 = dateTimePicker.value.toString("YYYY/MM/DD")
    
  • Try to get the data of

    Help, please:

    I am trying to get the data from the internet in the Simulator. The browser wirks fine and I am able to navigate... but I'm nt get any :-(

    Here is my code:

    String url =

    "http://www * & format = json;

    C = HttpConnection

    null;

    InputStream is =

    null;

    int rc;

    try {

    c = (HttpConnection) Connector.open (url);

    Get the response code is open the connection,

    Send the request and read HTTP response headers.

    The headers are stored until asked.

    RC = c.getResponseCode ();

    if (rc! = HttpConnection.HTTP_OK) {

    throw new IOException ("HTTP response code:" + rc);

    }

    is = c.openInputStream ();

    Get the ContentType

    The string of type = c.getType ();

    The length and process data

    int len = (int) c.getLength ();

    if (len > 0) {

    int actual = 0;

    int BytesRead = 0;

    byte data = newbyte[len];

    while ((bytesread! = len) & (real! = - 1)) {

    real = is.read (data, bytesread, len - bytesread);

    bytesRead += real;

    }

    }

    else {

    int ch;

    while ((ch = is.read (())! = - 1). {

    }

    }

    }

    catch (E ClassCastException) {

    throw new IllegalArgumentException ("not a HTTP URL");

    }

    finally {

    if (is! = null)

    is. Close();

    if (c! = null)

    c.Close ();

    }

    Are you runing the MDS Simulator? It must be upon the connection form the Simulator, unless you specifically request a direct connection by adding «;» deviceside = true' to your URL.

  • I lost the password I gave to a drive using Bitlocker in Windows 7, how can I return it or I can get the data in the back of the player?

    Hello

    I lost the password I gave to a drive using Bitlocker in Windows 7, how can I return it or I can get the data in the back of the player? Data are very important because by my studies are concerned. Help, please. Thank you!

    Hello

    I lost the password I gave to a drive using Bitlocker in Windows 7, how can I return it or I can get the data in the back of the player? Data are very important because by my studies are concerned. Help, please. Thank you!
    People like you that encryption data with bitlocker do it because they want their data accessible only by those who have the certificate. The sad news for you is that you have made a good choice with BitLocker: unless you have the certificate, your data remains inaccessible. There is no backdoor. If he had then BitLocker would be useless.
  • How can I get the date and time function to appear as a tile

    How can I get the date and time function to appear as a tile

    How can I get the date and time function to appear as a tile

    WIN8 are delivered with this tile/app.  The only way to display the time is to launch the charm bar (Win - key + C) or mouse over to the right up/down.  That said go to the Windows store... There are several free applications that display the time / date as a live tile.  Good luck.

  • < dateformat: create, get the date in en_GB, es_ES instance

    Hello

    I don't know if it's a bug or normal behavior:

    I get the date in en_GB, but I ask the date to es_ES, the snippet of code below:

    < ics:if condition =' < % = ics. GetList ("FechaBlog")! = null & & ics. GetList("FechaBlog").hasData () % > ' >

    < ics:then >

    < ics:listget listname =' < % = "FechaBlog" > "fieldname = 'value' output ="Cash out"/ >"

    < local: create varname = "currLocale" nomlocale = "es_ES" / >

    < dateformat: create name = datestyle 'PostDateFormat' = 'average' timezoneid = "Europe/Madrid" locale = "currLocale" / >

    < name dateformat:getdate = "PostDateFormat" value = "< % = ics." GetVar ("cash") % > ' valuetype = "jdbcdate' varname ="FormattedPostDate"/ >

    < / ics:then >

    < / ics:if >

    22-may-2015

    I expect to get: 22 -mayo- 2015; But if change the 'average' datestyle to "long", I am getting:


    2015 22 Mayo


    as expected, in es_ES.

    This is the normal behavior? WCS 11.1.1.8

    Kind regards

    Hello Jorgitoito,

    This is how Java has shaped the date in Spanish. It is not specific to the WebCenter Sites.

    You can give it a try with this simple Java code:

    java.util.Locale locale = new java.util.Locale("es", "ES");
     java.text.DateFormat mediumFormat   = java.text.DateFormat.getDateInstance(java.text.DateFormat.MEDIUM, locale);
    System.out.println(mediumFormat.format(new java.util.Date()));
    java.text.DateFormat longFormat   = java.text.DateFormat.getDateInstance(java.text.DateFormat.LONG, locale);
    System.out.println(longFormat.format(new java.util.Date()));
    

    The results I got:

    27-May-2015

    2015 27 Mayo

    I suspect that 27-May-2015 here is not in English; It is simply the first three letters of mayo.

    Kind regards

    Stephan.

Maybe you are looking for