Skip to content

xenserver/xcpng: do not bypass secondary storage when copy volumes between pools - #13750

Open
weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-fix-xen-offline-volume-migration
Open

xenserver/xcpng: do not bypass secondary storage when copy volumes between pools#13750
weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-fix-xen-offline-volume-migration

Conversation

@weizhouapache

@weizhouapache weizhouapache commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description

This PR fixes an issue found by smoke test test_snapshots.py

======================================================================
ERROR: Test listing volume snapshots with removed data stores
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/marvin/lib/decoratorGenerators.py", line 30, in test_wrapper
    return test(self, *args, **kwargs)
  File "/marvin/tests/smoke/test_snapshots.py", line 329, in test_02_list_snapshots_with_removed_data_store
    Volume.migrate(self.apiclient,
  File "/usr/local/lib/python3.9/site-packages/marvin/lib/base.py", line 1384, in migrate
    return (apiclient.migrateVolume(cmd))
  File "/usr/local/lib/python3.9/site-packages/marvin/cloudstackAPI/cloudstackAPIClient.py", line 2466, in migrateVolume
    response = self.connection.marvinRequest(command, response_type=response, method=method)
  File "/usr/local/lib/python3.9/site-packages/marvin/cloudstackConnection.py", line 382, in marvinRequest
    raise e
  File "/usr/local/lib/python3.9/site-packages/marvin/cloudstackConnection.py", line 377, in marvinRequest
    raise self.__lastError
  File "/usr/local/lib/python3.9/site-packages/marvin/cloudstackConnection.py", line 104, in __poll
    raise Exception("Job failed: %s"\
Exception: Job failed: {accountid : 'ace6439d-47aa-11f1-9730-1e00b0000364', account : 'admin', domainid : '5fd28bae-47aa-11f1-9730-1e00b0000364', domainpath : 'ROOT', userid : 'ace709e4-47aa-11f1-9730-1e00b0000364', cmd : 'org.apache.cloudstack.api.command.admin.volume.MigrateVolumeCmdByAdmin', jobprocstatus : 0, jobresultcode : 530, jobresulttype : 'object', jobresult : {errorcode : 530, errortext : 'Resource [StoragePool:9] is unreachable: Volume [{"name":"Test Volume-JE9STT","uuid":"bea8024b-f56a-4b64-a9fa-abc6cdf876b2"}] migration failed due to [Resource returned null answer].'}, jobinstancetype : 'Volume', jobinstanceid : 'bea8024b-f56a-4b64-a9fa-abc6cdf876b2', created : '2026-05-06T19:13:15+0000', completed : '2026-05-06T19:13:15+0000', jobid : '9872cf1e-9f67-4881-947b-9cbafa49ef3f', jobstatus : 2}

the issue is because secondary storage is bypassed during offline volume migration, but the volume copy from primary to primary is not implemented for xenserver/xcp

    @Override
    public Answer copyVolumeFromPrimaryToPrimary(CopyCommand cmd) {
        return null;
    }       

as a workaround, do not bypass the secondary storage for volume on xen/xcp and rollback the previous logic so that offline volume migration will work (via secondary storage).

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?

@weizhouapache

Copy link
Copy Markdown
Member Author

this is part of #13628 and smoke test passed: #13628 (comment)

as discussed with @DaanHoogland , created this PR for 4.22

@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 KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@weizhouapache

Copy link
Copy Markdown
Member Author

related to #11625

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

clgtm

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.69%. Comparing base (0339f31) to head (267e1f3).

Files with missing lines Patch % Lines
...tack/storage/motion/AncientDataMotionStrategy.java 0.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #13750      +/-   ##
============================================
- Coverage     17.69%   17.69%   -0.01%     
+ Complexity    15833    15832       -1     
============================================
  Files          5925     5925              
  Lines        533534   533538       +4     
  Branches      65273    65275       +2     
============================================
- Hits          94421    94416       -5     
- Misses       428434   428444      +10     
+ Partials      10679    10678       -1     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.77% <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 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.
@weizhouapache weizhouapache added this to the 4.22.2 milestone Jul 30, 2026
@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan test ol8 xcpng82

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

Test Result Time (s) Test File
test_01_events_resource Error 206.85 test_events_resource.py
ContextSuite context=TestClusterDRS>:setup Error 0.00 test_cluster_drs.py
test_01_non_strict_host_anti_affinity Error 211.97 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 57.74 test_nonstrict_affinity_group.py
test_01_vpn_usage Error 1.07 test_usage.py
test_01_migrate_vm_strict_tags_success Error 57.55 test_vm_strict_host_tags.py
all_test_vpc_vpn Skipped --- test_vpc_vpn.py
all_test_webhook_delivery Skipped --- test_webhook_delivery.py
all_test_webhook_lifecycle Skipped --- test_webhook_lifecycle.py
all_test_host_maintenance Skipped --- test_host_maintenance.py
all_test_hostha_kvm Skipped --- test_hostha_kvm.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants