RosiKyu commented on PR #10957:
URL: https://github.com/apache/cloudstack/pull/10957#issuecomment-3800710940
### TC1: Cold Volume Migration Without Secondary Storage Selector
**Objective**
Verify that cold volume migration uses the secondary storage with the most
free capacity when no secondary storage selector (heuristic rule) is configured
for VOLUME type.
**Test Steps**
1. Verified no secondary storage selector exists for VOLUME type in the zone
2. Confirmed three secondary storages exist with equal capacity (~1.08 TB
free each)
3. Started tail on management-server.log to capture secondary storage
selection
4. Executed cold migration of test-vol-1 from primary storage pri2 to pri1
5. Verified migration completed successfully and observed log output
**Expected Result:**
- Migration should complete successfully
- Log should show: "Secondary storage selector did not direct volume
migration to a specific secondary storage; using secondary storage with the
most free capacity."
- System should select sec1 (first storage with most/equal free capacity)
**Actual Result:**
- Migration completed successfully ✓
- Volume test-vol-1 migrated from pri2 to pri1 ✓
- Log confirmed: "Secondary storage selector did not direct volume migration
to a specific secondary storage; using secondary storage with the most free
capacity." ✓
- System used sec1 (id:1, uuid: 27cfbb80-8eda-4403-8ac8-9572c7edd2b7) as
staging storage ✓
**Test Evidence:**
Pre-migration check - No VOLUME selector exists:
```
(localcloud) 🐱 > list secondarystorageselectors
zoneid=0ec45e01-e0b0-4fbf-a6e8-7bb81dd480e2 type=VOLUME
(localcloud) 🐱 >
```
Secondary storage capacity (all equal):
```
(localcloud) 🐱 > list imageStores zoneid=0ec45e01-e0b0-4fbf-a6e8-7bb81dd480e2
{
"count": 3,
"imagestore": [
{
"disksizetotal": 2898029182976,
"disksizeused": 1707413078016,
"id": "27cfbb80-8eda-4403-8ac8-9572c7edd2b7",
"name":
"NFS://10.0.32.4/acs/secondary/ref-trl-10723-k-Mol9-rositsa-kyuchukova/ref-trl-10723-k-Mol9-rositsa-kyuchukova-sec1",
"protocol": "nfs"
},
{
"disksizetotal": 2898029182976,
"disksizeused": 1707413078016,
"id": "6062156f-b9f3-417a-bdd9-202fc5bce258",
"name":
"NFS://10.0.32.4/acs/secondary/ref-trl-10723-k-Mol9-rositsa-kyuchukova/ref-trl-10723-k-Mol9-rositsa-kyuchukova-sec2",
"protocol": "nfs"
},
{
"disksizetotal": 2898029182976,
"disksizeused": 1707413078016,
"id": "910cc03a-0b37-4a4d-a3f6-968cff43c3c2",
"name":
"NFS://10.0.32.4/acs/secondary/ref-trl-10723-k-Mol9-rositsa-kyuchukova/ref-trl-10723-k-Mol9-rositsa-kyuchukova-sec3",
"protocol": "nfs"
}
]
}
```
Migration command and result:
```
(localcloud) 🐱 > migrate volume
volumeid=08caf0fa-ba34-43aa-addd-f415854c854a
storageid=f55f0783-0351-329c-bd4f-8a9b81e4acbd
{
"volume": {
"id": "08caf0fa-ba34-43aa-addd-f415854c854a",
"name": "test-vol-1",
"state": "Ready",
"storage": "ref-trl-10723-k-Mol9-rositsa-kyuchukova-kvm-pri1",
"storageid": "f55f0783-0351-329c-bd4f-8a9b81e4acbd"
}
}
```
Management server log showing secondary storage selection:
```
2026-01-26 16:59:21,409 DEBUG [o.a.c.s.m.AncientDataMotionStrategy]
(Work-Job-Executor-7:[ctx-ae1d605d, job-46/job-47, ctx-cd5b4539])
(logid:99a6f633) copyAsync inspecting src type VOLUME copyAsync inspecting dest
type VOLUME
2026-01-26 16:59:21,409 DEBUG [o.a.c.s.m.AncientDataMotionStrategy]
(Work-Job-Executor-7:[ctx-ae1d605d, job-46/job-47, ctx-cd5b4539])
(logid:99a6f633) About to MIGRATE copy between datasources
2026-01-26 16:59:21,410 DEBUG [o.a.c.s.m.AncientDataMotionStrategy]
(Work-Job-Executor-7:[ctx-ae1d605d, job-46/job-47, ctx-cd5b4539])
(logid:99a6f633) MIGRATE copy using copyVolumeBetweenPools STARTING
2026-01-26 16:59:21,414 DEBUG [o.a.c.s.m.AncientDataMotionStrategy]
(Work-Job-Executor-7:[ctx-ae1d605d, job-46/job-47, ctx-cd5b4539])
(logid:99a6f633) Secondary storage selector did not direct volume migration to
a specific secondary storage; using secondary storage with the most free
capacity.
2026-01-26 16:59:21,417 DEBUG [c.c.s.StatsCollector]
(Work-Job-Executor-7:[ctx-ae1d605d, job-46/job-47, ctx-cd5b4539])
(logid:99a6f633) Verifying image storage [ImageStore
{"id":1,"name":"NFS:\/\/10.0.32.4\/acs\/secondary\/ref-trl-10723-k-Mol9-rositsa-kyuchukova\/ref-trl-10723-k-Mol9-rositsa-kyuchukova-sec1","uuid":"27cfbb80-8eda-4403-8ac8-9572c7edd2b7"}].
Capacity: total=[2.6357 TB], used=[1.5535 TB], threshold=[95.00%].
2026-01-26 16:59:22,732 DEBUG [o.a.c.s.m.AncientDataMotionStrategy]
(Work-Job-Executor-7:[ctx-ae1d605d, job-46/job-47, ctx-cd5b4539])
(logid:99a6f633) MIGRATE copy using copyVolumeBetweenPools DONE: true
```
**Status: PASSED**
--
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]