Skip to content

Commit

Permalink
feat: add support for aria operations for logs shutdown
Browse files Browse the repository at this point in the history
Added option to  check if Aria Operation for Logs exists and gracefully shutdown the components in `PowerManagement-ManagementDomain.ps1`.

Signed-off-by: Jared Burns <jared.burns@broadcom.com>
  • Loading branch information
burnsjared0415 authored and tenthirtyam committed Jan 23, 2024
1 parent 0756647 commit 3eb62ba
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## v1.4.2

> Release Date: Not Released
- Added Check for vRLI deployment and will shutdown if it exist `Get-vRSLCMEnvironmentVMs` [GH-87] https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-power-management/pull/87

## v1.4.1

> Release Date: Not Released
Expand Down
24 changes: 23 additions & 1 deletion SampleScripts/PowerManagement-ManagementDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,28 @@ if ($PsBoundParameters.ContainsKey("shutdown") -or $PsBoundParameters.ContainsKe
Exit
}
}
# Check if vRLI Exist in environment, if so it will shutdown the vRLI nodes
if (Test-VCFConnection -server $server) {
if (Test-VCFAuthentication -server $server -user $user -pass $pass) {
if (($vcfVrslcmDetails = Get-vRSLCMServerDetail -fqdn $server -username $user -password $pass)) {
if (Test-vRSLCMAuthentication -server $vcfVrslcmDetails.fqdn -user $vcfVrslcmDetails.adminUser -pass $vcfVrslcmDetails.adminPass) {
$productid = "vrli"
$vmlist = Get-vRSLCMEnvironmentVMs -server $server -user $user -pass $pass -productid $productid
if ($vmlist -ne $null) {
$domain = Get-VCFWorkloadDomain | Select-Object name, type | Where-Object { $_.type -eq "MANAGEMENT" }
if (($vcfVcenterDetails = Get-vCenterServerDetail -server $server -user $user -pass $pass -domain $domain.name)) {
if (Test-vSphereConnection -server $($vcfVcenterDetails.fqdn)) {
if (Test-vSphereAuthentication -server $vcfVcenterDetails.fqdn -user $vcfVcenterDetails.ssoAdmin -pass $vcfVcenterDetails.ssoAdminPass) {
Write-PowerManagementLogMessage -Type INFO -Message "Stopping the Aria Operations for Logs nodes..." -Colour Green
Stop-CloudComponent -server $vcfVcenterDetails.fqdn -user $vcfVcenterDetails.ssoAdmin -pass $vcfVcenterDetails.ssoAdminPass -nodes $vmlist -timeout 600
}
}
}
}
}
}
}
}

# Check if there are any running Virtual Machines on the Overlay Networks before shutting down Edge Cluster.
if ($nsxtEdgeNodes) {
Expand All @@ -516,7 +538,7 @@ if ($PsBoundParameters.ContainsKey("shutdown") -or $PsBoundParameters.ContainsKe
$vmName = $vm.Name
$powerState = $vm.PowerState
if ($powerState -eq "PoweredOn") {
Write-Output "VM Name: $vmName, Power State: $powerState, Please power off the VM(s) Connect to NSX-T Segments before you shutdown Edge Cluster"
Write-PowerManagementLogMessage -Type Error -Message "VM Name: $vmName, Power State: $powerState, Please power off the VM(s) Connect to NSX-T Segments before you shutdown Edge Cluster" -Colour Red
$stopExecuted = $true
}
if (-not $stopExecuted) {
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.1001'
ModuleVersion = '1.4.2.1001'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down

0 comments on commit 3eb62ba

Please sign in to comment.