VMware Cloud Community
G0nz0UK
Enthusiast
Enthusiast

Trying to understand this VSAN script and if I can run it

Hello,

I've been looking for a PS script to run to show our VSAN info and to my luck found this .

From what I can see it would be safe to run as it's just a get?

It's a shame there is now screenshot of how it might look before running.

Do you think it looks ok to run?

Thanks

0 Kudos
13 Replies
LucD
Leadership
Leadership

There don't seem to be any New- or Set- cmdlets in there, only Get-
Shouldn't pose any threat


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

0 Kudos
LucD
Leadership
Leadership

Btw, that script is part of the vDocumentation project, which is available as a module vDocumentation in the PS Gallery..


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

0 Kudos
G0nz0UK
Enthusiast
Enthusiast

Ah ok thanks, does that mean I can run it differently?

0 Kudos
LucD
Leadership
Leadership

The vDocumentation module brings 8 new cmdlets, each of which you can run independently.
The problem might be that the code hasn't been updated since a couple of years.


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

0 Kudos
G0nz0UK
Enthusiast
Enthusiast

I don't suppose it runs for you if you have a moment to test?

I've installed the module and now 'Get-vSANInfo' runs and I get some nice info.

If I run the script it runs and instantly returns to the next line with no error or output.

0 Kudos
LucD
Leadership
Leadership

The Get-vSANInfo.ps1 defines a function (Get-VSANInfo), dot-source that file and after that you can call that function.

. .\Get-vSANInfo.ps1
Get-VSANInfo




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

0 Kudos
G0nz0UK
Enthusiast
Enthusiast

That runs and produces a nice summary:

 
vSAN Cluster Name                   : xxx
Effective Hosts                     : 123
Oldest vSAN Version                 : 7.0.203
Oldest Disk Format                  : 15
Cluster Type                        : Hybrid
Disk Claim Mode                     : Manual
Deduplication & Compression Enabled : False
Stretched Cluster Enabled           : False
Host Failures To Tolerate           : 
vSAN Stripe Width                   : 
Total vSAN Claimed Disks            : 114
Total Disk Groups                   : 16
Total Capacity (GB)                 : 43817.87
Provisioned Space (GB)              : 30692.68
Free Space (GB)                     : 21371.22

 

Do you know if there is a more details script that shows all the disks like these from vcenter
 
Summary per host 
 
G0nz0UK_0-1665158717606.png

 

More detail per host:

G0nz0UK_1-1665158875888.png

 

0 Kudos
LucD
Leadership
Leadership

Have a look in Jase's PowerCLI Cookbook for VSAN.


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

0 Kudos
G0nz0UK
Enthusiast
Enthusiast

Thanks, I will do, lots of info.

I'm just exploring a way to have a detailed output of our VSAN clusters to CSV.

0 Kudos
G0nz0UK
Enthusiast
Enthusiast

Hello, how would I send this to CSV?

Connect-VIServer -Server vvsupport1.thisisglobal.com -Credential $credentials

. .\Get-vSANInfo.ps1
Get-VSANInfo

Export-Csv C:\vmware\powercli\reports\vSAN.csv -NoTypeInformation -UseCulture


I get:

cmdlet Export-Csv at command pipeline position 1

Supply values for the following parameters:

InputObject:  

0 Kudos
LucD
Leadership
Leadership

You have to use the pipeline symbol

Get-VSANInfo |
Export-Csv C:\vmware\powercli\reports\vSAN.csv -NoTypeInformation -UseCulture


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

JOJO2009
Contributor
Contributor

Line 222 

$magneticDiskCounter = ($vSanDisks | Where-Object {$_.IsSsd -eq $false}).Count

0 Kudos
LucD
Leadership
Leadership

Is there a question in there?


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

0 Kudos