Skip to content

Fix the validation of CPVMs states in multiple zones#13021

Open
Tonitzpp wants to merge 1 commit intoapache:4.20from
scclouds:validate-cpvm-state-in-multiple-zones
Open

Fix the validation of CPVMs states in multiple zones#13021
Tonitzpp wants to merge 1 commit intoapache:4.20from
scclouds:validate-cpvm-state-in-multiple-zones

Conversation

@Tonitzpp
Copy link
Copy Markdown
Contributor

@Tonitzpp Tonitzpp commented Apr 14, 2026

Description

Currently, during the deployment of CPVMs, CloudStack validates whether there are already CPVMs in the Starting or Stopping state in the environment, in order to avoid duplicate provisioning. However, this operation does not filter for zones. Therefore, if there is more than one zone in the environment, and in one of these zones there is a CPVM in one of these states, the CPVMs of other zones will not be created.

Changes were made to consider only the zone in which the CPVM will be created.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

In an environment with two configured zones, zn-01 and zn-02, I started the zn-01 and waited for its system VMs to start while zone zn-02 was deactivated. After the system VMs in zone zn-01 were in the Running state, I changed their states to Starting in the database and activated zone zn-02. I went to the system VMs tab and observed that the system VMs in zn-02 were being created while those in zone zn-01 were in the Starting state.

Comment on lines +1528 to +1530
List<ConsoleProxyVO> l = consoleProxyDao.getProxyListInStates(dataCenterId, State.Starting, State.Stopping);
if (!l.isEmpty()) {
logger.debug("Zone {} has {} console proxy VM(s) in transition state.", zone, l.size());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List<ConsoleProxyVO> l = consoleProxyDao.getProxyListInStates(dataCenterId, State.Starting, State.Stopping);
if (!l.isEmpty()) {
logger.debug("Zone {} has {} console proxy VM(s) in transition state.", zone, l.size());
List<ConsoleProxyVO> consoleProxiesInTransitionStates = consoleProxyDao.getProxyListInStates(dataCenterId, State.Starting, State.Stopping);
if (!consoleProxiesInTransitionStates.isEmpty()) {
logger.debug("Zone {} has {} console proxy VM(s) in transition state.", zone, consoleProxiesInTransitionStates.size());

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.26%. Comparing base (6f1aa96) to head (b87d32b).
⚠️ Report is 2 commits behind head on 4.20.

Files with missing lines Patch % Lines
...om/cloud/consoleproxy/ConsoleProxyManagerImpl.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #13021      +/-   ##
============================================
- Coverage     16.26%   16.26%   -0.01%     
+ Complexity    13434    13431       -3     
============================================
  Files          5665     5665              
  Lines        500530   500529       -1     
  Branches      60787    60786       -1     
============================================
- Hits          81411    81409       -2     
  Misses       410028   410028              
- Partials       9091     9092       +1     
Flag Coverage Δ
uitests 4.15% <ø> (ø)
unittests 17.11% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants