Help with report VM (name MemoryMB NumCPU, data store, total size of the disk)

I currently have a script (listed below) to the CR of query for each virtual computer and their allocated disks. The problem with the script is that when he meets a VM with disks on several data only stores the first data store is listed in the report. However, the total size of the disk is correct.

Any ideas to fix this?

$datastoreExp = @{N = "Datastore"; E = {($_ | get-datastore | select-object-1 premier).} Name}}

$diskSizeExp = @{N = "Total disk"; E = {($_ | get-harddisk | mesure-objet-propriété CapacityKB-somme).} Sum}}

Get - vm | Select the name MemoryMB NUmCPU, $datastoreExp, $diskSizeExp | Sort - property datastore, "Total disc | Export-Csv C:\Scripts\Reports\chargeback.csv

I thought that was what you wanted, judging by your examples.

In any case, no problem, the following should do the trick.


$dsRegEx = [regex]"\[(\w+)\]"
$report = @()
get-vm | % {
     $vm = $_
    $vm.HardDisks | %{
          $row = "" | Select Name,MemoryMB,NUmCPU, Datastore, "Total Disk (Gb)"
          $row.Name = $vm.Name
          $row.MemoryMb = $vm.MemoryMb
          $row.NumCpu = $vm.NumCpu
          $row.Datastore = $dsRegEx.Match($_.Filename).Groups[1].Value
          $row.{Total Disk (Gb)} = "{0:N}" -f ($_.CapacityKB / 1Mb)
          $report += $row
     }
}
$report | sort -property Name, datastore,"Total Disk" |Export-Csv "C:\chargeback.csv" -noTypeInformation

Since there are sometimes problems with the display of the hooks I have attached the script.

Tags: VMware

