Skip to content

Commit d51fc57

Browse files
committed
Made some minor formatting tweaks
1 parent 496223b commit d51fc57

File tree

2 files changed

+40
-150
lines changed

2 files changed

+40
-150
lines changed

PureStorage-vSphere-CheckvVolReadiness-2024-10-02T17.31.30.2952027-07.00.log

Lines changed: 0 additions & 114 deletions
This file was deleted.

VvolsReadinessCheckerV2.ps1

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ This script will:
2727
--Check for vCenter 7.0U3+ and ESXi 7.0U3+ (7.0 Update 3 is highly recommended)
2828
--Check that FlashArray is accessible on TCP port 8084
2929
--Check that a NTP server is set, valid, and daemon running on ESXi hosts and FlashArray
30-
--Check for replication, remote side needs to meet above criteria too!
3130
3231
All information logged to a file.
3332
@@ -263,7 +262,6 @@ Write-Host ""
263262
Write-Host "Script result log can be found at $Logfile" -ForegroundColor Green
264263
Write-Host ""
265264
Add-Content $Logfile "Connected to vCenter: $($Global:DefaultVIServer)"
266-
Add-Content $Logfile '----------------------------------------------------------------------------------------------------'
267265

268266
# Choose to run the script against all hosts connected to a vCenter Server, or a single cluster
269267
Do{ $vSphereClusterChoice = Read-Host "Would you prefer to limit this to hosts in a specific cluster? (y/n)" }
@@ -307,7 +305,7 @@ if ($vSphereClusterChoice -match "[yY]") {
307305
Write-Host $vSphereCluster -ForegroundColor Green
308306
Write-Host ""
309307

310-
# Assign all of the ESX hosts in $Cluster to the $ESXHosts variable, and sort the list alphabetically
308+
# Assign all of the ESX hosts in $vSphereCluster to the $ESXHosts variable, and sort the list alphabetically
311309
$ESXHosts = $vSphereCluster | Get-VMHost | Sort-Object Name
312310

313311
} else {
@@ -335,23 +333,27 @@ If ($DefaultFlashArray.ArrayName) {
335333
write-host "Failed to connect to FlashArray" -BackgroundColor Red
336334
write-host $Error
337335
write-host "Terminating Script" -BackgroundColor Red
338-
add-content $logfile "Failed to connect to FlashArray"
336+
add-content $logfile "********** Failed to connect to FlashArray **********"
339337
add-content $logfile $Error
340-
add-content $logfile "Terminating Script"
338+
add-content $logfile "********** Terminating Script **********"
341339
$ConnectFA = $False
342340

343341
return
344342
}
345343

346344
}
347345

348-
$errorHosts = @()
346+
#$errorHosts = @()
349347
write-host "Executing..."
350348

