VMware Cloud Community
X1t3r0
VMware Employee
VMware Employee

vSAN creating diskgroup, identifying capacity vs cache

Hi all,

I'm trying to automate vSAN cluster creation, therefore from each esxi host i need to identify SSD cache and SSD capacity tiers.

Does anyone accomplished this?

I'm thinking getting a list of disks, then sorting them, being the smallest cache and highest capacity, this approach should work, however, leaves a few holes to tap in case there are other drives... are there any other approaches?

 

$disks = Get-VMHost $ESXHosts[0].name | Get-VMHostDisk
$SSDs = $disks | Where { $_.scsilun.extensiondata.ssd }
$BlankSSDs = $SSDs | Where { -not $_.Extensiondata.Layout.Partition[0].partition }
$BlankSSDs.count
$capacity=$BlankSSDs[$BlankSSDs.Count - 1]
$capacitySize=$capacity.TotalSectors


$cacheDisk = $BlankSSDs[0]
$CapacityDisks = $SSDs |where {$_.TotalSectors -eq $capacitySize}
 

Cheers!

0 Kudos
6 Replies
LucD
Leadership
Leadership

Not sure what the actual question is?

You can easily identify LUNs that are SSD or HDD, and get the capacity.
Selecting the LUNs to be used for VSAN is a design decision, not sure how you want to script that.


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

0 Kudos
X1t3r0
VMware Employee
VMware Employee

Enabling vSAN does not automatically create a diskgroup, we need to claim unused disks manually.

I'm looking on a scenario where there are no HDD's, all disks are SSD, so there is no easy way to distinguish data from cache.

Does this make sense?

0 Kudos
LucD
Leadership
Leadership

I do know how a VSAN setup works, but, just like in the Web Client, you can pick whatever free LUN and select it as Data or Cache.
Even if all your LUNs are SSD, you will still have to decide which is used for Data and which for Cache.


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

0 Kudos
X1t3r0
VMware Employee
VMware Employee

Yes, that is exactly the question i asked. What will be the best approach to determine which is which taking into consideration different hardware on different esxi hosts

0 Kudos
LucD
Leadership
Leadership

That would be more of a VSAN question than a PowerCLI question, I think.


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

Tags (1)
0 Kudos
X1t3r0
VMware Employee
VMware Employee

I need to do it with PowerCLI, thought it would be better off in this channel, but thank you anyway!

0 Kudos