Affects Version/s: 4.8.0
Fix Version/s: None
Security Level: Public (Anyone can view this level - this is the default.)
When you try to attach an existing volume to a VM, a resource check is incorrectly performed and this can incorrectly prevent attachment of the disk if the account has low available primary storage.
1. Create an account, with a primary storage limit.
2. Deploy a VM to that account
3. Create a volume on that account, using >50% of the remaining space
4. Try to attach the created volume to the VM
Maximum number of resources of type 'primary_storage' for account name=XXXXXX in domain id=XXXX has been exceeded.
This has been found on 4.8.0, but I can't find any reference to a similar bug, and looking at the code for VolumeApiServiceImpl.java it looks to me like it's still there:
I'm not sure if there are any scenarios where a volume can be attached that wasn't already using resources from the account involved - if not then I'm not sure any resource check should be performed here.