Similar Questions

  • Script of VM inventory for VM name with the location, the name of the Cluster and data storing total size and free space left in DS.

    Hello

    I wanted to collect script inventory VM VM name with location, name of the Cluster and data store total size and free space left in Datastore.I have script but his mistake of shows during its execution. Any help on this will be apreciated.

    Thank you

    VMG

    Error: -.

    Get-view: could not validate the argument on the parameter "VIObject". The argument is null or empty. Provide an argument that is not null or empty, and then try
    the command again.
    E:\script\VM-DS-cluster.ps1:7 tank: 20
    + $esx = get-view < < < < $vm. Runtime.Host - name of the Parent property
    + CategoryInfo: InvalidData: (:)) [Get-view], ParameterBindingValidationException)
    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    Get-view: could not validate the argument on the parameter "VIObject". The argument is null or empty. Provide an argument that is not null or empty, and then try
    the command again.
    E:\script\VM-DS-cluster.ps1:8 tank: 24
    + $cluster = get-view < < < < $esx. Parent - the name of the property
    + CategoryInfo: InvalidData: (:)) [Get-view], ParameterBindingValidationException)
    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    Get-view: could not validate the argument on the parameter "VIObject". The argument is null or empty. Provide an argument that is not null or empty, and then try
    the command again.
    E:\script\VM-DS-cluster.ps1:9 tank: 24
    + += get-view $report < < < < $vm. Store data-name of the property, summary |
    + CategoryInfo: InvalidData: (:)) [Get-view], ParameterBindingValidationException)
    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    It seems that your copy/paste lost some.

    I have attached the script

  • Change the name of a data store?

    Hello

    Is it possible to change the display name of a data store NFS I have 8 nodes in a cluster connected to?  This is for aesthetic reasons only - consistency of the naming convention.  Just curious, if I renamed the store of data for data store in vSphere VCenter, did change the display name for each host?  Or I have to change the display name to each host using the "hosts and Clusters".  Just curious to know if I can do that, while virtual machines are run with no negative effect... or should I stop literally all of the virtual machines to do this.

    Thanks in advance.

    Hello

    You can change the name of data warehouses (NFS, iSCSI, FC etc.) at any time and without any negative effects.

    Just right click, rename it to your heart's content!

    See you soon,.

  • find the total size of the VM on specific data warehouses

    Hello

    PowerCLI guru, I'm not...

    I'm just using the following to get the total size of the virtual machine.

    Get-vmhost < host name, host name >. get - vm | Select-Object Name, UsedSpaceGB

    The problem is some of these VMS are on 15 k drive and some are over 10 k drive, is there a way to add the data store name each virtual machine is located at the exit. Seeing the data store name that I can know easily what typre of disc it is average.

    Currently, she is just out

    vmname size

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

    ABC 123

    Here you are:

    vmname datastore vmsize

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

    ABC xyz - 567 123

    Thank you

    The following PowerCLI script you will show the name, data warehouses and space used for all virtual machines:

    Get-VM | Select-Object -Property Name,
    @{Name="Datastores";Expression={
      [string]::Join(',',($_.DatastoreIDList |
        ForEach-Object { Get-View -id $_ |
        ForEach-Object {$_.Name}}) )
    }},
    UsedSpaceGB
    

    Best regards, Robert

  • VM shows this in the NFS data store after passed to the vmfs data store

    Hello

    (1) create a virtual machine using NFS datastore

    (2) had created a few snapshots

    (3) to migrate this virtual machine from the data to the local VMfs store

    (4) all the files are moved to the defined vmfs datastore

    (5) storage > > nfs_datastore > > objects > > VM > > vm is present

    (6) but when did change the setting of this VM, vm is present on the data store local vmfs

    The .vmsn file contains binary data text, so you better not change it manually. The purpose of these files is to be able to return to his instant partner. Depending on the configuration of virtual machines in time you created the snapshot, the virtual machine may require access to the old data store to access the files and folders in there when you return to this snapshot.

    André

  • Very slow Macbook Pro (2012), please help with report EtreCheck

    Hi all

    My Macbook runs very slowly, I tried a number of things suggested online but none worked. I recently went to a repair shop and they suggested it could be to do with the dataflex (not sure if this was exactly, but I remember it sounding similar.) They described as a hard drive to another internal component connection, sorry for the inaccuracy.) I have me am replaced, but this did not help either.

    I downloaded the software EtreCheck and I was wondering if someone could help me to make light of the report on possible solutions? I have the feeling that it could be the hard drive needs to be replaced, but have no evidence of that. Verification has been run for the problem of "Beachballing" and got the sub report, please let me know if more info would be helpful. I hope it's telling in a way!

    Thank you for the pointers.

    EtreCheck version: 2.7.8 (238)

    Report generated 2016-01-26 22:56:56

    Download EtreCheck from http://etrecheck.com

    Duration 10:23

    Performance: Poor

    Click the [Support] links to help with non-Apple products.

    Click [details] for more information on this line.

    Problem: Beachballing

    Hardware Information:

    MacBook Pro (13-inch, mid-2012)

    [Data sheet] - [User Guide] - [Warranty & Service]

    MacBook Pro - model: MacBookPro9, 2

    1 2.5 GHz Intel Core i5 CPU: 2 strands

    4 GB of RAM expandable - [Instructions]

    BANK 0/DIMM0

    OK 2 GB DDR3 1600 MHz

    BANK 1/DIMM0

    OK 2 GB DDR3 1600 MHz

    Bluetooth: Good - transfer/Airdrop2 taken in charge

    Wireless: en1: 802.11 a/b/g/n

    Battery: Health = Normal - Cycle count = 420 - SN = 9G22603YVD3MB

    Video information:

    Graphics Intel HD 4000

    Color LCD 1280 x 800

    Software:

    OS X Mavericks 10.9.5 (13F34) - since startup time: less than an hour

    Disc information:

    Disk0 APPLE drive HARD TOSHIBA MK5065GSXF: (500,11 GB) (rotation)

    EFI (disk0s1) : 210 MB

    Macintosh HD (disk0s2) /: 499,25 go-go (248,48 free)

    HD (disk0s3) [recovery] recovery: 650 MB

    OPTIARC DVD RW AD - 5970H)

    USB information:

    Apple Inc. FaceTime HD camera (built-in)

    Apple Inc. Apple keyboard / Trackpad

    Computer, Inc. Apple IR receiver.

    Apple Inc. BRCM20702 hub.

    Apple Inc. Bluetooth USB host controller.

    Lightning information:

    Apple Inc. Thunderbolt_bus.

    Guardian:

    Mac App Store and identified developers

    Launch system officers:

    [failure] com.apple.maspushagent.plist [details]

    Launch system demons:

    com.Apple.Security.syspolicy.plist [failure]

    Launch officers:

    [loading] com.google.keystone.agent.plist [Support]

    [loading] com.oracle.java.Java - Updater.plist [Support]

    Launch demons:

    [loading] com.adobe.fpsaud.plist [Support]

    [loading] com.google.keystone.daemon.plist [Support]

    [loading] com.oracle.java.Helper - Tool.plist [Support]

    Items in user login:

    iTunesHelper Application (/ Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)

    Other applications:

    [ongoing] com.etresoft.EtreCheck.85920

    Plug-ins Internet:

    FlashPlayer - 10.6: Version: 19.0.0.226 - SDK 10.6 [Support]

    QuickTime Plugin: Version: 7.7.3

    Flash Player: Version: 19.0.0.226 - SDK 10.6 obsolete! Update

    Default browser: Version: 537 - SDK 10.9

    o1dbrowserplugin: Version: 5.41.0.0 - SDK 10.8 [Support]

    googletalkbrowserplugin: Version: 5.41.0.0 - SDK 10.8 [Support]

    JavaAppletPlugin: Version: 25 check the version of Java 8 update

    3rd party preference panes:

    Flash Player [Support]

    Java [Support]

    TeXDistPrefPane [Support]

    Time Machine:

    Time Machine not configured!

    Top of page process CPU:

    6% update_dyld_shared_cache

    4% WindowServer

    3% kernel_task

    mdworker (3) 2%

    1% launchd (4)

    Top of page process of memory:

    508 MB com.apple.WebKit.WebContent (4)

    502 MB kernel_task

    Safari of 283 MB

    Finder 197 MB

    152 MB softwareupdated

    Virtual memory information:

    988 MB of free RAM

    3.03 GB used RAM (750 MB cache)

    Used Swap 0 B

    Diagnostic information:

    26 January 2016, 21:59:30 self-test - spent

    Hello mrdivorce,

    It looks like of course as evidence of a hard drive failing for me. Hard drives 2.5 "in the MacBook Pro tend to fail after 2-3 years. Judging by the date on your MacBook, I think that your time is up. Maybe try to find a different repair store. Looking for Service Center authorized Apple (https://locate.apple.com/).

    I suggest upgrading to an SSD and increasing your RAM too. Then you have the hardware to run the last OS X 10.11.

  • Names of directory data store

    Hello

    Sorry for the N00b question, but I can't find an answer anywhere.

    I noticed that on my data stores, there are often multiple directories for the same customer. For example, if there is a guest named 'foo', there will be a directory "foo". But sometimes there will also be a directory named "foo_1".

    Whence the _1, < name >?  That is generated?

    TIA,

    T

    with the _1 means that the virtual machine has generally more than 1 HDD presented to her.

    But, in your case, by referring to the names of directories _1, it probably means that there are names that are duplicated in the data store.  A folder will be created when you create the virtual machine. The folder represents the object name of VMs.

    So, if I have a virtual machine named VM1, on the data store must be a VM1 folder with all the files associated with this virtual machine (.vmx, hard, etc.)

    If I create another virtual machine called VM1 and the content of the store data don't have not removed correctly a previous virtual computer that may have been moved, destroyed, removed from inventory, etc., there will be a VM1_1 folder with the associated files.  Have your records _1 files inside of them?

    You can also look something like RVTools.  It will help you find virtual machines that can be stunned. Check the Tab Vsante

  • The network connectivity status appears as only 'Local' error message ' there may be a problem with your domain name server (DNS) configuration "when trying to diagnose the problem.

    Original title: connection internet wireless Sony Vaio problems

    I get connection "local only" and then when I try to diagnose and repair he said: "it may be a problem with your domain name server (DNS) configuration. He said that this problem cannot be fixed automatically and I have no idea what to do.

    How do you connect to the Internet (method/ISP)? What is a stand-alone computer or a corporate work station? What is the status of virus/malware of the machine? Please give us more details so that we can help you.

    Help us help you:

    http://www.elephantboycomputers.com/page2.html#Tech_Support - See the article "how to write a Post.
    http://support.microsoft.com/default.aspx/kb/555375 - how to ask a Question

    Troubleshooting Internet connectivity

    1 answer to the first and second troubleshooting Questions:

    First Question of troubleshooting: If the problem is new, what has changed between the time things worked and the time they do not have?

    The second issue of Windows troubleshooting: what is the status of virus/malware of the machine? If you think it's clean, what programs (and versions) allows you to determine this?

    Make sure that the computer is clean - http://www.elephantboycomputers.com/page2.html#Removing_Malware

    Many variants of malware will allow a proxy server if you are unable to Internet. Go to control panel > Internet Options > connectivity tab > LAN button. If all is selected in the section Server Proxy, uncheck the box, apply/OK outside.

    2. If nothing has changed and that the computer is clean, what antivirus/security programs are you running? Have AVG 8 or Zone Alarm? These two programs have had updates that caused Internet connectivity problems. I don't recommend either of these programs, but if you want to keep check them on the mftrs.' support websites.

    3. If #2 is not applicable:

    a. unplug the router.
    b. disconnect the modem. (If you have a DOCSIS 3 modem with battery backup, press the Reset button to reset the modem so the lights go out).
    c. wait 60 seconds.
    d. plug the modem (or wait until the reboot is completed) and expect that all the lights are on.
    e. plug the router and wait until all lights are on.

    You now have an Internet connection? Otherwise:

    4. connect your computer directly to the cable/DSL modem. You now have an Internet connection? If so, there is a problem with the router. They do not last forever. Replace it.

    If there is no Internet when your computer is connected directly to the cable/DSL modem, call your ISP because something is wrong with the cable/DSL modem or your Internet service.

    MS - MVP - Elephant Boy computers - don't panic!

  • You can change the name of a data store that has active VM on it?

    We have a number of logical units shared through our table CX700 SAN ESX4.  Each lun has a unique about this data store.  In vCenter, if I rename one of the data stores that have active virtual machines on it, it will break anything?

    Mike O.

    Hello.

    You can rename them at any time.  These names are 'friendly names' only.

    Good luck!

  • root properties in the connected data store: error when accessing the date/time storage

    When you browse the properties my connected data store I get an error message when you try to read the value of the property of 'storage date/time': object doesn't support this property or method.

    Here is a minimal example:

    Dim oMyDataStore, MyProperty, oMyProperties
    Set oMyDataStore = Navigator.ConnectDataStoreByParameter ("TOC", "" & "C:\Program Files (x 86) \National 2012\Examples\Data\Example_data.tdm" & "" ')
    Set oMyProperties = oMyDataStore.RootElements (1). Properties
    For each MyProperty in oMyProperties
    Call MsgBoxDisp ("property name:" & MyProperty.Name & + "\n"&"property value:" & MyProperty.Value "")
    Next

    Why can I not access this particular property by default?

    Hi Phex,

    for the date/time properties, an object called UsiTimeDisp is returned. This object allows to that extend features of service as access to each part separately (day, year, hour, seconds,...) of your date/time value. If you want to print the value of time with MessageBoxDisp, you can use the VariantDate this object property.

    Your code might look like this then:

    Dim oMyDataStore, MyProperty, oMyProperties
    Set oMyDataStore = Navigator.ConnectDataStoreByParameter ("TOC", "" & "C:\Program Files (x 86) \National 2012\Examples\Data\Example_data.tdm" & "" ')
    Set oMyProperties = oMyDataStore.RootElements (1). Properties
    For each MyProperty in oMyProperties
    MyProperty.DataType = eTime Then
    Call MsgBoxDisp ("property name:" & MyProperty.Name & + "\n"&"property value:" & MyProperty.Value. ' ") VariantDate)
    On the other
    Call MsgBoxDisp ("property name:" & MyProperty.Name & + "\n"&"property value:" & MyProperty.Value "")
    End If
    Next

    I hope this helps.

    Good day

    Eva

  • 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

  • Migration of virtual machines from a data store, and then delete the data store?

    Hello

    I have a future deployment this month and my Director wants to build a new RAID 6 array, create a store of data with the new table and then move all the VMS to the newly created data store.

    Then he asked me to take the old data store and remove it and the available space between the deleted data store and other stores of data in our shared environment. The question is when the new raid is created and vm has migrated to the new data store, which is the best way to remove the data store empty and make sure that the space available for other data stores? Any help would be appreciated...

    Greg ~.

    If all controls are met, you can go ahead and take it apart without any problem.

    I have re-iterate below checks:

    -No virtual machine is in the data store

    -The data store is not part of the cluster data store

    -The data store is not managed by the DRS storage

    -IGCS is disabled for this data store

    -The data store is not used for vSphere HA heartbeat.

    Especially highlighted 2 controls. Please note that SIOC can be enabled on the data without SDR photo store

  • Reconnect the data store after removal of hard disk

    I have two identical Dell R610 servers.  I removed the readers of one of the servers and put them in the other.  ESX came very well and I can connect to the host with the vSphere client.  However, the data store has disappeared and 4 virtual machines that were on the server are "(inaccessible) unknown".  The device comes in storage.  It's a simple, 4 drive RAID5 set connected to the local controller inside the server.

    What can I do to reattach the data store?

    I tried both 'Keep the existing signature' and 'assign a new signature.  Both options produce the same result ' selected disk already Dad a VMFS datastore. ".  Select another disk.

    The data store is obviously there and intact.

    Sounds like the issue in the store of data missing and not mountable. You can also take a look at http://kb.vmware.com/kb/1015986 to see if that helps.

    André

  • ZBook G2: ZBook G2 - need id data or a picture of the disk of 512 GB Z Turbo - spare parts # 813138-001

    I'm looking for the identification data or a photo of the 512 GB Z Turbo Drive for a ZBook G2 module.

    I couldn't find spare HP part #: 813138-001.  Not even a product number.

    I know that this option has been introduced in June 2015, until late in the lifecycle ZBook G2 - Quickspecs.

    The price of the module that is sold as a spare part is way out of my range - about a$ 1,300 i.e. $ 900.

    I'm looking for a less expensive alternative - not as an option of HP or generic equivalent part.

    I know that this part should support PCIe 2.0 x 2, form factor of m2 and the format 22 x 60 mm.

    Your help will be appreciated.

    There is a lively discussion about the theme from here:

    forum.notebookreview.com/threads/zbook-g2-owners-alternatives-to-z-turbo-drive.769103/page-1

    He's going to nearly 200 comments.

    #153 post is located here:

    Forum.NotebookReview.com/threads/zbook-G2-Owners-alternatives-to-z-Turbo-Drive.769103/page-16

    It includes the following information:

    I chose the disk of 512 GB Z Turbo option when configuring the ZBook 17 G2 on the HP website. According to Device Manager, it's a LITEON-CX1-JB512-HP.

    Basically, that answer to my original question.

  • VM attached to the data store, but not in the config

    I have a few virtual machines that show that they are attached to a store data, but when you look at the parameters of the client both in the vmx file there is nothing that refers to this data store.  And, to top it off, the data store is just a deposit of file I only download iso files to mount for CD-ROMs.  I have made sure that the iso is not mounted on the machine (of course) and have paid through any other part of the config, but still it shows attached to that store of data, by the customer and by a powercli script.

    When you browse the data store, there is no folders or files on there that refer to this virtual machine.  I have about 10 machines all in this difficult situation.  Any ideas?

    Thank you!

    Hello..

    VM snapshots come with a .iso mounted for them? If so, that would explain it...

    / Rubeck

Maybe you are looking for

  • Toshiba journe touch problem with youtube...

    Hello... I have a problem with my touch journ.e... I opened the opera browser and try watching the YouTube video but I get a file not supported error message .swf format. Some animated content cannot play... and I can't see the videos from YouTube...

  • Satellite L300 freezes with Windows Vista

    I use the Satellite L300 laptop with Windows Vista.Once the connection is freezing, so I used to do Toshiba HDD recovery and formatted and installed with its recovery tools. Now its connect with normal mode.The problem is that if I use multitask or o

  • Satellite A210-183 - does not read blank disc

    I am trying to burn a CD or DVD and the DVD drive doesn't read any blank CD/DVDs, I insert!Nero and the Toshiba disc creator toinsert tell me a disk empty although there is already a. Help, please!

  • check the integrity of the blackberry_jde_7.0.0.exe

    Hello Recently I download Blackberry_JDE_7.0.0.exe to an internet café. However, when back home and I tried to install it, the win 7 complained that certificate cannot be verified. Tried it on Win XP and it even worse, because there is no tab digital

  • Do I have to update the graphics card if I upgrade the processor / i3 540 to an i5 760 on a Pavilion p6530

    I am trying to upgrade my CPU on a Pavilion p6530f using windows 7 64 bit. I installed the processor and I get 1 long beep and two short beeps, and the computer does not start. According to the table of code beep on HP web site, it sounds like a prob