Skip to content

Commit

Permalink
fix: add support 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 7bb91ba commit ddb9023
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

> Release Date: Not Released
Bugfix:

- 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)

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)
Expand Down
7 changes: 7 additions & 0 deletions SampleScripts/PowerManagement-ManagementDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,19 @@ if ($PsBoundParameters.ContainsKey("shutdown") -or $PsBoundParameters.ContainsKe
Write-PowerManagementLogMessage -Type INFO -Message "Trying to fetch all powered-on virtual machines from server $($vcServer.fqdn)..."
[Array]$allvms = Get-VMsWithPowerStatus -powerstate "poweredon" -server $vcServer.fqdn -user $vcUser -pass $vcPass -silence
$customervms = @()

Write-PowerManagementLogMessage -Type INFO -Message "Trying to fetch all powered-on vCLS virtual machines from server $($vcServer.fqdn)..."
[Array]$vclsvms += Get-VMsWithPowerStatus -powerstate "poweredon" -server $vcServer.fqdn -user $vcUser -pass $vcPass -pattern "(^vCLS-\w{8}-\w{4}-\w{4}-\w{4}-\w{12})|(^vCLS\s*\(\d+\))|(^vCLS\s*$)" -silence
foreach ($vm in $vclsvms) {
[Array]$vcfvms += $vm
}

Write-PowerManagementLogMessage -Type INFO -Message "Fetching all powered on vSAN File Services virtual machines from vCenter Server instance $($vcenter)..."
[Array]$vsanfsvms += Get-VMsWithPowerStatus -powerstate "poweredon" -server $vcServer -user $vcUser -pass $vcPass -pattern "(vSAN File)" -silence
foreach ($vm in $vsanfsvms) {
[Array]$vcfvms += $vm
}

$customervms = $allvms | ? { $vcfvms -notcontains $_ }
$vcfvms_string = $vcfvms -join "; "
Write-PowerManagementLogMessage -Type INFO -Message "Management virtual machines covered by the script: '$($vcfvms_string)' ."
Expand Down
6 changes: 6 additions & 0 deletions SampleScripts/PowerManagement-WorkloadDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ Try {
[Array]$vcfvms += $vm
}

Write-PowerManagementLogMessage -Type INFO -Message "Fetching all powered on vSAN File Services virtual machines from vCenter Server instance $($vcenter)..."
[Array]$vsanfsvms += Get-VMsWithPowerStatus -powerstate "poweredon" -server $vcServer -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
foreach ($nsxtManager in $nsxtNodes) {
Expand Down
4 changes: 2 additions & 2 deletions VMware.CloudFoundation.PowerManagement.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

# Module manifest for module 'VMware.CloudFoundation.PowerManagement'
# Generated by: Broadcom
# Generated on: 2024-02-07
# Generated on: 2024-02-15

@{

# Script module or binary module file associated with this manifest.
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 ddb9023

Please sign in to comment.