Find virtual machines with disks of 'thin '.

Hello

I'm looking for a script that locates the virtual machines with disks of 'thin' and retrieves information about the provisioned size and "used" actual size and output to a CSV file.

Thank you in advance!

This gives you a report on virtual machines with thin discs and the capacity of your hard disk.

Validated clerk/no values are available only through VM by the data store, I'm afraid, not by the hard drive.

$report = foreach($vm in Get-VM){    $vm.Harddisks | where {$_.StorageFormat -eq "Thin"} |    Select @{N="VM";E={$vm.Name}},@{N="Harddisk";E={$_.Name}},    @{N="ProvisionedGB";E={[math]::Round($_.CapacityKB/1MB,1)}}}$report | Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture

Tags: VMware

Similar Questions

  • Using filters and Get - view to find virtual machines with a specific guest operating system.

    I have the following code snippet to find all virtual machines with the updated OS to ' Red Hat Enterprise Linux * "prompt. It does not work. If the filter is left out, I find myself with all virtual machines.

    The immediate question is the specs for the game ' Red Hat Enterprise Linux. " Originally from the "Performance Difference between GET - VM and GET-VIEW")

    http://www.batchworks.de/performance-difference-between-get-VM-and-get-view/ ).

    $ClusterFilter = Get-View -ViewType ClusterComputeResource -Property Name -Filter @{“Name” = $ClusterName } | select -ExpandProperty MoRef

    $VirtualMachines = Get-View -ViewType VirtualMachine -Property Config -SearchRoot $ClusterFilter


    The biggest problem for me is to understand for Get-View filter. I was capable of a bit of insight to gleen from the URL below, but I think what Miss me is the reference (Microsoft) for what is happening to the right of the equal sign. What is the correct terminology for this type of query expression / where the syntax is 'left' = 'straight' and keywords such as "-match" are not allowed.

    http://purple-screen.com/?Cat=3

    VMware vSphere 5.1

    http://Wannemacher.us/?p=259

    Regular expressions with Windows PowerShell

    Right in the filter expression is an RegEx expression, please allow for characters before and after the word Linux.

    And the name of the OS is Config.GuestFullName.

    I corrected the entries more early as well.

    $ClusterName = "^MyCluster$"$ClusterFilter = get-view -ViewType ClusterComputeResource -Property Name -Filter @{"Name" = $ClusterName } | select -ExpandProperty MoRefWrite-Host $ClusterFilter
    
    $VirtualMachinesNoFilter   = Get-View -ViewType VirtualMachine -Property Name,Config -SearchRoot $ClusterFilter $VirtualMachinesWithFilter = Get-View -ViewType VirtualMachine -Property Name,Config -SearchRoot $ClusterFilter -Filter @{"Config.GuestFullName"=".*Linux.*"}
    
  • Speed XP Virtual Machine with disk SSD/Velociraptor/7200 RPM EVEN!

    Hi all -

    Recently I decided that I was tired of waiting for one of my XP VM to boot. He took ~6.5 minutes, at the time where all services started and everything and I've been to a logon screen. I have a Velociraptor that my (clean install of Windows 7 x 64 RC1) operating system was turned on, so I bought an SSD, installed and copied my my 7200 RPM WD Caviar Black VMs to the SSD. Naturally, I was not impressed by the results of the tests AT ALL. I saw the following:

    • Operating system loaded on Velociraptor, VM XP on WD Caviar= 6.5 minutes to start the VM/login prompt to appear

    • Operating system loaded on Velociraptor, VM on SSD= 6.25 minutes to start the VM/login prompt to appear

    • Operating system loaded on SSD, VM on Velociraptor= 6.5 minutes to start the VM/login prompt to appear

    This seems really strange, since all the posts that I read is the drive faster, faster operates the VMWare VM / fastest. Throw into the mix that the portable original that this virtual machine has been converted will start in about 3.25 minutes (IBM T42, Celeron CPU @ 1.70 GHz, 2 GB RAM) and something seems really wrong...

    I had markers with crystal drive and I'm getting great flow on the SSD; readings are really quick, / writing sucks, as expected.  I also notice that my boot time host o/s, Office, race etc. faster.  I really expected increases in day/night performance here on my virtual machine, not more of the same for disk SSD $200...

    By the way, I have dedicated 2 GB of RAM to this VM XP and have only run with a single processor.  And before anyone asks: no, I can not improved this virtual machine to Vista/Windows 7, due to restrictions on IT.

    So, my questions for the group here are:

    1. Is there something special I need to do to make the more attentive virtual machine?  The main thing that I hear, it is to throw as much RAM and disk speed, you can him... obviously, I did... and no, dedicate 3 GB, 4 GB of RAM doesn't help, either. I already tried...

    2. My VM has a single disk (~ 42GB).  Would I have noticed no improvement in speed, dividing the disk (in pieces of 2GB)?

    3. I see the best performance by using a dedicated hard drive controller (Vs the edge)?

    4. If I see the best performance with a hard disk controller dedicated, he's more intelligent RAID 0 two Velociraptors or two SSD performance for VMWare?

    I am willing to spend money on a controller or another SSD or Velociraptor (or a controller and another drive), I don't want to feel like I am wasting time and $$$ trying to achieve a performance that cannot be established in VMWare.

    My features of the platform are:

    • Operating systems: Windows 7 x 64 RC1 (fresh installs for all tests)

    • CPU: C2D E6750-2.67 GHz

    • RAM: 8 GB RAM

    • Motherboard: Gigabyte P35-DS3L (Southbridge: ICH9)

    • Storage:

      • Corsair Extreme Series CMFSSD - 1 64 64 GB 2.5 "SATA II MLC (contains the OS)

      • Western Digital Velociraptor 150 GB (contains virtual machines)

      • Western Digital Caviar Black 1.0 TB (General store)

    Thank you, in advance, for all your comments.

    @ noirfan1:

    Re: #1: OK, it used to take me more than an hour to perform a scan on demand with the vmdk files stored on a 1 TB western digital 7200 RPM drive.  When I moved to an SSD (60 GB Supertalent) vmdk files time has decreased to the point where the total scan time less than 8 minutes.

    Re: #2: OK, I think that there may be a service startup time, driver, or a process that can be hung up the system which is not related to disk IO.

    Re: #3: If you use the same .vm * exact files on two different systems and see a big difference in time of start, check and confirm that the virtual machine configuration settings are identical.  An example would be to have the virtual CD-ROM connected to an ISO on a network share and have the virtual CD-ROM disconnected from each other.

    A good test in the strict sense for the disk performance is to create clean XP install on the raptor and the DSS, and compare boot times in this way.  I'm not too familiar with the SSD Corsair you mention, but it should be faster.  Beware if it is based on the Jmicron controller (they are known to have huge problems with the random read performance) instead of a controller Indilinx Barefoot or Intel.

    Another test of the performance of the hard drive could run iometer inside each virtual machine to check the raw performance of io.  HD tune is another tool, that you can use for an easier test.

    I hope this helps.

  • Find virtual machines with downtime more then a week

    Hello community,

    I'm looking for a command to find the virtual machines where the week then a longer time to stop-ist.

    I need this information to:

    Get - VM | Select-Object - property 'Name', 'Description', 'NumCPU', 'MemoryMB.

    I hope someone has an answer.

    Best wishes

    Jorn

    I think that the following script should produce those VM names.

    He begins by taking only the currently PoweredOff VMs.

    Then she collects all the virtual machines that have been turned off last week.

    And finally, it combines the 2 lists to find these virtual machines that have been turned off more than a week ago.

    I would like to know if it works for you.

    $vms = (Get-VM | where {$_.PowerState -eq "PoweredOff"}) | %{$_.Name}
    $events = Get-VIEvent -Start (Get-Date).AddDays(-7) | where{$_.FullFormattedMessage -like "Task: Power off*"}
    $lastweekVM = $events | %{$_.Vm.Name}
    $longer1week = $vms | where {!($lastweekVM -contains $_)}
    $longer1week
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Tool to find virtual machines with connected CD-ROM or a SQL query?

    What is a good way to find all the virtual machines that have the cd player or datastore ISO file attached host?

    RV tools will also work.  http://www.robware.NET

  • Cannot create a virtual machine with a vmdk file copied from another location, please find the attached error

    Hi all

    I copied a file from one place vmdk and try to make a new virtual machine with this vmdk file. But when I turn on after the creation of vm error is coming. Error in the text and the image below

    Power on the virtual machine: cannot open scsi0:0 disc: disc not supported or not valid type 7. Ensure that the disk has been imported.

    See the error of the stack for more details on the cause of this problem.

    Time: 31/03/2015-14:40:05

    Target: DBServer

    vCenter Server: vcsa

    Error stack

    An error was received from the ESX host turning on DBServer VM.

    Unable to start the virtual machine.

    Power DevicePowerOn module has failed.

    Unable to create the virtual SCSI device for scsi0:0, ' / vmfs/volumes/543d140b-feb33d52-7640-90b11c9796c3/vmdk/kapuatdb.vmdk'

    Could not open scsi0:0 disc: disc not supported or not valid type 7. Ensure that the disk has been imported.

    This error message generally if the hard files have been copied hosted as VMware Workstation product, which uses a format of sparse file that is not supported on an ESXi host. Instead of the hard copy, you can use VMware Converter, or - if you prefer - you can convert the hard using vmware-vdiskmanager (before transfer) or vmkfstools (after downloading). I deal to use vmkfstools you will need to load the mutliextent module (see for example "Clone or migration operations involving virtual discs non-VMFS on ESXi fail with an error" vSphere 5.1 Release Notes)

    André

  • Virtual machine with a multiple split files on disk.

    Hi all

    I downloaded Virtual Machine in which there are 2 disk file (hard) that has been split into several files to disk (joint screen shot... filename - disk_details.jpg). Now my concern is whenever I try to turn on the virtual machine it gives an error (attached screen shot... filename - Mapr VM Error.jpg). Need your help to solve this problem. I even tried to merge all split VMDK files in a single VMDK but who haven't worked too.

    5.1 ESXi

    CISCO UCS server

    The VM Ubuntu 64 OS.

    Let me know if you need additional information.

    Hello

    Try converting your vmdk 'sparse' a vmdk taken in charge.

    According to this KB:KB VMware: cannot power on a virtual machine with few disks mounted .

    Hope It helps,

    Kind regards

    Julien.

  • Photos of virtual machines with multiple disks on different LUNS - Question

    I have some questions on how to manage the snapshots of virtual machines with multiple disks on different LUNS.  First of all, the LUNS are VMFS.  We are just starting to add virtual machines with dedicated for data storage format VMFS LUNS.  I don't think an extra space must be made for snapshots, as well as at least 100 GB LUN is required to store the data, and then say, add about 25 to 50% of this amount?  Set the 100 GB vmdk file but have the GB from 25 to 50 additional disk space for snapshots, if necessary (rather than just to get a unit number logic needed 100 GB of data and devote all of the 100 GB to the vmdk file).  In addition, if a virtual machine has several files vmdk on different LUNS, which will be a problem to take a snapshot, and is it possible to do just a snapshot of a disk of a virtual computer (as the volume of the BONE)?

    Thanks for any help.

    Snapshot files are created in the home folder of the VM by default for all virtual disks, no matter on what data store they are. You must make sure you have enough free disk space on the data store for snapshots.

    If you want to exclude a virtual disks of taking snapshots, you can set it to 'Independent' - 'Persistent' machine virtual settings to the HARD drive.

    André

  • Impossible to turn on the virtual machine with the following error: could not open the disk ' / path/to/vmdk-0001.vmdk ' or one of the Flash disk it depends on. Reason: Broken pipe.

    After the movement of virtual machines in VmWare Server 2 for ESX 4i, I get this error when you try to start the virtual machine:

    Impossible to turn on the virtual machine with the following error: could not open the disc

    "/ path/to/vmdk-0001.vmdk" or one of the Flash disk it depends on.

    Reason: Broken pipe.

    Anyone's idea what is the problem here?

    How did you move virtual machines?

    Did you use the converter (https://www.vmware.com/tryvmware/?p=converter)

    Otherwise try converter

  • Create the virtual machine with the type of controller SCSI LSI logic SAS with PowerCLi

    Hey guys,.

    IM the difficulty to create a virtual machine with the type of controller SCSI to "LSI Logic SAS". The cmdlet New - VM im struggling to find where to create the type of controller?

    If you create a virtual machine without specifying a disk it will create a 4 GB SCSI type thick (0:0) hard drive 1 with 0 Parrall default BusLogic SCSI controller.

    What im wanting to do is to create a disk hard which is thin Prov. and create SCSI LSI logic SAS controller is set to.

    New-VM -name VMSTORE23 -$vmhost $esxhost MemoryMB- 4096 NumCpu- 2 -NetworkName "Vlan 6 Machine Virtual Network" | Get-NetworkAdapter | Set-NetworkAdapter -Type Vmxnet3 -MacAddress '00:50:56:00:00:21' -confirm:$false

    I have recived of aid by some LucD who helped direct the value of the network card in the New - VM cmdlet as follows. But I'm not able to add a hose for hard disk also like:

    | Get-hard drive | Together-hard drive - Datastore $datastore - slim StorageFormat

    And I have no idea how change the type of SCSI conroller or create it with the correct configuration?

    Any help would be great,

    Thanks in advance

    Eddie

    Greetings, steddyeddie-

    You should be able to use Set - hard drive and SCSI controller Set cmdlets to set the storage format of your hard drive and the SCSI controller type, respectively.  You were close to on the part of game - hard drive .  Try something like:

    ## get the VM object $vmVMSTORE23 = Get-VM VMSTORE23 ## set the harddisk storageformat to thin$vmVMSTORE23 | Get-HardDisk | Set-HardDisk -StorageFormat Thin ## set the SCSI controller type$vmVMSTORE23 | Get-ScsiController | Set-ScsiController -Type VirtualLsiLogicSAS
    

    It could pack in to your existing order to keep it as a good word, but for readability.

    Enjoy

  • Plan for the creation of new virtual machine with 3 TB data drive

    We have an old server, we need to virtualize, and one thing that we need is a lot more storage. We have approximately 3.25 TB of available for this machine (250 GB for the OS and 3 to for the data drives), but I'm going in circles trying to find the best approach for this server. It is not possible to separate the data between several players because of the way the files are indexed. I have created a virtual machine with 2 TB of disk space (for the readers of OS and data) and added 1.25 TB of disk space I want to add on the data reader, but it does not seem possible to add 1.25 TB without destroying the data on the first disk of 2 TB. What is the best approach? Create a single disc for my virtual machine that is 250 GB and then add in two separate disks of 1.5 TB for storage and combine them within Windows?

    Thanks for your suggestions.

    Hello

    Unfortunately, the maximum size of virtual disk to a virtual computer is 2 TB - 512 bytes. In you case it should create two or three separate virtual disks and combine them (disks RAID 0 or concatenate). Another way (IMHO besser way) is to create several virtual drives and mount using NTFS mount points.

    An example:

    C:\Data is a folder on one of the virtual disks. Create a second virtual disks and create the C:\Data\Data2 folder. Rather than assign a drive letter for the newly created disk, you can mount it in the Database2 folder. This gives you the ability to move the largest files on separate virtual drives without lose you the structure of folders.

    Kind regards

    Patrick

  • Commissioning a virtual machine with vCAC

    I'm embarrassed to have to ask the question, but here goes.

    How to configure a virtual machine with vCAC?

    I have install the application.  Created the plan of action.  Has created the service.  Created the Group of companies.  Create the law.  Has created the catalog item.

    As far as I can tell, I did everything what to do to allow a computer virtual be put into service, but I can't find where in the application to access the catalog and run provisioning.

    Would be the logical place to do https://FQDN to vcac/shell-ui-app/org / < tenant > logged in as a standard user who is a member of the Business Group with access to appropriate and rights catalog items to the.

    What Miss me?  I'm sure that the answer is right in front of my face, but I can't.

    If you are a member of the right to the service and a member of the Group of companies, you should have a catalog tab when you log in. All the plans that you access it will be...

  • Create the virtual machine with the ISO mounted CDROM

    Community of hell!

    Working on the vmcreate.pl script to add the creation of CD-ROM with iso data store, I got stuck on the error

    ' Invalid device configuration: ' VirtualSCSIControllerOption.numSCSICdroms '.

    I'm sure I'm missing something obvious, or this option but may not understand how to deliver this.

    I created a cdrom as follows (below test I create any CDROM, no iso file to reduce the number of layers):

    my $ BPPRR m_backing_info = VirtualCdromRemotePassthroughBackingInfo->new)

    deviceName = > ' '.

    exclusive = > 0,

    );

    my $description = description->new(label = > 'CDROM', summary = > 'cdddrom');

    my $connectable = VirtualDeviceConnectInfo->new(allowGuestControl = > 1,)

    connected = > 0,

    startConnected = > 1,

    ( State = > inmates ' / ' );

    my $ BPPRR m = VirtualCdrom->new(backup = > $BPPRRm_backing_info,

    connectable = > $connectable,

    controllerKey = > 0,

    deviceInfo = > $description,

    key => 1,

    ( unitNumber = > 1 );

    VirtualDeviceConfigSpec->new(device = > $BPPRRm,

    operation = > VirtualDeviceConfigSpecOperation->new()'add'));

    Did anyone have working example to create the virtual machine with CDRom?

    Andrey

    If someone will find this useful I followed this route Re: vmreconfig.pl add the device CD/DVD fails if the virtual machine created with vmcreate.pl

    and also I found good examples of what I need to in VMUtil.pm in cmd vmsphere libraries.

    Andrey

  • How to export/import a virtual machine with ESXi 5

    I use the free version of ESXi 5 and have created a virtual machine that is configured with the software for our project. I would like to share this virtual machine with other members of the team, some of whom are in other places and have slow network connections.  I want to pack the VM in a reasonable size file or a set of files I could ftp (or put it on DVD for people in areas of slow network) that they could then import into their ESXi hosts. The virtual machine has a 60 GB drive that is implemented by using the option 'thin', so it contains only 6 or 7 GB of real data right now.  Is it possible to export the image to a file or set of files that can be imported to another people ESXI host?  Before when I used VM Player we could do this by upgrading backup files in virtual machine directory and copy them to the new machine. With the ESXi data store, I don't know that something like this can be done.  I used vCenter Converter to convert to ESXi Infrastructure VM in VM Player format (and vice versa), but it is extremely slow. I think I might point the Source to my ESXi host and the Destination to a co-workers ESXi host and run a 'conversion' to transfer the files, but I think it would be very slow and impractical for some people to 'slow-network '.  I tried with vSphere Client navigation data store and I see the download options, but when I tried to download a VM directory it just hung.  I enabled ssh on my server ESXi and I found the store of data under/vmfs/volumes and when I look in the folder that contains my VM, there a file myvmname - flat hard which is 60 GB in size, so if I tar the contents of this folder to move elsewhere it will be huge.

    Can anyone suggest a solution?  The licensed version of ESXi would offer better alternatives?

    You can watch export OVF available in the Client vSphere for this function.

  • Start and stop Virtual Machines with the system

    Hello

    In a server cluster @vcenter HA/DRS 5.1, I enabled start and stop virtual machines with the system option but after I checked two days later, he is off again somehow. What makes this option off? I had a power failure in the datacenter. vCenter server has not been upward. I started all of the ESXi servers manually then went all VMs account is declining. I want that they start automatically when server ESXi upward.

    Thanks in advance,

    Thank you. This option is more valid than if the hosts are part of an HA Cluster license. I suspect that you configured through the traditional vSphere Client and that it is a bug with this client. If you try with the new vSphere Web Client, you will find a notice that it is disabled and there is no button "Edit".

    Concerning

Maybe you are looking for