Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ABA96200C30 for ; Tue, 7 Mar 2017 12:58:34 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AA302160B74; Tue, 7 Mar 2017 11:58:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 019AA160B68 for ; Tue, 7 Mar 2017 12:58:33 +0100 (CET) Received: (qmail 59581 invoked by uid 500); 7 Mar 2017 11:58:28 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 59569 invoked by uid 99); 7 Mar 2017 11:58:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Mar 2017 11:58:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BAB64DFBD3; Tue, 7 Mar 2017 11:58:27 +0000 (UTC) From: PranaliM To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org Message-ID: Subject: [GitHub] cloudstack pull request #1992: CLOUDSTACK-9824:Resource count for Primary st... Content-Type: text/plain Date: Tue, 7 Mar 2017 11:58:27 +0000 (UTC) archived-at: Tue, 07 Mar 2017 11:58:34 -0000 GitHub user PranaliM opened a pull request: https://github.com/apache/cloudstack/pull/1992 CLOUDSTACK-9824:Resource count for Primary storage is considered twice - while creating and while attaching the disk The Primary Storage resource counts is considered twice: Once while creating the volume and next while attaching it. This results in failure while Attaching the volume, if the primary storage resource limit is set. Following are the steps to reproduce the issue: 1. Create a Domain 2. Create an Account. 3. Allocate 11 GB Primary storage limit to the domain. 4. Deploy a VM sized 8GB (Primary storage resource count is now 8GB ) 5. Create a 2GB custom disk by using the option 'Add Volume' link.(Primary storage resource count is now 10GB). The Volume state is 'Allocated' 6. Now try to Attach the data-disk created above to a VM. At this point the resource count limit is again checked, and the attachment fails, because it is expected to be 12GB, but, which exceeds the limit of 11GB. 7. This issue is also observed for volumes which are 'Detached'. On detaching an attached volume, the state is still seen as 'Ready'. When such a volume is tried to attach again, it will fail as the resource limit will be checked again. Fix implemented: 1. When a volume is ‘Added’, its state is seen as ‘Allocated’ and it utilizes the primary storage resource. When the Volume in ‘Allocated’ state is attached to a VM, its state changes to ‘Ready’. 2. When the volume is detached from the VM, its state is still seen as ‘Ready’. When the volume is detached, the resources (primary storage) are not released, because the volume is still in primary storage. 3. The fix is to skip checking the resource limit when the volume state is either 'Allocated' or 'Ready'. Because the volume state being 'Allocated' or 'Ready' implies that it is already on the Primary storage and hence the limit should not be checked again. Test Results: 1. Set a limit of 42 GB primary storage to a new domain 2. Deployed a 30GB VM in it. 3. Created a 10 GB disk and could attach and detach it multiple times without any error of resource limit. You can merge this pull request into a Git repository by running: $ git pull https://github.com/Accelerite/cloudstack CS-9824 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1992.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1992 ---- commit 616c05e2921af6b713f8a4bce2d2421b03462a22 Author: Pranali Mande Date: 2017-03-07T11:53:02Z CLOUDSTACK-9824:Resource count for Primary storage is considered twice - while creating and while attaching the disk ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---