showing posts tagged with 'powercli'
by lunarg on May 8th 2017, at 14:32
A very common practice when setting up SAN storage on a VMWare cluster is to configure the storage path policy to be set to "Round Robin" to properly benefit from MPIO in addition to standard failover. However, if the cluster consists of many nodes or there are many volumes, this can take up quite a lot of time if you configure this using the (Web)GUI. A better way to adjust the setting for the entire cluster is through PowerCLI.

The one-liner:

Get-VMHost <Cluster-or-Host> | Get-ScsiLun -LunType "disk" | Where {$_.MultipathPolicy -ne "RoundRobin"} | Set-ScsiLun -MultipathPolicy RoundRobin

The cmdlet selects a cluster or host, gets all LUNs which are of   ...
by lunarg on April 11th 2017, at 14:03

I wrote a script to list virtual disk information for a specified VM, including VMDK path, SCSI IDs and more. It is loosely based on this script but excludes all WMI info.

Download here.

by lunarg on January 19th 2017, at 16:49

With PowerCLI, you can generate all sorts of lists. To retrieve the configured and reported OS version of your VMs, try running this one-liner:

Get-VM | Sort | 
   Get-View -Property @("Name", "Config.GuestFullName", "Guest.GuestFullName", "Guest.IpAddress") | 
   Select -Property Name, 
       @{N="Configured OS";E={$_.Config.GuestFullName}},
       @{N="Running OS";E={$_.Guest.GuestFullName}},
       @{N="IP Address";E={@($_.Guest.IpAddress)}} | 
   Export-CSV -Delimiter ";" -Path "vms.csv"
by lunarg on December 5th 2015, at 13:19

You can quickly get a list of VMs, the datastores they are using and the logical folder they are in through PowerCLI:

Get-VM | Select Name,@{N="Datastore";E={[string]::Join(',',(Get-Datastore -Id $_.DatastoreIdList | Select -ExpandProperty Name))}},@{N="Folder";E={$_.Folder.Name}}

Combine it with Export-CSV to export the results to a CSV file.

showing posts tagged with 'powercli'
« October 2017»
« If the batteries of a TV remote run out, why do we press the buttons so much harder? »