Skip to content

Commit 0b97476

Browse files
committed
Added status messages
I added some console messages so it's clear that the script is running.
1 parent d51fc57 commit 0b97476

File tree

2 files changed

+58
-10
lines changed

2 files changed

+58
-10
lines changed

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "PowerShell: Launch Current File",
9+
"type": "PowerShell",
10+
"request": "launch",
11+
"script": "${file}",
12+
"args": []
13+
}
14+
]
15+
}

VvolsReadinessCheckerV2.ps1

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,19 @@ If ($DefaultFlashArray.ArrayName) {
347347
write-host "Executing..."
348348

349349
# Check vCenter version
350+
Write-Host "Working on the following vCenter: " -NoNewline
351+
Write-Host "$($global:DefaultVIServers.Name)" -ForegroundColor Green -NoNewline
352+
Write-Host ", version " -NoNewline
353+
Write-Host "$($Global:DefaultVIServers.Version)" -ForegroundColor Green
354+
350355
add-content $logfile ""
351356
add-content $logfile "***********************************************************************************************"
352357
add-content $logfile ""
353358
add-content $logfile "Working on the following vCenter: $($global:DefaultVIServers.Name), version $($Global:DefaultVIServers.Version)"
354359
add-content $logfile ""
355360
add-content $logfile "***********************************************************************************************"
356-
add-content $logfile " Checking vCenter Version"
357-
add-content $logfile "-------------------------------------------------------"
361+
#add-content $logfile " Checking vCenter Version"
362+
#add-content $logfile "-------------------------------------------------------"
358363
if ($global:DefaultVIServers.version -le [Version]"6.5")
359364
{
360365
add-content $logfile "[****NEEDS ATTENTION****] vCenter 6.5 or later is required for VMware VVols."
@@ -370,40 +375,50 @@ $vCenterTime = Get-VamiTime
370375

371376
If ($vCenterTime.Mode -Like "NTP") {
372377
add-content $logfile "-----------------------------------------------------------------------------------------------"
373-
add-content $logfile " vCSA NTP "
378+
add-content $logfile " vCenter Appliance NTP info "
374379
add-content $logfile "-------------------------------------------------------"
375380
If ($vCenterTime.NTPStatus -eq "SERVER_REACHABLE") {
376381
add-content $logfile "NTP server set to $($vCenterTime.NTPServers) and is REACHABLE from vCenter"
377382
} else {
378383
add-content $logfile "-------------------------------------------------------"
379384
add-content $logfile "[****NEEDS ATTENTION****] NTP settings aren't checkable from the vCenter Appliance."
380-
add-content $logfile "Check VMware KB for manual process: https://knowledge.broadcom.com/external/article?articleNumber=313945"
385+
add-content $logfile "Check VMware KB for manual process: https://knowledge.broadcom.com/external/article?articleNumber=313945"
386+
Write-Host "[****NEEDS ATTENTION****] NTP settings aren't checkable from the vCenter Appliance." -BackgroundColor Red
381387
}
382388

383389
} else {
384390
add-content $logfile "*-------------------------------------------------------"
385391
add-content $logfile "[****NEEDS ATTENTION****] NTP settings aren't checkable from the vCenter Appliance."
386-
add-content $logfile "Check VMware KB for manual process: https://knowledge.broadcom.com/external/article?articleNumber=313945."
392+
add-content $logfile "Check VMware KB for manual process: https://knowledge.broadcom.com/external/article?articleNumber=313945."
393+
Write-Host "[****NEEDS ATTENTION****] NTP settings aren't checkable from the vCenter Appliance." -BackgroundColor Red
387394
}
388395

389396

390397
# Iterating through each ESX host in the vCenter
391398
add-content $logfile ""
392399
add-content $logfile "Iterating through all ESXi hosts in the cluster $clusterName..."
400+
Write-Host "Iterating through all ESXi hosts in the cluster $clusterName..."
401+
393402
$ESXHosts | out-string | add-content $logfile
394403
foreach ($esx in $ESXHosts)
395404
{
405+
Write-Host "Working on the following ESXi host: " -NoNewline
406+
Write-Host "$($esx.Name)" -ForegroundColor Green -NoNewline
407+
Write-Host ", version " -NoNewline
408+
Write-Host "$($esx.Version)" -ForegroundColor Green
409+
396410
add-content $logfile ""
397411
add-content $logfile "***********************************************************************************************"
398412
add-content $logfile ""
399413
add-content $logfile " Working on the following ESXi host: $($esx.Name), version $($esx.Version)"
400414
add-content $logfile ""
401415
add-content $logfile "***********************************************************************************************"
402-
add-content $logfile " Checking ESXi Version"
403-
add-content $logfile "-------------------------------------------------------"
416+
#add-content $logfile " Checking ESXi Version"
417+
#add-content $logfile "-------------------------------------------------------"
404418
# Check for ESXi version
405419
if ($esx.version -le [Version]"7.0")
406420
{
421+
Write-Host "[****NEEDS ATTENTION****] ESXi 7.0U3 or later is required for this script to assess VMware VVols readiness." -ForegroundColor Red
407422
add-content $logfile "[****NEEDS ATTENTION****] ESXi 7.0U3 or later is required for this script to assess VMware VVols readiness."
408423
}
409424
else
@@ -421,7 +436,8 @@ foreach ($esx in $ESXHosts)
421436
$ntpServer = Get-VMHostNtpServer -VMHost $esx
422437
if ($ntpServer -eq $null)
423438
{
424-
Add-Content $logfile "[****NEEDS ATTENTION****] NTP server for this ESXi host is empty. Configure an NTP server before proceeding with VVols."
439+
Write-Host "[****NEEDS ATTENTION****] NTP server for this ESXi host is empty. Configure an NTP server before proceeding with VVols." -BackgroundColor Red
440+
Add-Content $logfile "[****NEEDS ATTENTION****] NTP server for this ESXi host is empty. Configure an NTP server before proceeding with VVols."
425441
}
426442
else
427443
{
@@ -449,6 +465,7 @@ else
449465

450466
if ($ntpSettings."policy" -contains "off")
451467
{
468+
Write-Host "[****NEEDS ATTENTION****] NTP daemon is not enabled. Enable the service in the ESXi host configuration." -BackgroundColor Red
452469
Add-Content $logfile "[****NEEDS ATTENTION****] NTP daemon is not enabled. Enable the service in the ESXi host configuration."
453470
}
454471
else
@@ -462,6 +479,7 @@ else
462479
}
463480
else
464481
{
482+
Write-Host "[****NEEDS ATTENTION****] NTP daemon is not running." -BackgroundColor Red
465483
Add-Content $logfile "[****NEEDS ATTENTION****] NTP daemon is not running."
466484
}
467485
}
@@ -489,6 +507,12 @@ foreach ($provider in $storageProviders) {
489507

490508
# Check FlashArray's NTP Settings
491509
$FlashArray = get-pfa2array -array $DefaultFlashArray
510+
511+
Write-Host "Working on the following FlashArray: " -NoNewline
512+
Write-Host "$($Flasharray.Name)" -ForegroundColor Green -NoNewline
513+
Write-Host ", Purity version " -NoNewline
514+
Write-Host "$($Flasharray.Version)" -ForegroundColor Green
515+
492516
add-content $logfile ""
493517
add-content $logfile "***********************************************************************************************"
494518
add-content $logfile ""
@@ -502,6 +526,7 @@ add-content $logfile "-------------------------------------------------------"
502526
$FlashArrayNTP = get-pfa2ArrayNtpTest -Array $DefaultFlashArray
503527
if (!$flashArrayNTP.Enabled)
504528
{
529+
Write-Host "[****NEEDS ATTENTION****] FlashArray does not have an NTP server configured." -BackgroundColor Red
505530
Add-Content $logfile "[****NEEDS ATTENTION****] FlashArray does not have an NTP server configured."
506531
}
507532
else
@@ -511,6 +536,7 @@ else
511536

512537
if (!$flashArrayNTP.Success)
513538
{
539+
Write-Host "[****NEEDS ATTENTION****] Could not communicate with an NTP server from this FlashArray. Check that it is valid and accessible." -BackgroundColor Red
514540
Add-Content $logfile "[****NEEDS ATTENTION****] Could not communicate with an NTP server from this FlashArray. Check that it is valid and accessible."
515541

516542
}
@@ -530,7 +556,8 @@ if ($Flasharray.Version -ge [Version]"6.5")
530556
Add-Content $logfile "Purity version supports VVols."
531557
}
532558
else
533-
{
559+
{
560+
Write-Host "[****NEEDS ATTENTION****] Purity version not recommended for VVols. Contact Pure Storage support to upgrade to Purity version 5.3.6 or later." -BackgroundColor Red
534561
Add-Content $logfile "[****NEEDS ATTENTION****] Purity version not recommended for VVols. Contact Pure Storage support to upgrade to Purity version 5.3.6 or later."
535562
}
536563

@@ -540,7 +567,8 @@ add-content $logfile "-------------------------------------------------------"
540567
add-content $logfile " Checking FlashArray Reachability on TCP port 8084"
541568
add-content $logfile "-------------------------------------------------------"
542569

543-
$Interfaces = Get-Pfa2NetworkInterface -array $DefaultFlashArray | Where-Object {$_.services -Like "management"} | Where-Object {$_.name -Like "ct*"} | Where-Object {$_.enabled -eq "True"}
570+
#$Interfaces = Get-Pfa2NetworkInterface -array $DefaultFlashArray | Where-Object {$_.services -Like "management"} | Where-Object {$_.name -Like "ct*"} | Where-Object {$_.enabled -eq "True"}
571+
$Interfaces = Get-Pfa2NetworkInterface -array $DefaultFlashArray -Filter "services='management' and name='ct*'and enabled='true'"
544572
$i = 0
545573
foreach ($interface in $interfaces)
546574
{
@@ -553,6 +581,7 @@ foreach ($interface in $interfaces)
553581

554582
if (!$testNetConnection)
555583
{
584+
Write-Host "[****NEEDS ATTENTION****] Could not reach FlashArray management port $($interface.name), IP: $($interfaces[$i].eth.address) on TCP port 8084." -BackgroundColor Red
556585
add-content $logfile "[****NEEDS ATTENTION****] Could not reach FlashArray management port $($interface.name), IP: $($interfaces[$i].eth.address) on TCP port 8084."
557586

558587
}
@@ -587,6 +616,7 @@ if ($PureHostGroups.count -gt 0 -or $PureHosts -gt 0)
587616
}
588617
else
589618
{
619+
Write-Host "[****NEEDS ATTENTION****] FlashArray does not have any Pure Host Objects or Pure Host Groups configured." -BackgroundColor Red
590620
Add-Content $logfile "[****NEEDS ATTENTION****] FlashArray does not have any Pure Host Objects or Pure Host Groups configured."
591621
}
592622
<#
@@ -615,10 +645,13 @@ If ($ConnectFA -eq $true) {
615645
Disconnect-Pfa2Array -Array $DefaultFlashArray
616646
Add-Content $Logfile ""
617647
Add-Content $Logfile "Disconnected from FlashArray: $($Flasharray.Name)"
648+
Write-Host "Disconnected from FlashArray: $($Flasharray.Name)"
618649
}
619650

620651
If ($ConnectVc -eq $true) {
621652
Disconnect-VIserver -Server $VIFQDN -confirm:$false
622653
Add-Content $Logfile ""
623654
Add-Content $Logfile "Disconnected from vCenter: $($Global:DefaultCisServers.Name)"
655+
Write-Host "Disconnected from vCenter: $($Global:DefaultCisServers.Name)"
656+
Write-Host "Done!!" -BackgroundColor Green
624657
}

0 commit comments

Comments
 (0)