351349
# Check vCenter version
352-
add-content $logfile "Working on the following vCenter: $($global:DefaultVIServers.name), version $($Global:DefaultVIServers.Version)"
353-
add-content $logfile "-----------------------------------------------------------------------------------------------"
354-
add-content $logfile "Checking vCenter Version"
350+
add-content $logfile ""
351+
add-content $logfile "***********************************************************************************************"
352+
add-content $logfile ""
353+
add-content $logfile "Working on the following vCenter: $($global:DefaultVIServers.Name), version $($Global:DefaultVIServers.Version)"
354+
add-content $logfile ""
355+
add-content $logfile "***********************************************************************************************"
356+
add-content $logfile " Checking vCenter Version"
355357
add-content $logfile "-------------------------------------------------------"
356358
if ($global:DefaultVIServers.version -le [Version]"6.5")
357359
{
@@ -368,19 +370,19 @@ $vCenterTime = Get-VamiTime
368370

369371
If ($vCenterTime.Mode -Like "NTP") {
370372
add-content $logfile "-----------------------------------------------------------------------------------------------"
371-
add-content $logfile "vCSA NTP "
373+
add-content $logfile " vCSA NTP "
372374
add-content $logfile "-------------------------------------------------------"
373375
If ($vCenterTime.NTPStatus -eq "SERVER_REACHABLE") {
374376
add-content $logfile "NTP server set to $($vCenterTime.NTPServers) and is REACHABLE from vCenter"
375377
} else {
376378
add-content $logfile "-------------------------------------------------------"
377-
add-content $logfile "[****NEEDS ATTENTION****] vCSA's NTP settings aren't checkable."
379+
add-content $logfile "[****NEEDS ATTENTION****] NTP settings aren't checkable from the vCenter Appliance."
378380
add-content $logfile "Check VMware KB for manual process: https://knowledge.broadcom.com/external/article?articleNumber=313945"
379381
}
380382

381383
} else {
382384
add-content $logfile "*-------------------------------------------------------"
383-
add-content $logfile "[****NEEDS ATTENTION****] vCSA's NTP settings aren't checkable."
385+
add-content $logfile "[****NEEDS ATTENTION****] NTP settings aren't checkable from the vCenter Appliance."
384386
add-content $logfile "Check VMware KB for manual process: https://knowledge.broadcom.com/external/article?articleNumber=313945."
385387
}
386388

@@ -393,11 +395,11 @@ foreach ($esx in $ESXHosts)
393395
{
394396
add-content $logfile ""
395397
add-content $logfile "***********************************************************************************************"
396-
add-content $logfile "**********************************NEXT ESXi HOST***********************************************"
397-
add-content $logfile "-----------------------------------------------------------------------------------------------"
398-
add-content $logfile "Working on the following ESXi host: $($esx.Name), version $($esx.Version)"
399-
add-content $logfile "-----------------------------------------------------------------------------------------------"
400-
add-content $logfile "Checking ESXi Version"
398+
add-content $logfile ""
399+
add-content $logfile " Working on the following ESXi host: $($esx.Name), version $($esx.Version)"
400+
add-content $logfile ""
401+
add-content $logfile "***********************************************************************************************"
402+
add-content $logfile " Checking ESXi Version"
401403
add-content $logfile "-------------------------------------------------------"
402404
# Check for ESXi version
403405
if ($esx.version -le [Version]"7.0")
@@ -410,7 +412,7 @@ foreach ($esx in $ESXHosts)
410412
}
411413
add-content $logfile ""
412414
add-content $logfile "-------------------------------------------------------"
413-
add-content $logfile "Checking NTP settings"
415+
add-content $logfile " Checking NTP settings"
414416
add-content $logfile "-------------------------------------------------------"
415417

416418
# Check for NTP server configuration
@@ -419,11 +421,11 @@ foreach ($esx in $ESXHosts)
419421
$ntpServer = Get-VMHostNtpServer -VMHost $esx
420422
if ($ntpServer -eq $null)
421423
{
422-
Add-Content $logfile "[****NEEDS ATTENTION****] NTP server for this ESXi host is null. Configure an NTP server before proceeding with VVols."
424+
Add-Content $logfile "[****NEEDS ATTENTION****] NTP server for this ESXi host is empty. Configure an NTP server before proceeding with VVols."
423425
}
424426
else
425427
{
426-
Add-Content $logfile "NTP server set to $($ntpServer)"
428+
Add-Content $logfile " NTP server set to $($ntpServer)"
427429
If ($PSEdition -eq "Core") {
428430
$testNetConnection = Test-Connection -TargetName $ntpserver
429431
} else {
@@ -433,11 +435,11 @@ else
433435

434436
if (!$testNetConnection)
435437
{
436-
Add-Content $logfile "[****NEEDS ATTENTION****] Could not communicate with NTP server from this console. Check that it is valid and accessible."
438+
Add-Content $logfile "[****NEEDS ATTENTION****] Could not communicate with the NTP server from this console. Check that it is valid and accessible."
437439
}
438440
else
439441
{
440-
Add-Content $logfile "NTP server is valid and accessible."
442+
Add-Content $logfile " NTP server is valid and accessible."
441443
}
442444
}
443445

@@ -447,16 +449,16 @@ else
447449

448450
if ($ntpSettings."policy" -contains "off")
449451
{
450-
Add-Content $logfile "[****NEEDS ATTENTION****] NTP daemon not enabled. Enable service in the ESXi host configuration."
452+
Add-Content $logfile "[****NEEDS ATTENTION****] NTP daemon is not enabled. Enable the service in the ESXi host configuration."
451453
}
452454
else
453455
{
454-
Add-Content $logfile "NTP daemon is enabled."
456+
Add-Content $logfile " NTP daemon is enabled."
455457
}
456458

457459
if ($ntpSettings."running" -contains "true")
458460
{
459-
Add-Content $logfile "NTP daemon is running."
461+
Add-Content $logfile " NTP daemon is running."
460462
}
461463
else
462464
{
@@ -489,13 +491,13 @@ foreach ($provider in $storageProviders) {
489491
$FlashArray = get-pfa2array -array $DefaultFlashArray
490492
add-content $logfile ""
491493
add-content $logfile "***********************************************************************************************"
492-
add-content $logfile "***************************** FLASHARRAY **********************************************"
493-
add-content $logfile "-----------------------------------------------------------------------------------------------"
494-
add-content $logfile "Working on the following FlashArray: $($Flasharray.Name), Purity version $($Flasharray.Version)"
495-
add-content $logfile "-----------------------------------------------------------------------------------------------"
494+
add-content $logfile ""
495+
add-content $logfile " Working on the following FlashArray: $($Flasharray.Name), Purity version $($Flasharray.Version)"
496+
add-content $logfile ""
497+
add-content $logfile "***********************************************************************************************"
496498
add-content $logfile ""
497499
add-content $logfile "-------------------------------------------------------"
498-
add-content $logfile " Checking NTP Setting"
500+
add-content $logfile " Checking NTP Setting"
499501
add-content $logfile "-------------------------------------------------------"
500502
$FlashArrayNTP = get-pfa2ArrayNtpTest -Array $DefaultFlashArray
501503
if (!$flashArrayNTP.Enabled)
@@ -509,7 +511,7 @@ else
509511

510512
if (!$flashArrayNTP.Success)
511513
{
512-
Add-Content $logfile "[****NEEDS ATTENTION****] Could not communicate with NTP server from this FlashArray. Check that it is valid and accessible."
514+
Add-Content $logfile "[****NEEDS ATTENTION****] Could not communicate with an NTP server from this FlashArray. Check that it is valid and accessible."
513515

514516
}
515517
else
@@ -520,7 +522,7 @@ else
520522
# Check Purity version
521523
add-content $logfile ""
522524
add-content $logfile "-------------------------------------------------------"
523-
add-content $logfile "Checking Purity Version"
525+
add-content $logfile " Checking Purity Version"
524526
add-content $logfile "-------------------------------------------------------"
525527

526528
if ($Flasharray.Version -ge [Version]"6.5")
@@ -535,7 +537,7 @@ else
535537
# Check TCP port 8084 reachability
536538
add-content $logfile ""
537539
add-content $logfile "-------------------------------------------------------"
538-
add-content $logfile "Checking FlashArray Reachability on TCP port 8084"
540+
add-content $logfile " Checking FlashArray Reachability on TCP port 8084"
539541
add-content $logfile "-------------------------------------------------------"
540542

541543
$Interfaces = Get-Pfa2NetworkInterface -array $DefaultFlashArray | Where-Object {$_.services -Like "management"} | Where-Object {$_.name -Like "ct*"} | Where-Object {$_.enabled -eq "True"}
@@ -578,12 +580,14 @@ for ($x=0; $x -lt $PureHostGroups.count; $x++)
578580

579581
if ($PureHostGroups.count -gt 0 -or $PureHosts -gt 0)
580582
{
581-
Add-Content $logfile "FlashArray has $($PureHostGroups.count) Pure Host Groups set."
582-
Add-Content $logfile "FlashArray has $($PureHosts) Pure Host Objects set."
583+
Add-Content $logfile "FlashArray has $($PureHosts) Pure Host Objects set."
584+
Add-Content $logfile "FlashArray has $($PureHostGroups.count) Pure Host Groups set."
585+
add-content $logfile "***********************************************************************************************"
586+
Add-Content $logfile ""
583587
}
584588
else
585589
{
586-
Add-Content $logfile "[****NEEDS ATTENTION****] FlashArray does not have any hosts or host groups configured."
590+
Add-Content $logfile "[****NEEDS ATTENTION****] FlashArray does not have any Pure Host Objects or Pure Host Groups configured."
587591
}
588592
<#
589593
# Check for replication

0 commit comments

Comments
 (0)