forked from jasemccarty/Vsan-Settings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vsan-GetDedupeScan.ps1
59 lines (45 loc) · 1.47 KB
/
Vsan-GetDedupeScan.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<#==========================================================================
Script Name: Vsan-GetDedupeScan.ps1
Created on: 7/18/2016
Created by: Jase McCarty
Github: http://www.github.com/jasemccarty
Twitter: @jasemccarty
Website: http://www.jasemccarty.com
===========================================================================
.DESCRIPTION
This script gets advanced settings for DedupeScan
Syntax is:
Vsan-GetDedupeScan.ps1 -ClusterName <ClusterName>
.Notes
#>
# Set our Parameters
[CmdletBinding()]Param(
[Parameter(Mandatory=$True)]
[string]$ClusterName
)
# Must be connected to vCenter Server 1st
# Connect-VIServer
# Get the Cluster Name
$Cluster = Get-Cluster -Name $ClusterName
# Display the Cluster
Write-Host Cluster: $($Cluster.name)
# Cycle through each ESXi Host in the cluster
Foreach ($ESXHost in ($Cluster |Get-VMHost | Sort Name)){
if ($Cluster.VsanEnabled){
$HybridDisks = Get-VsanDisk | Where-Object {-Not $_.IsSsd}
if ($HybridDisks.count -gt 1) {
# If we find any non-SSD disks, we'll assume a Hybrid Configuration
Write-Host "Hybrid Architecture: Proceeding"
# Grab the current /LSOM/lsomComponentDedupScanType
$DedupeScanType = Get-AdvancedSetting -Entity $ESXHost -Name "LSOM.lsomComponentDedupScanType"
# Display the current setting
Write-Host "$ESXHost $DedupeScanType"
} else {
Write-Host "All-Flash Architecture: Exiting"
Exit
}
} else {
Write-Host "VSAN Not Enabled: Exiting"
Exit
}
}