Skip to content

VM deletion can fail on volume access revocation if VM's last host is removed #6739

@mlsorensen

Description

@mlsorensen
ISSUE TYPE
  • Bug Report
COMPONENT NAME
API, Storage
CLOUDSTACK VERSION
main
CONFIGURATION

PowerFlex, Datera storage

OS / ENVIRONMENT
SUMMARY

If a VM is stopped, then the last host it was running on is removed from cloudstack, the VM can fail to delete. This is because deletion attempts to revoke host access to the VM's volumes and various storage plugins will throw errors if the provided host is null.

Looking through the storage plugin implementations, it looks like this would affect Datera and PowerFlex storage types only.

Generally this seems to be due to passing a null host object to the storage provider's revokeAccess() method. Looked into a holistic fix but there are several places where revokeAccess() can be invoked or could be invoked in the future. Additionally, a storage plugin could choose to handle a null host as a "revoke all" command.

STEPS TO REPRODUCE
  1. Create VM with root on Datera or PowerFlex storage
  2. Start/stop the VM
  3. remove the host the VM ran on from CloudStack
  4. attempt to delete the VM
EXPECTED RESULTS

VM should be deleted

ACTUAL RESULTS

Error is thrown during deletion

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions