PowerCLI: Configuring an All-Flash vSAN

From my understanding all-flash vSAN works like this:
  1. Caching Tier is 100% Writes. (Write Buffer)
  2. Capacity Tier is Mixed-Use
With this in mind, I ordered Dell R730's w/ two types of drives.  Two high write endurance SSD's and Four Mixed Use SSD's.

Short Story:
Here is the script I created to 'tag' the mix-use drives as flash capacity:
#Enable All Flash vSAN Intelligently
Add-PSSnapIn -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue
$TargetHosts = Get-VMHost
$CacheDiskVendor = "TOSHIBA"
$CacheDiskModel = "PX02SSF040"
$CapacityDiskVendor = "TOSHIBA"
$CapacityDiskModel = "PX02SMF040"

Foreach ($VMhost in $TargetHosts)
    {
    $ESXCLI = $VMHost | Get-ESXCLI
    $Storage = $VMhost | Get-VMHostStorage
    Foreach ($SCSILUN in $Storage.ScsiLun)
        {
        If ($SCSILUN.Vendor -match $CapacityDiskVendor -and $SCSILUN.Model -match $CapacityDiskModel)
            {
            $ESXCLI.vsan.storage.tag.add($SCSILUN.CanonicalName,"capacityFlash")
            }
        }
    }
I'm simply listing cache disk model and vendor as variables for my own sanity.  They are not used in the script to do anything.
Long Story:
The conundrum I ran into while going to configure my all-flash vSAN was that all my SSD's were from the same vendor and only differed by model number.  The part that sucked, the GUI doesn't reflect the model number and vSAN 6 defaults to detecting all SSD's as caching disks.  To top it off, the disks w/ their canonical names do not enumerate in the same physical order.

So, using the script above, I was able to find out the vendor and model numbers of all the detected disks and then apply the 'capacityFlash' tag to the correct disks.  If all my disks were the same, then I wouldn't have had specify models, but hopefully this is helpful to anyone else that might run into this.

References (Other Tools):
http://www.punchingclouds.com/2015/04/16/vmware-virtual-san-6-0-all-flash-configuration-utility/
http://www.virtuallyghetto.com/2015/02/how-to-configure-an-all-flash-vsan-6-0-configuration-using-nested-esxi.html
https://blogs.vmware.com/storage/2015/02/13/vmware-virtual-san-flash-configuration/

Licensing Bug [Update]:
Noticed this, even after configuring all-flash VSAN, the 'license feature' was still showing not in use.  This is simply a display bug and VMware is aware of it.  Your all-flash VSAN will still work properly.


PowerCLI: Configure/Enable Remote Syslog

[Updated ESXCLI call to v2 to reload syslog service]
Been spoiled w/ Log Insight, so didn't realize what I needed to do to get logs forwarded to Splunk Cloud from ESXi hosts.  Here is the script I wrote up to do so:

#Gets your list of hosts to configure for remote syslog.
$VMHosts = Get-VMHost
#$VMHosts = Get-Cluster MyCluster | Get-VMHost #Uncomment and comment line above if you want to target hosts in a cluster only.
#The remote syslog destination(s).
$SyslogValue = "tcp://192.168.123.5:514,udp://192.168.123.6:514"
#If Replace is set to true, will simply overwrite whatever is populated currently.  If False, then it will append.
$Replace = $true
#If ConfirmPreference is set to true, this script will ask you on every single host whether you want to make the change.  Set to $False, if you just want it to do it.
$ScriptConfirmPreference = $false

## Don't modify from here ##
$AdvancedSettings= $VMHosts | Get-AdvancedSetting| where {$_.name -match "syslog.global.loghost"}
Foreach ($AdvancedSetting in $AdvancedSettings)
    {
    If (!$AdvancedSetting.Value) {$AdvancedSetting| Set-AdvancedSetting-Value $SyslogValue-Confirm:$ScriptConfirmPreference}
    $CLI = $AdvancedSetting.Entity | Get-EsxCli -V2
    Switch ($Replace)
        {
        $True
            {
            $AdvancedSetting | Set-AdvancedSetting -Value $SyslogValue -Confirm:$ScriptConfirmPreference
            $AdvancedSetting.Entity | Get-VMHostFirewallException| where {$_.Name -eq "syslog"} | Set-VMHostFirewallException-Enabled $true
            $CLI.system.syslog.reload.invoke()
            }
        $False
            {
            If ($AdvancedSetting.value -match $SyslogValue)
            {Write-Host-ForegroundColor:Orange"$($AdvancedSetting.Entity) has a current value of $($AdvancedSetting.value), which seems to contain this value: $($SyslogValue).  Replace switch is false, so this script will not change it."}
            Else {$AdvancedSetting| Set-AdvancedSetting-Value ($AdvancedSetting.value + "," + $SyslogValue) -Confirm:$ScriptConfirmPreference}
            $AdvancedSetting.Entity | Get-VMHostFirewallException| where {$_.Name -eq "syslog"} | Set-VMHostFirewallException-Enabled $true
            $CLI.system.syslog.reload.invoke()
            }
       
        }

    }