cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Fix infrastructure leak on exception while attaching/detaching volumes in VMware

Open erikbocks opened this issue 6 months ago • 14 comments

Description

In VMware environments, when a VM resides on a host in the Disconnected state, and an attach/detach volume operation is initiated, an exception containing infrastructure data is thrown. This PR addresses the issue by handling the AgentUnavailableException separately. The exception will still appear in the application logs, allowing operators to troubleshoot effectively.

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
  • [X] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [X] Minor
  • [ ] Trivial

Screenshots (if appropriate):

How Has This Been Tested?

I made the following tests, in my local lab:

  1. Created a new VM and attached a volume to it.
  2. Shutdown my VMware host.
  3. Tried to attach a new volume, and the exception containing the infrastructure data was thrown.
  4. Tried to detach the previously attached volume, and the same exception was thrown.
  5. Built and installed CloudStack's packages with my fix.
  6. Repeated the same processes, and validated that the new error message contained no infrastructure data.

erikbocks avatar May 13 '25 14:05 erikbocks