You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR updates changes to not call delete volume on store if volume doesn't exist on it.
Noticed this issue in the failed xenserver test 'test_02_list_snapshots_with_removed_data_store' in test_snapshots.py.
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?
Successfully deleted volume not created on the primary storage.
BEFORE:
Delete volume fails with error " The uuid you supplied was invalid.", and also doesn't allow to remove the storage pool as non-destroyed volumes exists.
2026-05-06 20:03:00,121 INFO [c.c.s.VolumeApiServiceImpl] (qtp2038105753-24:[ctx-0c63e636, ctx-6a458984]) (logid:0a3bbd32) Expunging volume Volume {"id":630,"instanceId":null,"name":"Test Volume-JE9STT","uuid":"6c5a4d4a-c12c-449e-9074-65ac240e5fe8","volumeType":"DATADISK"} from Primary data store
2026-05-06 20:03:00,124 DEBUG [o.a.c.s.v.VolumeServiceImpl] (qtp2038105753-24:[ctx-0c63e636, ctx-6a458984]) (logid:0a3bbd32) Marking volume that was never created as destroyed: Volume {"id":630,"instanceId":null,"name":"Test Volume-JE9STT","uuid":"6c5a4d4a-c12c-449e-9074-65ac240e5fe8","volumeType":"DATADISK"}
2026-05-06 20:03:00,141 DEBUG [c.c.a.m.ClusteredAgentManagerImpl] (qtp2038105753-24:[ctx-0c63e636, ctx-6a458984]) (logid:0a3bbd32) Wait time setting on org.apache.cloudstack.storage.command.DeleteCommand is 1800 seconds
2026-05-06 20:03:00,142 DEBUG [c.c.a.m.ClusteredDirectAgentAttache] (qtp2038105753-24:[ctx-0c63e636, ctx-6a458984]) (logid:0a3bbd32) Seq 12-5679602080067635204: Routed from 32988301624164
2026-05-06 20:03:00,142 DEBUG [c.c.a.t.Request] (qtp2038105753-24:[ctx-0c63e636, ctx-6a458984]) (logid:0a3bbd32) Seq 1-5679602080067635204: Sending { Cmd , MgmtId: 32988301624164, via: 1(pr12001-t16006-xcpng83-xs1), Ver: v1, Flags: 100011, [{"org.apache.cloudstack.storage.command.DeleteCommand":{"data":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"uuid":"6c5a4d4a-c12c-449e-9074-65ac240e5fe8","volumeType":"DATADISK","dataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"4a7792fb-c135-3ca2-a5c8-bc7e080d76ba","name":"Test nfs2 primary","id":"9","poolType":"NetworkFilesystem","host":"10.0.32.4","path":"/acs/primary/pr12001-t16006-xcpng83/nfs2","port":"2049","url":"NetworkFilesystem://10.0.32.4/acs/primary/pr12001-t16006-xcpng83/nfs2/?ROLE=Primary&STOREUUID=4a7792fb-c135-3ca2-a5c8-bc7e080d76ba","isManaged":"false"}},"name":"Test Volume-JE9STT","size":"(1.00 GB) 1073741824","volumeId":"630","accountId":"317","format":"VHD","provisioningType":"THIN","poolId":"9","id":"630","hypervisorType":"XenServer","directDownload":"false","deployAsIs":"false","checkpointPaths":[],"checkpointImageStoreUrls":[],"followRedirects":"false"}},"wait":"0","bypassHostMaintenance":"false"}}] }
2026-05-06 20:03:00,143 DEBUG [c.c.a.t.Request] (qtp2038105753-24:[ctx-0c63e636, ctx-6a458984]) (logid:0a3bbd32) Seq 1-5679602080067635204: Executing: { Cmd , MgmtId: 32988301624164, via: 1(pr12001-t16006-xcpng83-xs1), Ver: v1, Flags: 100011, [{"org.apache.cloudstack.storage.command.DeleteCommand":{"data":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"uuid":"6c5a4d4a-c12c-449e-9074-65ac240e5fe8","volumeType":"DATADISK","dataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"4a7792fb-c135-3ca2-a5c8-bc7e080d76ba","name":"Test nfs2 primary","id":"9","poolType":"NetworkFilesystem","host":"10.0.32.4","path":"/acs/primary/pr12001-t16006-xcpng83/nfs2","port":"2049","url":"NetworkFilesystem://10.0.32.4/acs/primary/pr12001-t16006-xcpng83/nfs2/?ROLE=Primary&STOREUUID=4a7792fb-c135-3ca2-a5c8-bc7e080d76ba","isManaged":"false"}},"name":"Test Volume-JE9STT","size":"(1.00 GB) 1073741824","volumeId":"630","accountId":"317","format":"VHD","provisioningType":"THIN","poolId":"9","id":"630","hypervisorType":"XenServer","directDownload":"false","deployAsIs":"false","checkpointPaths":[],"checkpointImageStoreUrls":[],"followRedirects":"false"}},"wait":"0","bypassHostMaintenance":"false"}}] }
2026-05-06 20:03:00,143 DEBUG [c.c.a.m.D.Task] (DirectAgent-267:[ctx-eb1ace39]) (logid:f7c80038) Seq 12-5679602080067635204: Executing request
2026-05-06 20:03:00,143 DEBUG [c.c.s.r.StorageSubsystemCommandHandlerBase] (DirectAgent-267:[ctx-eb1ace39]) (logid:0a3bbd32) Executing command DeleteCommand: [{"data":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"uuid":"6c5a4d4a-c12c-449e-9074-65ac240e5fe8","volumeType":"DATADISK","dataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"4a7792fb-c135-3ca2-a5c8-bc7e080d76ba","name":"Test nfs2 primary","id":9,"poolType":"NetworkFilesystem","host":"10.0.32.4","path":"/acs/primary/pr12001-t16006-xcpng83/nfs2","port":2049,"url":"NetworkFilesystem://10.0.32.4/acs/primary/pr12001-t16006-xcpng83/nfs2/?ROLE=Primary&STOREUUID=4a7792fb-c135-3ca2-a5c8-bc7e080d76ba","isManaged":false}},"name":"Test Volume-JE9STT","size":1073741824,"volumeId":630,"accountId":317,"format":"VHD","provisioningType":"THIN","poolId":9,"id":630,"hypervisorType":"XenServer","directDownload":false,"deployAsIs":false,"checkpointPaths":[],"checkpointImageStoreUrls":[],"followRedirects":false}},"wait":0,"bypassHostMaintenance":false}].
2026-05-06 20:03:00,151 DEBUG [c.c.h.x.r.Xenserver625StorageProcessor] (DirectAgent-267:[ctx-eb1ace39]) (logid:0a3bbd32) Failed to delete volume The uuid you supplied was invalid.
at com.xensource.xenapi.Types.checkResponse(Types.java:2352)
at com.xensource.xenapi.ConnectionNew.dispatch(ConnectionNew.java:318)
at com.cloud.hypervisor.xenserver.resource.XenServerConnectionPool$XenServerConnection.dispatch(XenServerConnectionPool.java:459)
at com.xensource.xenapi.VDI.getByUuid(VDI.java:355)
at com.cloud.hypervisor.xenserver.resource.XenServerStorageProcessor.deleteVolume(XenServerStorageProcessor.java:587)
...
2026-05-06 20:03:37,729 DEBUG [c.c.s.StorageManagerImpl] (qtp2038105753-24:[ctx-2dd11af0, ctx-d6bc8eab]) (logid:5ea94ed6) Cannot delete storage pool StoragePool {"id":9,"name":"Test nfs2 primary","poolType":"NetworkFilesystem","uuid":"4a7792fb-c135-3ca2-a5c8-bc7e080d76ba"} as the following non-destroyed volumes are on it: [].
2026-05-06 20:03:37,730 ERROR [c.c.a.ApiServer] (qtp2038105753-24:[ctx-2dd11af0, ctx-d6bc8eab]) (logid:5ea94ed6) unhandled exception executing api command: [Ljava.lang.String;@716b52cd com.cloud.utils.exception.CloudRuntimeException: Cannot delete pool StoragePool {"id":9,"name":"Test nfs2 primary","poolType":"NetworkFilesystem","uuid":"4a7792fb-c135-3ca2-a5c8-bc7e080d76ba"} as there are non-destroyed volumes associated to this pool.
at com.cloud.storage.StorageManagerImpl.deleteDataStoreInternal(StorageManagerImpl.java:1783)
at com.cloud.storage.StorageManagerImpl.deletePool(StorageManagerImpl.java:1706)
AFTER:
2026-05-06 20:45:23,762 INFO [c.c.s.VolumeApiServiceImpl] (qtp2038105753-23:[ctx-631e2bf2, ctx-04adee99]) (logid:62cd1e87) Expunging volume Volume {"id":630,"instanceId":null,"name":"Test Volume-JE9STT","uuid":"6c5a4d4a-c12c-449e-9074-65ac240e5fe8","volumeType":"DATADISK"} from Primary data store
2026-05-06 20:45:23,766 DEBUG [o.a.c.s.v.VolumeServiceImpl] (qtp2038105753-23:[ctx-631e2bf2, ctx-04adee99]) (logid:62cd1e87) Marking volume that was never created as destroyed: Volume {"id":630,"instanceId":null,"name":"Test Volume-JE9STT","uuid":"6c5a4d4a-c12c-449e-9074-65ac240e5fe8","volumeType":"DATADISK"}
2026-05-06 20:45:23,784 DEBUG [o.a.c.s.v.VolumeServiceImpl] (qtp2038105753-23:[ctx-631e2bf2, ctx-04adee99]) (logid:62cd1e87) Volume Volume {"id":630,"instanceId":null,"name":"Test Volume-JE9STT","uuid":"6c5a4d4a-c12c-449e-9074-65ac240e5fe8","volumeType":"DATADISK"} doesn't exist on primary storage, no need to delete
How did you try to break this feature and the system with this change?
@sureshanaparti 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.
❌ Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.68%. Comparing base (3e688b0) to head (9d205c2).
❄️ 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.
sureshanaparti
changed the title
Don't call delete volume on store if it doesn't exist on it
Don't call delete volume on store if volume doesn't exist on it
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates changes to not call delete volume on store if volume doesn't exist on it.
Noticed this issue in the failed xenserver test 'test_02_list_snapshots_with_removed_data_store' in test_snapshots.py.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Successfully deleted volume not created on the primary storage.
BEFORE:
Delete volume fails with error " The uuid you supplied was invalid.", and also doesn't allow to remove the storage pool as non-destroyed volumes exists.
AFTER:
How did you try to break this feature and the system with this change?