weizhouapache opened a new pull request, #13750:
URL: https://github.com/apache/cloudstack/pull/13750
### 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).
<!--- Describe your changes in DETAIL - And how has behaviour functionally
changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to
reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be
closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!---
*******************************************************************************
-->
<!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE
DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!---
*******************************************************************************
-->
### 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?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to
-->
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]