Maintenance of the data store: umount CF datastore?

Hello.

We have a cluster of ESX (vSphere 4) with several warehouses (NFS and Fibre Channel) accessible from all ESX hosts and want to perform maintenance on one of the CF data stores. We do not want to stop all the ESX Cluster, since some of the VMS are in production use. Thus, one of the ESX hosts must be running during maintenance of the data store, with the VMs in storage migrated to a NFS data store to market.

So far, it's simple: VMotion and Storage VMotion can be used to achieve a situation where all important machines are on the good ESX host, with their storage on the NFS datastore. The ESX host with virtual machines without importance will be stopped (after their virtual machines, of course).

The crucial question is: How can we we safely power down the data store FC for maintenance? We have to somehow disconnect, umount, or cancel the configuration of the data store CF on the ESX host running? Or is it just to turn off the CF data store?

Concerning

Dominik

This is a VMware KB detailed maintenance with unpresenting a LUN from a host - http://kb.vmware.com/kb/1015084 local put bare (using esxcli) host is necessary otherwise you will have a few interesting emails in your vmkernel logs

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at: http://www.virtuallyghetto.com/

Twitter: @lamw

repository scripts vGhetto

Introduction to the vMA (tips/tricks)

Getting started with vSphere SDK for Perl

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

VMware developer community

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

Tags: VMware

Similar Questions

  • Cancellation of the assignment and reassign the data store by using different LUNS that datastore has not appeared.

    Hi all

    I have a data store after vdisk1 I have not assigned the vdisk to data store and reread the esxserver, the data store has disappeared.

    Again, I assigned the vdisk using the same number of logical unit as before and reread the esxserver, datastore appeared again return.

    But if I use a different assignment vdisk lun and on a new analysis of data store does not appear.

    Can someone tell me if the LUN must be even to see the store of data back again.

    If so why. ?

    Is there a vmware documentation to substantiate this claim.

    concerning

    Neela

    What do you mean by vdisk1?  The data store are stored as metadata on the LUN, when is formatted VMFS.  If you remove the LUN the VMFS is sitting on, then Yes, the data store will disappear.  If you only remove the vmdk who lives on this data store, then no, the data store must remain as it is, and you should be able to move the vmdk on the data store as needed.

    -KjB

    VMware vExpert

  • Machine virtual IOPS / s report, how to display the name of the data store?

    Hi guys

    I am new to the Foglight community, this is a great tool, and I learn a lot.

    Currently I am trying to create a simple table that will show me metric of my VMware environment: Virtual Machine name, Datastore IOPS and data store.

    However I can't find how to include data store name in the table, because it is not a measure of the Virtual Machine. I think I need to expand the scope of my table to include VMware Datastore, but I don't know how to do this.

    -Mark

    Check the options available it seems that it can be done with WCF (the frame behind the Foglight dashboards).  We recommend generally customers who plan to build views WCF take adequate training or our PSO people engaged in it.

    In any case I can help show a quick example of how it's done.

    Please try this on a local/test server.

    Go to Configuration > definition >

    Make sure that you are in my definition, and click the icon to add a view. then choose from the tables and trees - oriented line table

    Give a name to the view, go public and make a portlet/reportlet and apply

    Switch to the configuration tab and click the change for the lines and choose a query

    Under query, expand the VMware and scroll down

    Until you can select the query for virtual machines

    And press the set button.

    Your view should look like this

    Now you must select the columns.

    Each column has a value you can edit and there is a button + to add additional columns.

    Lets start with the name of the virtual machine - click on the button to change to your default column and choose the context.

    Click on the drop down menu to enter key and choose the current line (virtual vmware machine)

    Click on the drop down menu to access path and scroll down until you can select the name and then click on set.

    You have created a table that lists the names of all virtual machines.

    You can click on save. and then click test, choose a time and click the result. A new window will open a show the list you of virtual machines.
    From here you can continue to add additional columns, each time choosing the key entry in the current line and the path to the metric/string to display.

    For example, the name of the data store.
    I change the module

    Click the configuration tab and click the icon to add a column

    For the column value, that I chose defined context once again, the key input is the current row and for the path, I expand the node for the data store

    And scroll until I see the Proprietename

    If you save and test you will see the result

    Keep adding columns and the data you want, notice that you have arrows that allow you to control the order of the columns.

    Note that you can click Show advanced configuration properties

    This will give you the opportunity to see the properties of the extra table, such as header - giving you the opportunity to give a more meaningful name (name of the data store, the name of the virtual machine, etc.) to the column header.

    You can now go you drag and drop the table edge/report and under my eyes, you will see your new view

    Drop it in the main view

    I hope this has given you the starting point to build this table.

    As I said, I strongly recommend going through our WCF training if you plan build more custom views or hire software Dell PSO Organisation to help build you views that correspond to your need.

    Best regards

    Golan

  • VDP: Cannot access the data store

    Hello!

    I have a problem.

    Every day I see error for one of my servers in "reports":

    2016-07 - 05T 06: 00:47.971 + error 06:00-[7F2F3FA5E700] [Originator@6876 = transport sub]

    Cannot use hotadd mode to access the FileSrv1/FileSrv1_1.vmdk [Cisco2-datastore]: can't get using this method.

    (Mounting VM using vm-3198 transport hotadd failed: cannot access the data store for one of the drives of the Machine virtual FileSrv1..)

    At the same time, I havn't this error for the other servers.

    "FileSrv1" has not has installed "VMWare tools". After the instalation "VMWare tools" on this server, the problem is resolved.

  • Install centos6.4 of the data store

    Hello

    Does anyone know how can I install centos 6.4 on vm. I have the file iso centos on centos6.4_2.iso and vmware server /vmfs/volumes/isos/centos6.4_1.iso

    I selected vm - material - cd/dvd-> iso datastore stressed the centos6.4 - 1.ISO, then connect to option is under

    When I start the VM in a single step, he asks where is the binary located [cd/dvd, nfs, hard drive mounting and url] how can I tell the virtual machine it needs to install from the data store [which is on vmware server 5.x]

    -Sagar

    Hello

    during the installation process will be o.s. installed from cd/DVD, as in the physical environment and it is not necessary specify a data store location. I think you may have an invalid ISO. Check its integrity...

  • Script to get VM list and count on the data store

    Hi all

    I have a script of lining that gives me the number of virtual machines on the data store, I was looking for both number of virtual machines more VM names too.

    Get-Datastore. Select Name, @{N = "NumVM"; E={@($_ | Get - VM). County}} | Sort name | Export-csv-path "C:\Users\userA\Desktop\Cluster_Host_Report\datastorevmcount.csv".

    the above script gives not only. or the number of virtual machines on the datastore in VC, can we get that all virtual machines are there on the VC data store.

    Thanks in advance a ton.

    The ForEach loop do not place anything on the pipeline, you can fix this with the call operator (and)

    & {{foreach ($ds in Get-data store)

    Get - VM - Datastore $ds |

    Select Name,

    @{N = "Datastore"; E = {$ds. Name}},

    @{N = "VM on the data store"; E = {$ds. ExtensionData.Vm.Count}}

    }} | Export Csv report.csv - NoTypeInformation - UseCulture

  • Host, Cluster and Details of the data store

    Hello

    Please ask for assistance to handset scripts in the attached text file. We have a requirement to find below a collection of VM VM details. the names are in a text file.

    VMName VMHost, ClusterName, location of data store.

    Also, we need the list is sorted with VMNames

    Thanks in advance

    Rajesh

    Is it possible to use autosize, as the data store long filenames trunctes.

    Try Autosize

    Get - VM (Get-content c:\temp\vms.txt). Select-Object - property @{Name = "VMName"; Expression = {$_.} Name}},VMHost,@{name='ClusterName'; Expression = {$_.} VMHost.Parent}}, @{"Name" = "Datastore"; expression = {($_.)} DatastoreIDList | %{(Get-View-nom de la propriété-Id $_). Name}) - join ","}} | FT - AutoSize

    Try packing?

    Get - VM (Get-content c:\temp\vms.txt). Select-Object - property @{Name = "VMName"; Expression = {$_.} Name}},VMHost,@{name='ClusterName'; Expression = {$_.} VMHost.Parent}}, @{"Name" = "Datastore"; expression = {($_.)} DatastoreIDList | %{(Get-View-nom de la propriété-Id $_). Name}) - join ","}} | FT-Wrap

    If possible, can we use tri-objet with the names of virtual machine?

    Yes, just direct to Sort-Object

    Get - VM (Get-content c:\temp\vms.txt). Select-Object - property @{Name = "VMName"; Expression = {$_.} Name}},VMHost,@{name='ClusterName'; Expression = {$_.} VMHost.Parent}}, @{"Name" = "Datastore"; expression = {($_.)} DatastoreIDList | %{(Get-View-nom de la propriété-Id $_). Name}) - join ","}} | VMName sorting

    Also, can we use export-csv to export put it to Excel?

    Yes, just direct to Export-CSV

    Get - VM (Get-content c:\temp\vms.txt). Select-Object - property @{Name = "VMName"; Expression = {$_.} Name}},VMHost,@{name='ClusterName'; Expression = {$_.} VMHost.Parent}}, @{"Name" = "Datastore"; expression = {($_.)} DatastoreIDList | %{(Get-View-nom de la propriété-Id $_). Name}) - join ","}} | Export-CSV - NoTypeInformation C:\temp\VMExport.csv

  • 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);

    }

    }

  • Unable to download the file to the data store

    Hello

    Can someone help me on this, I'm trying to download a file to the local data store on the esxi host, but its failure

    used as below

    $ds = get-data center 'test ' | Get-file "CISCO UCS B200 M3 | Get-VMHost | Get-Datastore "datastore."

    $destination = "\".

    $source = "D:\All Cisco\ENICandFNIC readers for UCSver2.2.C\updated drivers" - this folder

    New-PSDrive-location $ds - name VimDatastore - PSProvider ds-root $destination

    Set-Location ds:------.

    Copy-DatastoreItem-point $source - Destination $destination

    What error messages you get? When I run your script, only an empty folder is performed on the data store. When you add "-recurse" it also copies child items (files and directories)

    $ds = Get-Datacenter "test" |Get-Folder "CISCO UCS B200 M3"|Get-VMHost |Get-Datastore "datastore*"
    
    $destination = "\"
    
    $source = 'D:\Test ' # -- this folder
    
    New-PSDrive -Location $ds -Name ds -PSProvider VimDatastore -Root $destination
    
    Set-Location ds:\ New-PSDrive -Location $ds -Name ds -PSProvider VimDatastore -Root $destination
    
    Copy-DatastoreItem -Item $source -Destination $destination -Recurse
    

    But it's only 1 data store, if I understand your example, you are trying to copy to different data stores. This could easily be done like this:

    $DS = Get-Datacenter "test" |Get-Folder "CISCO UCS B200 M3"|Get-VMHost |Get-Datastore "datastore*" | select name,DatastoreBrowserPath
    
    $source = 'D:\Test ' # -- this folder
    
     foreach ($datastore in $ds){
    
    Copy-DatastoreItem -Item $source -Destination  $datastore.DatastoreBrowserPath -Recurse
    
    }
    
  • Name of device for the data store list

    Need help with this simple script

    $datastores = get-Datastore-location "CXXV. Where-Object {$_.ExtensionData.Info.GetType ().} Name - eq "VmfsDatastoreInfo"}

    $myColCurrent = @)

    ForEach ($store in $datastores)

    {

    $myObj = "" | Select-Object Name, devicename

    $myObj.Name = $store.name

    Write-Host $myObj.Name

    $myObj.devicename = $store.ExtensionData.Info.Vmfs.Extent.DiskName

    Write-Host $myObj.devicename

    the name of the data store is writtenl properly but the devicename is empty and get this warning:

    WARNING: The 'Accessible' type of data store property is obsolete. Use the property 'State '.

    Strange thing is that the Script works lab powercli linking the vCenter lab. But gives the error in the production powecli server to vcenter prod.  powercli and vcenter server versions are the same.

    Help is greatly appreciated

    The extended property is an array.

    Try to change this line

    $myObj.devicename = $store.ExtensionData.Info.Vmfs.Extent.DiskName

    in this

    $myObj.devicename = [string]: join (",",($store.ExtensionData.Info.Vmfs.Extent |) %{$_. DiskName}))

    You can safely ignore the warning messages, or may disable them with the Set-PowerCLIConfiguration cmdlet and the DisplayDeprecationWarnings switch.

  • Add hard drive VCSA 5.5 to the data store

    I do the jump for especially vsphere client of web & VCSA 5.5 to change settings on a virtual machine on a host in a data center. The host has 2 data warehouses. The virtual machine has 1 hard disk assigned to datastore1. I go to add HDD to VM but can't find where datastore2 go through them.

    Non-Web client Vsphere 5.1 has allowed the addition of material. The wizard showed a location-> specify a cluster datastore or datstore. And then go to datastore2.

    If you have any information leading to the resolution of this problem, I got thank you.

    PatrickAZ

    Patrick,

    First, to add a new disk to a computer virtual, the data store where you create the disc must be visible to the ESXi host where VM works... If this is the case, follow the procedure in documentation ESXi: Add a new hard drive in a VM in the Web Client vSphere

  • Dell virtual disk are larger. You want to increase the size of the data store.

    Hello

    I started the implementation of a server ESXi 5.5 Update 1 this week. I didn't know Dell shipped the server with two virtual disks instead of one. I realized this _apres_ that I had already created the data store and setup a few virtual machines to the breast. I called Dell who sent specific instructions to increase the removal of the second (empty) virtual disk and add it to the main. In the end, I increased the single VD from 2 TB to 3 TB and I want to give the remaining space in my store of data.

    I tried to follow the article here that explains how to do this via the CLI.

    Well, he did not altogether. Fortunately, I was able to recover my datastore my setting start and end sectors to their original numbers. But I'm still left with this almost 1 TB of space that I can not attribute to the data store. After that I reread storage adapters in the client, the new Dell disk size resulted under measurement devices. Click on "increase...". ", generates the following error which led me on the way to the CLI method:

    Call "HostDatastoreSystem.QueryAvailableDisksForVmfs" to object "ha-datastoresystem" on ESXi '[myservername]' failed.

    I will paste my notes that I took everything by jobs. Things have exploded the rails when I put 4 partition size to the largest size. Any help, please?

    ---

    I use that as a guide:

    http://KB.VMware.com/selfservice/search.do?cmd=displayKC & docType = kc & docTypeID = DT_KB_1_1 & externalId = 2002461


    1 use start hardware device management tools to increase the capacity of additional disk to the device. For more information, commit your hardware provider.

    This has been done. The new size of the virtual disk is 2791,88 GB (TB 2,79188)


    2. open a console to the ESXi host.

    Pretty simple.


    3. get the DeviceID for the data store to change.

    ~ # vmkfstools Pei "/ vmfs/volumes/datastore1 / '.

    System file VMFS-5, 60 extending on 1 partition.

    File system label (if applicable): datastore1

    Mode: public

    Capacity 1971926859776 (blocks of files 1880576 * 1048576), 1042688245760 (994385 blocks) prevail, max size of the 69201586814976 file

    UUID: 534e5121 - 4450-19dc-f8bc1238e18a 260d

    Partitions split (on 'lvm'):

    NAA.6c81f660ef0d23001ad809071096d28a:4


    A couple of things to note:

    a. the device for Datastore1 ID is: naa.6c81f660ef0d23001ad809071096d28a

    b. the number of Partition on the disk is: 4 ' [...]: 4 "»

    c. the prefix, "naa," means "Network address authority" the number immediately after is a single logical unit number.

    4. Enter the amount of disk space available on the data store.

    ~ # df h

    Size of filesystem used available use % mounted on

    VMFS-5 1. 8T 865.4 G 971,1 G 47% / vmfs/volumes/datastore1


    5 team of the device identifier, to identify the existing partitions on the device by using the partedUtil command.

    ~ # partedUtil get ' / vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a '.

    364456 255 63 5854986240

    1 63 80324 222 0

    2 80325 8466884 6 0

    3 8466885 13709764 252 0

    4 13711360 3865468766 251 0

    ~ #


    According to the table in article KB

    4 13711360 3865468766 251 0 - primary #4, type 251 = 0xFB = VMFS, 13711360-3865468766 areas

    | |        |          |   |

    | |        |          |   \---attribut

    | |        |          \---type

    | |        \---se finishing sector

    | \---a starting from sector

    partition \---Numero


    Also note how the number of section start the old end sector number is + 1.


    6 identify the partitions that need to be resized and the size of the space to use.

    We want to resize partition 4. I don't really understand the last part of this sentence, however. Read more.


    7 the number of sector end you want for the target data store VMFS partitions. To use all out at the end of the disc space, remove 1 of the size of the disk in the areas as described in step 5 in order to get the last usable area.

    ESXi 5.x has a command to do this:

    ~ # partedUtil getUsableSectors "/ vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a".

    1 5854986239

    This means that we want 4 Partition of "naa.6c81f660ef0d23001ad809071096d28a" to be:

    13711360 - 5854986239 (i.e. the end of the disc)


    8 resize the partition containing the target VMFS Datastore using the command partedUtil, specifying the original existing partition and the desired end sector:

    Using the above information, our command is:

    resize # partedUtil ' / vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a ' 4 13711360 5854986239


    9 step 8, the partedUtil command can report the warning:

    He did not. Displacement.


    10. the tables of partitions have been adjusted, but the VMFS data within the partition store is always the same size. Now there is an empty space in the partition where the VMFS data store can be grown.


    11 launch this v vmkfstools command to perform a refresh for VMFS volumes.

    Fact.


    12 reach the VMFS Datastore in the new space using the command - growfs vmkfstools, specifying the partition containing the VMFS Datastore target twice.

    vmkfstools - growfs ' / vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a:4 ' ' / vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a:4 '.


    It did not work. I got an error:

    / vmfs/volumes # vmkfstools - growfs ' / vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a:4 ' /vmfs/devices/disks/naa.6c81f660ef0d «»

    23001ad809071096d28a:4 ".

    Cannot get device head way /dev/disks/naa.6c81f660ef0d23001ad809071096d28a:4 information


    Also the partition was very different to what I asked:

    ~ # partedUtil get ' / vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a '.

    364456 255 63 5854986240

    1 63 80324 222 0

    2 80325 8466884 6 0

    3 8466885 13709764 252 0

    4 13711360 1560018942 251 0


    I fixed it by running these commands:

    ~ # partedUtil resize ' / vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a ' 4 13711360 3865468766

    ~ # vmkfstools v

    ~ # partedUtil get ' / vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a '.

    364456 255 63 5854986240

    1 63 80324 222 0

    2 80325 8466884 6 0

    3 8466885 13709764 252 0

    4 13711360 3865468766 251 0

    Update:

    Since it was such a new machine, not in active production, we have safeguarded the VMs management off the ESXi host. Then flattened the virtual disk, recreated, and then created a store of data with the right size. (TPG this time, naturally.) We put the management of virtual machines on the data store. For Windows virtual machines, we have restored the using AppAssure. Everything is ok now.

    Need to add a new item to the list of punch: check what Dell has done the configuration of the virtual disks. :-)

  • Local data store has disappeared from the data store window (necessary emergency aid)

    Dear team,

    I m facing a very strange problem, all of a sudden one of the local ESX datastore disappeared thereafter are full details we have encountered/noticed.

    A local data store disappeared from the data store window.able to see this data store to add storage Wizard, which allows us to format the same.

    * If we take a session putty from here we can see and browse this store of data without problem.

    * Virtual computers that are running on this data store work as well (all files are accessible / VM is accessible on the network)

    * Unable to take backup image do error "the object has already been deleted or was not completely created.

    * Not able to take a «cannot complete the copy file... network» clone »

    Getting from newspapers in vmkernel:

    (14 dec 17:11:39 localhost vmkernel: 0:01:55:28.677 cpu1:4097) ScsiDeviceIO: 747: command 0 x 28-the device 'mpx.vmhba1:C0:T1:L0' failed, the data of sense H:0 x D:0 x 2 P:0 x 0 0 valid: 0 x 4 0 44 x 0 x 0.

    (14 dec 17:11:39 localhost vmkernel: 0:01:55:28.677 cpu1:4097) ScsiDeviceToken: 293: Sync IO 0 x 28-the device 'mpx.vmhba1:C0:T1:L0' failed: error/o H:0 x D:0 x P:0 x 0 2 0 valid sense data: 0x4 0 44 x 0 x 0.

    (14 dec 17:11:39 localhost vmkernel: 0:01:55:28.677 cpu6:4110) capability3: 5354: Sync READ error ('. fbb.sf') (ioFlags: 8): i/o error

    Need your help urgently to solve the same.

    concerning

    Mr. VMware

    Dear all,

    We have enclosed a case at VMware, please find their findings on the same.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    After the webex session, we just had, I discovered the root cause of the problem reported to an underlying problem on the block device (the logical drive, or a problem on the Board) presented to accommodate the data in question store successfully.

    In short, whenever we try to do raw reading from the disk (from sector 0), the same always fail when we reach the 30932992 bytes (31 MB) brand with an IO error (which is consistent, he is always on this region of the disc that read operations fail, no more, no less). This result can be seen, even if no partition is in the disk (using if = / dev/sdb instead of/dev/sdb1 with dd) and even after zeroing on all sectors (if dd \u003d/dev/zero of = / dev/sdb). Strangely, read operations work fine (as he writes zeros of random data) throughout the entire disk. Keep in mind that the tests I did with no VMware tools (I used almost only dd for these operations), which prohibits certainly a VMware problem (in fact, if you were to try to start the server with a Linux live CD and run the same tests that I did, you would see the same behavior).

    I know that there is no report of material of any bad behavior on the table, but data collected with our tests today completely invalid who. The next step is for you to take this to the server provider to check for problems on the table or discs, because they are there and they are the reason for the problem you reported initially.

    Please let me know if you have other questions about it.

    Thank you

    -

    David Meireles

    Technical Support Engineer

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Now we have blocked a case from the hardware vendor, to see what the next move will be.

    concerning

    Mr. VMware

  • Show active paths by the data store for each host

    I'm looking for a PowerCLI script that displays by cluster, by ESXi host how active paths has a data store. The output should look like:

    Paths of Active host data store

    VMFS-01 ESXi01 2

    Thank you

    Ivo

    Try this one, it shows the actual number of "active" paths by the data store.

    foreach($esx in Get-VMHost){  $hss = Get-View $esx.Extensiondata.ConfigManager.StorageSystem
    
      $lunTab = @{}  $hss.StorageDeviceInfo.ScsiLun | %{    $lunTab.Add($_.Key,$_.CanonicalName)  }  $pathTab = @{}  $hss.StorageDeviceInfo.MultipathInfo.Lun | %{    $pathState = @($_.Path | Group-Object -Property PathState |    where {$_.Name -eq "active"} | Select -ExpandProperty Group)
    
        if($pathTab.ContainsKey($_.Lun)){      $pathTab[$_.Lun] += $pathState.Count    }    else{      $pathTab.Add($lunTab[$_.Lun],$pathState.Count)    }  }
    
      foreach($mount in ($hss.FileSystemVolumeInfo.MountInfo | where {$_.Volume.Type -eq "VMFS"})){    $mount.Volume.Extent |    Select @{N="VMHost";E={$esx.Name}},      @{N="Datastore";E={$mount.Volume.Name}},      @{N="LUN";E={$_.DiskName}},      @{N="Active Paths";E={$pathTab[$_.DiskName]}}  } } 
    
  • 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
    $_}}

Maybe you are looking for