VMware Cloud Community
OsburnM
Hot Shot
Hot Shot
Jump to solution

Powercli script for getting local disks from hosts

Anyone have any scripts out there on getting all hosts with local disks?  Gearing up to switch our hosts from SD to LocalDisk installs and need a script to identify which hosts don't still have a local disk.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

If you only want check if an ESXi was booted from SD or a local disk, you do something like in Solved: Re: Esxi OS running on Local Sata HDD or SD card - VMware Technology Network VMTN

To get a list of all local device, you could use the Get-EsxCli cmdlet and then do

$esxcli.storage.core.device.list.Invoke()

The returned devices have properties like IsLocal and IsUSB that should allow you to find the SD, if still present


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

3 Replies
LucD
Leadership
Leadership
Jump to solution

Just to make sure, with "hosts", do you mean ESXI nodes?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
OsburnM
Hot Shot
Hot Shot
Jump to solution

Ha!  You sound like one of my network guys.  lol  Yeah, ESX Hosts.  They all have SD cards we've traditionally used and over the last couple years we've been slowly adding a local drive for logging/scratch.  I'm just wanting to try an see which ones are still missing the local drive that's not an SD.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

If you only want check if an ESXi was booted from SD or a local disk, you do something like in Solved: Re: Esxi OS running on Local Sata HDD or SD card - VMware Technology Network VMTN

To get a list of all local device, you could use the Get-EsxCli cmdlet and then do

$esxcli.storage.core.device.list.Invoke()

The returned devices have properties like IsLocal and IsUSB that should allow you to find the SD, if still present


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference