Skip to content

backup: remove the powered-off precondition for all backup providers - #14094

Open
weizhouapache wants to merge 1 commit into
apache:mainfrom
weizhouapache:24-fix-vm-powerstate-nas-backup
Open

backup: remove the powered-off precondition for all backup providers#14094
weizhouapache wants to merge 1 commit into
apache:mainfrom
weizhouapache:24-fix-vm-powerstate-nas-backup

Conversation

@weizhouapache

@weizhouapache weizhouapache commented Sep 9, 2026

Copy link
Copy Markdown
Member

Description

This check is not needed.

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

How Has This Been Tested?

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

Copilot AI lite review requested due to automatic review settings September 9, 2026 07:56
@weizhouapache

weizhouapache commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

This condition check was added in the KBOSS PR (#12758).

I’m not sure why it was added to the providers (excluding KBOSS). I assume this is a typo and that it should apply to KBOSS only.

Please correct me if I’m wrong. @JoaoJandre @winterhazel

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.52%. Comparing base (e0f3006) to head (b366a1e).

Additional details and impacted files
@@          Coverage Diff           @@
##            main   #14094   +/-   ##
======================================
  Coverage   3.52%    3.52%           
======================================
  Files        487      487           
  Lines      41930    41930           
  Branches    7932     7932           
======================================
  Hits        1479     1479           
  Misses     40236    40236           
  Partials     215      215           
Flag Coverage Δ
uitests 3.52% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Updates the restore-volume workflow so the “VM must be powered off” precondition is enforced only for the KBOSS backup provider, allowing other providers (e.g., NAS) to restore/attach without requiring the VM to be powered off.

Changes:

  • Inverts the provider guard so the power-off check applies only when the backup offering provider is KBOSS.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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 19167

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@JoaoJandre

Copy link
Copy Markdown
Contributor

This condition check was added in the KBOSS PR (#12758).

I’m not sure why it was added to the providers (excluding KBOSS). I assume this is a typo and that it should apply to KBOSS only.

Please correct me if I’m wrong. @JoaoJandre @winterhazel

This was my error when cherry-picking the changes to main. The original branch I was working on had #7221 applied, which introduced this check for all providers. I thought it was there for a reason for other providers, so I just added an exception for KBOSS.

You can just remove the condition as a whole. It does not make sense for KBOSS. I don't think the condition makes sense for any provider actually.

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-16947)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 60770 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr14094-t16947-kvm-ol8.zip
Smoke tests completed. 156 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

Copilot AI review requested due to automatic review settings September 10, 2026 08:05
@weizhouapache
weizhouapache force-pushed the 24-fix-vm-powerstate-nas-backup branch from a23ef59 to b366a1e Compare September 10, 2026 08:05
@weizhouapache

Copy link
Copy Markdown
Member Author

This condition check was added in the KBOSS PR (#12758).
I’m not sure why it was added to the providers (excluding KBOSS). I assume this is a typo and that it should apply to KBOSS only.
Please correct me if I’m wrong. @JoaoJandre @winterhazel

This was my error when cherry-picking the changes to main. The original branch I was working on had #7221 applied, which introduced this check for all providers. I thought it was there for a reason for other providers, so I just added an exception for KBOSS.

You can just remove the condition as a whole. It does not make sense for KBOSS. I don't think the condition makes sense for any provider actually.

@JoaoJandre
thanks for the information. I have updated the PR to remove the check as you suggested.

@weizhouapache weizhouapache changed the title backup: skip the powered-off precondition for the NAS provider backup: remove the powered-off precondition for all backup providers Sep 10, 2026
@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines 1764 to 1769
throw new CloudRuntimeException("Failed to find Instance Backup Offering");
}

if (!StringUtils.equals(KBOSS_BACKUP_PROVIDER, offering.getProvider()) && !VirtualMachine.PowerState.PowerOff.equals(vm.getPowerState())) {
throw new CloudRuntimeException(String.format("VM [%s] needs to be powered off to restore the volume [%s].", vm.getUuid(), backedUpVolumeUuid));
}

BackupProvider backupProvider = getBackupProvider(offering.getProvider());
VolumeVO backedUpVolume = volumeDao.findByUuidIncludingRemoved(backedUpVolumeUuid);
Pair<HostVO, StoragePoolVO> restoreInfo;
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.

4 participants