Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-9614

Attaching Volume to VM incorrectly checks resource limits

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.8.0
    • None
    • None
    • Security Level: Public (Anyone can view this level - this is the default.)
    • None

    Description

      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.

      To reproduce:
      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:

      try {
          _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, volumeToAttach.getSize());
      } catch (ResourceAllocationException e) {
          s_logger.error("primary storage resource limit check failed", e);
          throw new InvalidParameterValueException(e.getMessage());
      }
      

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            richardl Richard Lawley

            Dates

              Created:
              Updated:

              Slack

                Issue deployment