Skip to content

Commit

Permalink
Bug: Added Suport for vSAN File Services
Browse files Browse the repository at this point in the history
Added support to `PowerManagement-ManagmentDomain.ps1` and `PowerManagement-WorkloadDomain.ps1` for vSAN File Services to be excluded from Customer Virtual Machines

Signed-off-by: Jared Burns <[email protected]>
  • Loading branch information
burnsjared0415 committed Feb 15, 2024
1 parent 8adf431 commit 51621e3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Enhancement:
- Added check for VMware Aria Operations for Logs deployment and shutdown if it exists. [GH-87](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-power-management/pull/87)
- Added a workload domain vCenter Server check to `PowerManagement-ManagmentDomain.ps1` to check if workload domain vCenter Server instances are still powered on before starting the shutdown of the management domain. [GH-90](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-power-management/pull/90)
- Added support to `PowerManagement-ManagmentDomain.ps1` for more than one cluster in management domain for shut down and start up. [GH-93] (https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-power-management/pull/93)
- Added support to `PowerManagement-ManagmentDomain.ps1` and `PowerManagement-WorkloadDomain.ps1` for vSAN File Services to be excluded from Customer Virtual Machines [GH-94] (https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-power-management/pull/94)

Refactor:

Expand Down
6 changes: 6 additions & 0 deletions SampleScripts/PowerManagement-ManagementDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,12 @@ if ($PsBoundParameters.ContainsKey("shutdown") -or $PsBoundParameters.ContainsKe
foreach ($vm in $vclsvms) {
[Array]$vcfvms += $vm
}
Write-PowerManagementLogMessage -Type INFO -Message "Trying to fetch all powered-on vSAN File Services virtual machines from server $($vcenter)..."
[Array]$vsanfsvms += Get-VMsWithPowerStatus -powerstate "poweredon" -server $vcServer.fqdn -user $vcUser -pass $vcPass -pattern "(vSAN File)" -silence
foreach ($vm in $vsanfsvms) {
[Array]$vcfvms += $vm
}


$customervms = $allvms | ? { $vcfvms -notcontains $_ }
$vcfvms_string = $vcfvms -join "; "
Expand Down
5 changes: 5 additions & 0 deletions SampleScripts/PowerManagement-WorkloadDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ Try {
foreach ($vm in $vclsvms) {
[Array]$vcfvms += $vm
}
Write-PowerManagementLogMessage -Type INFO -Message "Trying to fetch all powered-on vSAN File Services virtual machines from server $($vcenter)..."
[Array]$vsanfsvms += Get-VMsWithPowerStatus -powerstate "poweredon" -server $vcServer.fqdn -user $vcUser -pass $vcPass -pattern "(vSAN File)" -silence
foreach ($vm in $vsanfsvms) {
[Array]$vcfvms += $vm
}

#Check if NSX-T manager VMs are running. If they are stopped skip NSX-T edge shutdown
$nsxManagerPowerOnVMs = 0
Expand Down
2 changes: 1 addition & 1 deletion VMware.CloudFoundation.PowerManagement.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
RootModule = 'VMware.CloudFoundation.PowerManagement.psm1'

# Version number of this module.
ModuleVersion = '1.4.1.1006'
ModuleVersion = '1.4.1.1007'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down

0 comments on commit 51621e3

Please sign in to comment.