jmsperu opened a new issue, #14968:
URL: https://github.com/apache/cloudstack/issues/14968

   ## ISSUE TYPE
   
   Improvement Request
   
   ## COMPONENT NAME
   
   Management server (NetworkServiceImpl / NetworkOrchestrator), API error text
   
   ## CLOUDSTACK VERSION
   
   4.22.1.1
   
   ## CONFIGURATION
   
   KVM, advanced zone, isolated network with one running user instance.
   
   ## OS / ENVIRONMENT
   
   Ubuntu 24.04 LTS management server and KVM hosts (agent 4.22.1.1).
   
   ## SUMMARY
   
   Calling deleteNetwork on a network that still has a user instance fails with:
   
   ```
   errorcode 530
   Failed to delete network
   ```
   
   The reason is logged only as a WARN:
   
   ```
   Can't delete the Network, not all User Instances are expunged. Instance VM 
instance {...}
   ```
   
   The user has no way to know from the API or the UI that the fix is to remove 
the instance first. 530 also reads as a server fault, not as a request the user 
can correct.
   
   ## STEPS TO REPRODUCE
   
   ```
   1. Create an isolated network and deploy one instance on it.
   2. deleteNetwork id=<network>.
   ```
   
   ## EXPECTED RESULTS
   
   A 431 (or the existing code, if changing it is a concern) with text like 
"Network <name> cannot be deleted because it still has <n> instance(s), for 
example <instance name>. Remove them first." No internal ids.
   
   ## ACTUAL RESULTS
   
   530 "Failed to delete network". The reason is only in the log.
   
   ## NOTES
   
   The check that logs the WARN already knows the blocking instance. Passing 
that reason up instead of returning false would be a small change. Could also 
be done through the #12336 message framework.
   


-- 
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