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 20032200C30 for ; Tue, 7 Mar 2017 12:58:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1EA45160B82; Tue, 7 Mar 2017 11:58:46 +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 4D211160B68 for ; Tue, 7 Mar 2017 12:58:45 +0100 (CET) Received: (qmail 60978 invoked by uid 500); 7 Mar 2017 11:58:44 -0000 Mailing-List: contact issues-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 issues@cloudstack.apache.org Received: (qmail 60969 invoked by uid 500); 7 Mar 2017 11:58:44 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 60966 invoked by uid 99); 7 Mar 2017 11:58:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Mar 2017 11:58:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0A4F2C2730 for ; Tue, 7 Mar 2017 11:58:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.452 X-Spam-Level: * X-Spam-Status: No, score=1.452 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id r2tAOV8mbMU2 for ; Tue, 7 Mar 2017 11:58:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 3B4A85FACA for ; Tue, 7 Mar 2017 11:58:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 3817EE02F7 for ; Tue, 7 Mar 2017 11:58:38 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id E9A9D24166 for ; Tue, 7 Mar 2017 11:58:37 +0000 (UTC) Date: Tue, 7 Mar 2017 11:58:37 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-9824) Resource count for Primary storage is considered twice - while creating and while attaching the disk. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 07 Mar 2017 11:58:46 -0000 [ https://issues.apache.org/jira/browse/CLOUDSTACK-9824?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D15899326#comment-15899326 ]=20 ASF GitHub Bot commented on CLOUDSTACK-9824: -------------------------------------------- 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 cre= ating the volume and next while attaching it. This results in failure while= Attaching the volume, if the primary storage resource limit is set. =20 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.(Prim= ary 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, becau= se 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 det= aching an attached volume, the state is still seen as 'Ready'. When such a= =20 volume is tried to attach again, it will fail as the resource limit wil= l be checked again. =20 Fix implemented: 1. When a volume is =E2=80=98Added=E2=80=99, its state is seen as =E2= =80=98Allocated=E2=80=99 and it utilizes the primary storage resource. When= the Volume in =E2=80=98Allocated=E2=80=99 state is attached to a VM, its s= tate changes to =E2=80=98Ready=E2=80=99. 2. When the volume is detached from the VM, its state is still seen as = =E2=80=98Ready=E2=80=99. When the volume is detached, the resources (primar= y storage) are not released, because the volume is still in primary storage= .=20 3. The fix is to skip checking the resource limit when the volume state= is either 'Allocated' or 'Ready'. Because the volume state being 'Allocate= d' or 'Ready' implies that it is already on the Primary storage and hence t= he limit should not be checked again. =20 Test Results: 1. Set a limit of 42 GB primary storage to a new domain=20 2. Deployed a 30GB VM in it.=20 3. Created a 10 GB disk and could attach and detach it multiple times w= ithout 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 =20 ---- 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 ---- > Resource count for Primary storage is considered twice - while creating a= nd while attaching the disk. > -------------------------------------------------------------------------= ---------------------------- > > Key: CLOUDSTACK-9824 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-982= 4 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the defa= ult.)=20 > Reporter: Pranali Mande > > The Primary Storage resource counts is considered twice: Once while creat= ing the volume and next while attaching it. This results in failure while A= ttaching 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.(Primar= y 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 t= he 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 detac= hing an attached volume, the state is still seen as 'Ready'. When such a=20 > volume is tried to attach again, it will fail as the resource limit will = be checked again. > Fix implemented: > 1. When a volume is =E2=80=98Added=E2=80=99, its state is seen as =E2=80= =98Allocated=E2=80=99 and it utilizes the primary storage resource. When th= e Volume in =E2=80=98Allocated=E2=80=99 state is attached to a VM, its stat= e changes to =E2=80=98Ready=E2=80=99. > 2. When the volume is detached from the VM, its state is still seen as = =E2=80=98Ready=E2=80=99. When the volume is detached, the resources (primar= y storage) are not released, because the volume is still in primary storage= .=20 > 3. The fix is to skip checking the resource limit when the volume state i= s 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=20 > 2. Deployed a 30GB VM in it.=20 > 3. Created a 10 GB disk and could attach and detach it multiple times wit= hout any error of resource limit. -- This message was sent by Atlassian JIRA (v6.3.15#6346)