Skip to content

fix: skip non-HA cinder-volume deploy when HA app exists#797

Closed
ahmad-can wants to merge 1 commit into
canonical:mainfrom
ahmad-can:fix/skip-cinder-volume-deploy-when-ha-exists
Closed

fix: skip non-HA cinder-volume deploy when HA app exists#797
ahmad-can wants to merge 1 commit into
canonical:mainfrom
ahmad-can:fix/skip-cinder-volume-deploy-when-ha-exists

Conversation

@ahmad-can
Copy link
Copy Markdown

Prevent duplicate cinder-volume applications by checking for existing HA app before deploying non-HA, and skipping HA deploy when only non-HA backends exist.

@ahmad-can ahmad-can requested a review from Copilot May 18, 2026 12:46
@ahmad-can ahmad-can force-pushed the fix/skip-cinder-volume-deploy-when-ha-exists branch from 88128b1 to 4202f08 Compare May 18, 2026 12:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Prevents duplicate cinder-volume deployments by adding is_skip logic on both sides of the HA/non-HA split, and rewrites the non-HA backend's principal to the HA app at deploy time if the HA app already exists.

Changes:

  • Add DeployCinderVolumeApplicationStep.is_skip that skips the HA deploy when every registered storage backend's principal is non-HA.
  • Add DeploySpecificCinderVolumeStep.is_skip and a run() fixup that skip / re-target non-HA deploys when the HA cinder-volume app already exists in the model.
  • Add unit tests for the new skip/proceed branches in both files.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
sunbeam-python/sunbeam/steps/cinder_volume.py New is_skip on the HA deploy step, gated by registered storage backends.
sunbeam-python/sunbeam/storage/steps.py New ApplicationNotFoundException import; run() override of principal_application when HA app exists; new is_skip HA-app-exists branch for the specific (non-HA) deploy step.
sunbeam-python/tests/unit/sunbeam/steps/test_cinder_volume.py Unit tests for the new HA is_skip branches.
sunbeam-python/tests/unit/sunbeam/storage/test_steps.py Unit tests for the new specific cinder-volume is_skip branches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sunbeam-python/sunbeam/steps/cinder_volume.py Outdated
Comment thread sunbeam-python/tests/unit/sunbeam/storage/test_steps.py Outdated
Comment thread sunbeam-python/sunbeam/storage/steps.py
Comment thread sunbeam-python/sunbeam/storage/steps.py
Comment thread sunbeam-python/sunbeam/storage/steps.py
@ahmad-can ahmad-can force-pushed the fix/skip-cinder-volume-deploy-when-ha-exists branch 2 times, most recently from b966564 to 1d386b8 Compare May 18, 2026 13:32
@ahmad-can ahmad-can marked this pull request as ready for review May 18, 2026 13:40
Copy link
Copy Markdown
Collaborator

@hemanthnakkina hemanthnakkina left a comment

Choose a reason for hiding this comment

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

minor inline comments

try:
self.jhelper.get_application(APPLICATION, self.model)
backends[backend_key]["principal_application"] = APPLICATION
actual_principal = APPLICATION
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you add log to mention the principal is overrided

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

self.jhelper.get_application(APPLICATION, self.model)
backends[backend_key]["principal_application"] = APPLICATION
actual_principal = APPLICATION
except ApplicationNotFoundException:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need to handle JujuException here.. its done in other class

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

deployment_with_tfhelpers, "telemetry"
)

def test_is_skip_no_backends_proceeds(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add test where there is HA and non-HA backend exists

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Prevent duplicate cinder-volume applications by checking for existing HA
app before deploying non-HA, and skipping HA deploy when only non-HA backends exist.

Signed-off-by: Ahmad Hassan <ahmad.hassan@canonical.com>
@ahmad-can ahmad-can force-pushed the fix/skip-cinder-volume-deploy-when-ha-exists branch from 1d386b8 to 61b695a Compare May 19, 2026 07:21
@gboutry
Copy link
Copy Markdown
Collaborator

gboutry commented May 19, 2026

I haven't looked at the content yet, but I don't understand skip non-HA cinder-volume deploy when HA app exists

Do you mean you want to deploy non-HA app on the HA instance when it exists?

@ahmad-can
Copy link
Copy Markdown
Author

@gboutry Not deploying a non-HA app on the HA instance.Preventing the non-HA app from being deployed at all — the non-HA backend reuses the existing HA app as its principal instead.

@gboutry
Copy link
Copy Markdown
Collaborator

gboutry commented May 19, 2026

@gboutry Not deploying a non-HA app on the HA instance.Preventing the non-HA app from being deployed at all — the non-HA backend reuses the existing HA app as its principal instead.

I still don't get it. We want the non-ha app because we want to ensure we have only a single principal handling volume requests. non-ha apps are actually apps that don't handle active/active deployments.

You don't want the non-ha to be attached to multi-units deployments until we support active/passive HA.

@ahmad-can
Copy link
Copy Markdown
Author

closing as this is the expected behaviour to have cinder-volume-noha running for non-ha storage backends and cinder-volume co exist for ceph.

@ahmad-can ahmad-can closed this May 20, 2026
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.

4 participants