sureshanaparti opened a new pull request, #13111:
URL: https://github.com/apache/cloudstack/pull/13111

   ### Description
   
   This PR updates changes to not call delete volume on store if it doesn't 
exist on it.
   
   <!--- 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)
   - [x] 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
   - [x] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   Tried delete volume not created on the primary storage.
   
   BEFORE:
   
   ```
   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","poolI
 
d":"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)
   ```
   
   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
   ```
   
   <!-- 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]

Reply via email to