Skip to content

Fix Instance Backup related events#13180

Open
abh1sar wants to merge 2 commits into
apache:mainfrom
shapeblue:backup-events
Open

Fix Instance Backup related events#13180
abh1sar wants to merge 2 commits into
apache:mainfrom
shapeblue:backup-events

Conversation

@abh1sar
Copy link
Copy Markdown
Contributor

@abh1sar abh1sar commented May 18, 2026

Description

This PR fixes #11727 #9465

#9465
Backup related events for cmds AssignVirtualMachineToBackupOfferingCmd, RemoveVirtualMachineFromBackupOfferingCmd, CreateBackupScheduleCmd and RestoreVolumeFromBackupAndAttachToVMCmd don't have proper ApiResourceType set.
So they are not currently displayed in Instances' events section.

#11727
If CreateBackupCmd success or fails, it throws a Complete or Error event, but the event doesn't have the Instance Id set as the resource_id.
Due to this, in the Instance's events tab, Start event is present for CreateBackup but Complete or Error events are not present which makes it hard to track failed backups.

This PR fixes both of the above issues.

P.S, Also made changes to replace VM with Instance and added capitalisation of resource names in Event msgs and Exceptions.

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

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Backup offering Assign and Remove events in Instance's Events tab:
Screenshot 2026-05-18 at 10 51 42 AM

RestoreVolumeFromBackupAndAttachToVM events in Instance's Events tab:
Screenshot 2026-05-18 at 1 44 52 PM

Backup Create Completed and Error events in Instance's Events tab:
Screenshot 2026-05-18 at 11 47 15 AM

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 12.30769% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.08%. Comparing base (5893ba5) to head (014b84f).

Files with missing lines Patch % Lines
...rg/apache/cloudstack/backup/BackupManagerImpl.java 21.62% 29 Missing ⚠️
...ackup/AssignVirtualMachineToBackupOfferingCmd.java 0.00% 6 Missing ⚠️
...i/command/user/backup/CreateBackupScheduleCmd.java 0.00% 6 Missing ⚠️
...kup/RemoveVirtualMachineFromBackupOfferingCmd.java 0.00% 6 Missing ⚠️
...ackup/RestoreVolumeFromBackupAndAttachToVMCmd.java 0.00% 6 Missing ⚠️
...stack/api/command/user/backup/CreateBackupCmd.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13180      +/-   ##
============================================
- Coverage     18.09%   18.08%   -0.01%     
+ Complexity    16723    16717       -6     
============================================
  Files          6037     6037              
  Lines        542580   542604      +24     
  Branches      66427    66427              
============================================
- Hits          98155    98133      -22     
- Misses       433399   433444      +45     
- Partials      11026    11027       +1     
Flag Coverage Δ
uitests 3.51% <ø> (ø)
unittests 19.24% <12.30%> (-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.

@vishesh92 vishesh92 linked an issue May 18, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm

@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented May 18, 2026

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17896

Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NAS Backup - Raise Event for Succeeded / Failed / Timed Out Backup offerings events are not present in this view

4 participants