Newbie question: list the Configuration of virtual machines and data warehouses


I'm new on using powercli how to list all virtual machines in a certain data center, their memory, Procs and what data warehouses they are on.

I know you can use get - vm | Select-object name, NumCPU MemoryMB but if I add DatastoreIdList as well, it doesn't seem to work.  What Miss me

Thank you very much


That's right, you could do

Get-VM MyVM | Select Name,@{N="DS";E={[string]::join(',',($_.datastoreidlist|%{(Get-View -Id $_).Name}))}},Description |
    Export-Csv "C:\test.csv" -NoTypeInformation -UseCulture

Just look at whether the separator for CSV is be a comma in your culture, you probably need to adjust the separator in the Join method!

Tags: VMware

Similar Questions

  • ESXi 4.1 upgrade to ESXi 5.5 while all virtual machines and data warehouses

    We have two servers ESXi 4.1.0 348481 (Essentials) and we need to upgrade to ESXi 5.5 for support of Windows Server R2 2012. We intend to use the interactive upgrade. We want to ensure that the virtual machine is preserved. More precisely VMFarm001 where ESXi is installed in the same data store as VMServer1. VMServer1 is our largest server and cannot be migrated to another data store easily because we are not allowed for vMotion.

    The following layout


    Dell PowerEdge R710

    Data store:

    Storage1 - 1.36 TB

    VMServer1 - MS Server 2003

    Install ESXi

    Storage2 - 1.82 TB

    VMServer2 - MS Server 2008 R2

    VMServer3 - MS Server 2008 R2


    HP ProLiant ML350 G5

    Data store:

    Storage1 - 95GB

    Install ESXi


    Storage2 - 1.82 TB

    VMServer4 - MS Server 2008 R2

    VMServer5 - MS Server 2008 R2

    I have a feeling I'm worried for nothing given that option during the ESXi upgrade and keep the VMFS datastore.

    Thank you

    Yes, that's correct.

    I recently finished the upgrade of lots of stand-alone hosts ESXi 4.1 (with local storage only) to 5.1 and all were successful. The same process applies to 5.5, so you shouldn't have a problem with preservation of VMFS data warehouses (and all virtual machines).

  • newbie question - vmdk transfer on another virtual machine on the same host


    can I transfer a vmdk 1 vm to another and mount it?

    I have a vm of windows server with a 2nd virtual hard drive that has data on it. rather than to make a copy of file in a file to another virtual machine with a 2nd hard drive and then delete the second original disk, could I just disassemble and remove the second hard drive to the original virtual machine and then attach it as an extra hard drive to the second vm?

    pointers would be appreciated.


    y at - it no problem tell move a ntfs disk to a file for example linux server

    Mode not read-only (but you lose the NTFS and share permissions).


  • Can you pass offline virtual machines between data warehouses using the 'Migration' with the basic Kit Essentials feature?

    I speak not of Essentials Plus vMotion between hosts or migration of VMS between hosts and data warehouses online. Just curious to know if its possible to off a virtual machine and click the button to migrate to another store of data with the basic Essentials bundle.

    Welcome to the community - Yes you can - it's what we call a cold migration.

  • Question about the configuration of virtual computer file and the working VM location

    I noticed one of my virtual machines had two data warehouses listed under "Items" in the vSphere Client.

    After some research autour, I found the virtual machine files are in the correct data store, but the 'VM-configuration file' and 'Place of work VM' are in another data store.

    Can I combine all in the same database?   I'd rather have the config and the workplace on ma who has a lot of main storage.  For some reason, the configuration file and the location of work were created on a local storage on my host.

    Any suggestions?

    Thank you

    David Moore

    You can use Storage vMotion to migrate only the virtual machine configuration file to the desired location, just start the wizard of vMotion and storage step 'Select the data store', click Advanced, and you will see the option to select a new destination for the configuration file data store.

  • List of virtual machines in data warehouses

    Hi all

    I want to list all virtual machines in warehouses of data starting with "MDF".  I tried

    Get - VM - Datastore (Get-Datastore-name MDF *) | Select-object - property name, data store > VMplusdatastore.txt

    But it does not list the names of data store for a reason any?

    Also some VM will have records on more than a logic unit number - I suppose that it is not translated here?

    Wouldn't be better to do the opposite?

    Hi Simon,.

    the problem with your script is that the virtual computer object does not have a property data store. That is why the data column store is empty in the output. The following script will combine virtual machine names and the data store for all with names beginning with MDF data warehouses:

    Get-Datastore -Name MDF* | ForEach-Object {
      $Datastore = $_
      $Datastore | Get-VM | ForEach-Object {
        $Report = "" | Select-Object -property Name, Datastore
        $Report.Name = $_.Name
        $Report.Datastore = $
    } > VMplusdatastore.txt

    If a virtual machine disks on multiple data stores, it will display all the combinations.

    Best regards, Robert

  • Moving propelled out of virtual machines between data warehouses

    I need to create a script to move a list of virtual machines in the current in another data store.

    The script must move the first VM, wait for the operation to complete, and then move the second and so on.

    Y at - it no samples can I start from?



    You can check VMRelocatedEvent with Get-ViEvent.

    Something like that

    $targetVM = "MyVM.

    $finished = $false


    If ((Get-Date) Get-VIEvent-Start. AddMinutes(-15) - MaxSamples ([int]: MaxValue) |

    where {$_-is [VMware.Vim.VmRelocatedEvent] - and $_.} {Vm.Name - eq $targetVM)}

    $finished = $true


    else {}

    Sleep 30



  • Script to import virtual machines from data warehouses

    Is there a quick way to import all of the virtual machines on a data store in a vCenter?  A kind of browse VMX files and import?

    More to the point.  I have the only store of data that has been moved to a new location with approximately 100 VM on it.  I want to import all the virtual machines on this unique to a single host data store to the new location.

    Thank you

    Boston Tech Guy

    You can specify the name of this 1 data store in the variable $Datastores .

    And if you change this line

    $ESXHost= Get-Cluster$Cluster| Get-VMHost|select-First1


    $ESXHost=Get-VMHost -Name MyEsx

    It should do the trick.

  • Script to find virtual machines on data warehouses that begin by...

    I'm looking for a script that will list all VM on specific data with the initial T1SDX1 letters warehouses. I tried to use a certain liners, I found, but they do not seem to work. Here's what I'm not, but it does not list the VM.

    Get-Cluster "Test Cluster" | Get-vm |?{($_.extensiondata.config.datastoreurl|%{$}) -like "T1SDX1"}| Export-Csv "H:\Excel_Reports\vms_on_whatDS.csv"

    I tried to use the same command - and -contains the command. Both show no results. I tried a single line, I found here, but it signals a TON of data I don't need and does not even get the info, I need.

    Get-Cluster "your_cluster"|Get-vm |?{($_.extensiondata.config.datastoreurl|%{$}) -match "^T"}

    In fact, I found an old script I used who shot all s VM on all data warehouses. It works, I'll just filter across the worksheet.

    Here's the script if anyone cares or she wants:

    $Today = (Get-Date -Format "")
    $vcenter = $defaultVIServers
    $report = Get-Datacenter | Get-Datastore | Foreach-Object {
        $ds = $_.Name
        $_ | Get-VM | Select-Object Name,@{n='DataStore';e={$ds}} |
    $report | Export-Csv "H:\Excel_Reports\DS.stats.$vcenter.$today.csv" -NoTypeInformation -UseCulture
  • Basic questions about the PL/SQL web services and data source names


    I've successfully generated a web service for a procedure from PL/SQL packaged JDeveloper

    The following code was generated in the base class for web services:
     __dataSource = (javax.sql.DataSource) __initCtx.lookup("java:comp/env/jdbc/dbconnectionDS");
    However in the weblogic server, the data source name is jdbc/Gisele for deployment fails in a first time.

    What is the recommended procedure to solve this problem? The obvious solution is to manually change the source - that's what I did and it worked fine. However if I re - generate the web service I won't lose my change. Is there a better way to do it?

    Another question - in the web.xml file that is generated, there is a resource-ref to the data source. I was hoping that change the data source name it would help, but it didn't work. What is - it used to in this context?

    Thank you

    I forgot to add, so in case some time later and you want to update the connection to your service details, all you have to do is to add the following entry in your weblogic.xml:

    JDBC/ref_name_from_web. XML

    And in this way, you will not have to change any code level to point your web service to another connection.


  • HELP - how to get the number of virtual machines on a data store?

    Looking at the inventory of the data store in the VI client, there are a "number of Virtual Machines:" according to the General information for the Summary tab... I'm looking for a script that retrieves this information for me...

    I started the script but I'm stuck... I am very new on this...

    Get-Datastore. WHERE-object {$_ .name - like "wlp" ' "} #this gives me all the data which are not local warehouses

    Could someone give an overview on how to script to retrieve the number of virtual machines on data warehouses...

    Thank you, Lee

    Sorry, something went wrong with the copy - paste

    Get-Datastore | where {$_.Name -like "vmfs*"} | Sort-Object -Property Name | %{$_ | select @{N="DSname"; E={$_.Name}},
                                                                          @{N="VMcount";E={($_ | Get-VM | Measure-Object).count}}}
  • Unable to start the virtual machine and snapshots are missing from snapshot Manager.


    I'm new here in the VMWARE communities and I don't know if I'm posting this survey in the right place. I am currently using VMWARE Workstation 9. The issue I'm having is that I can not start my VM. The error that says:

    vm error.png

    This is an overview of my settings:


    When I try to get a snapshot I can go back, I get this snapshot Manager screen:


    I checked the files on the directory of the virtual machine. The snapshot files are still there.

    I tried to solve the problem by editing the configuration of virtual machine file to use another vmdk. I got an error saying something about the parent and the child are not synchronized. Sorry I don't have a screenshot of that. I also tried to make a copy of one of the other VMDK and rename it to match with the name of the missing file. That also made me anywhere I tried looking on the net but I get answers to other vmware ESXi and vSphere products. So I don't know if they apply to my current situation.

    At this point, I'm hoping to recover my machine or at least be able to use snapshots. Please notify.

    I think that the restoration was the best way to solve this problem. I actually checked the different files, but it looks like I missed something. In any case, create snapshots with the virtual machine in a state engine is my personal preference. It is not only to save disk space (since there is no need to preserve the current state of memory), but also provides a consistent state. As for the number of snapshots, you're always on the stop side, and if you are not having issue of performace with small changes you make you should be ok. In case there is a performance problem, you may consider to store the computer virtual on an SSD that will certainly help.

    Since the Center of Documentation of VMware Workstation 10

    To the premises of the virtual machines, you can take more than 100 snapshots for each linear process. For shared virtual computers and remote, you can take a maximum of 31 snapshots for each linear process.


    Post edited by: a.p. corrected fault, "SSD" instead of "SD".

  • Non supported configuration of virtual machines for the fault tolerance. The operation is not supported on the object. When activating FT


    I try to activate FT on a virtual machine that AFAIK ticked all the boxes for FT but I get this message when activating it. No clue as to what might happen or where to connect for extended information? This error message is too generic...

    Thanks in advance mates.

    Did you follow KB1019165-fault tolerant to fails to 42% with the error: not supported configuration of virtual machines for the fault tolerance


  • Need to move virtual machines and power over the other ESXi HA and issues of Configuration of power


    Need to move virtual machines and power on ESXi others using the HA and Power Options

    So what are the Options I need activate and deactivate:

    Turn on Vsphere HA

    Activate the tracking host

    Admission control (disabled)

    VM Machine Options

    VM restart priority (medium)

    Response from the host of off the power isolation

    VM monitoring (people with disabilities)

    Monitoring of (high) sensitivity

    Heartbeat of data store (select one of cluster data warehouses taking into account my preferences) of the data store is checked

    On each:

    Start/stop of the virtual machine is turned off

    Please indicate the required Options and on virtual machines, we are not turning on?

    Just to be clear, that VMware HA will only restart the VMS if ESXi hosts fails - or surveillance of the VM is turned on which will be monitors VMs will they crash or suspend and restart the virtual machine affected.

    and just to be clear, that the response of insulation parameter has nothing to do whther THAT HA will work or not - it does come into play if the ESXi host is isolated of the HA - Cluster

    xMotion works only between active ESXi hosts that can communicate with the server vCenter - and if the ESXi host broke down or became isolated and vMotion may not work.

    vMotion is automated with DRS that vMotion will a VM who need more resources to an ESXi host with enough reosurces.

  • REALLY stupid question about virtual machines and disks of cancellations.

    I'm a bit hesitant to ask this question because it might make me look stupid, but...

    When I'm done using Virtual PC and a virtual machine running Windows XP Pro with Vista 64 Home Premium because the host os, often I did not any significant changes to the hard disk of the virtual machine.

    What I save gets saved to a network share on my server for files and printing from Win98 and saved on a flash drive.

    Assuming that I do no configuration changes or anything else I want to keep, is there a reason barely stopping properly when I 'cancellations discs' enabled?

    Any reason, I can not save time by pressing the 'X' button and choose 'disable and remove changes '?

    I am aware of patches, but took me to inform me of the patches, and I can get patches when it's convenient for me and I always validate changes when I install the patches. I'm not using it for anything other than my classes of the school of the evening for the time being, so it is not much of a value of protection on the virtual machine, and I used to write papers on the host operating system. I just use the virtual machine to play with the admin tools in an environment where I can easily fix it a massive screw-up without spending hours to reinstall Windows.

    Hey SlickRCBD,.

    Not a stupid question at all! :)

    It's very well hit the X when you have activated the disks of cancellations. And corruption or problems with the active virtual machine will be resolved when using the drive to cancel it.

    Cody C
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for

  • RoboForm toolbar moved and resists turned

    I had Roboform toolbar parked to the left of the search box in the menu bar. It suddenly went rogue and is now located above the tabs as a new toolbar. I tried to move again by using the window customize, but she resists moved anywhere. Can anyone gi



  • L197 screen problems

    Hello I purchsed a L197 screen that has a 16:10 aspect ratio and Im running at its optimal resolution of 1440 x 900, but Im thinking lines on the sides, as it runs in 4:3. I have the updated drivers and have played around with different resolutions,

  • Cannot install the update of security KB2644615

    Original title: windows (KB2644615) security update Whenever I try to install the windows (kb2644615) security update, it fails. have tried to use the fix it solution from microsoft without success. can anyone solve this problem?

  • How can I activate my wireless back?

    My laptop is a 5611 advent and it has Windows Vista Premium (don't know if this is relevant!) and a d-link router and until yesterday, everything was fine and I could go in the living room or bed with her! All of a sudden now it says that the 'wirele