Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 42688C904 for ; Thu, 12 Jul 2012 18:26:08 +0000 (UTC) Received: (qmail 41864 invoked by uid 500); 12 Jul 2012 18:26:08 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 41839 invoked by uid 500); 12 Jul 2012 18:26:08 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 41831 invoked by uid 99); 12 Jul 2012 18:26:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 18:26:08 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Chiradeep.Vittal@citrix.com designates 66.165.176.63 as permitted sender) Received: from [66.165.176.63] (HELO SMTP02.CITRIX.COM) (66.165.176.63) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 18:26:01 +0000 X-IronPort-AV: E=Sophos;i="4.77,575,1336363200"; d="scan'208";a="201978746" Received: from sjcpmailmx01.citrite.net ([10.216.14.74]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 12 Jul 2012 14:25:39 -0400 Received: from SJCPMAILBOX01.citrite.net ([10.216.4.73]) by SJCPMAILMX01.citrite.net ([10.216.14.74]) with mapi; Thu, 12 Jul 2012 11:25:39 -0700 From: Chiradeep Vittal To: CloudStack DeveloperList , Nitin Mehta , Deepti Dohare Date: Thu, 12 Jul 2012 11:26:53 -0700 Subject: Re: Review Request: CS-15430 Create snapshot should fail if creating snapshot results in exceeding snapshot resource limit for domain-admin or user accounts. Thread-Topic: Review Request: CS-15430 Create snapshot should fail if creating snapshot results in exceeding snapshot resource limit for domain-admin or user accounts. Thread-Index: Ac1gW7yNkbr+nbz6SsaABxRc/mID4A== Message-ID: In-Reply-To: <20120712060251.729.75834@reviews.apache.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.13.0.110805 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Synchronized isn't going to solve all your cases since management servers can be clustered.=20 You need to use GenericDaoBase.acquireInLockTable for these kinds of synchronization. This kind of generic service (atomic increment up to a limit) should be in the ResourceLimitManager. Perhaps updateResourceCountForAccount can be modified to take into account the resource limit. -- Chiradeep On 7/11/12 11:02 PM, "Nitin Mehta" wrote: > >----------------------------------------------------------- >This is an automatically generated e-mail. To reply, visit: >https://reviews.apache.org/r/5806/#review9100 >----------------------------------------------------------- > >Ship it! > > >Ship It! > >- Nitin Mehta > > >On July 10, 2012, 1:32 p.m., deepti dohare wrote: >>=20 >> ----------------------------------------------------------- >> This is an automatically generated e-mail. To reply, visit: >> https://reviews.apache.org/r/5806/ >> ----------------------------------------------------------- >>=20 >> (Updated July 10, 2012, 1:32 p.m.) >>=20 >>=20 >> Review request for cloudstack. >>=20 >>=20 >> Description >> ------- >>=20 >> Change: >> 1. Before creating the snapshot, we synchronized checkResourcelimit to >>allow the users to create the snapshot and increment the resource count. >> 2. Depending on the failure of snapshot creation/ backup, we are >>decrementing the resource count. >>=20 >>=20 >> This addresses bug CS-15430. >>=20 >>=20 >> Diffs >> ----- >>=20 >> server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java >>50dcf38=20 >>=20 >> Diff: https://reviews.apache.org/r/5806/diff/ >>=20 >>=20 >> Testing >> ------- >>=20 >> Steps to verify: >> 1.Login as admin, set snapshot limit '3' for a user account >> 2.login as user, create a VM1 with data volume >> 3.trigger 3 create snapshot command from the above data volume, >>succeeded >> 4.create one more snapshot, failed, "maximum limit exceeded for account >>user" >>=20 >>=20 >> Thanks, >>=20 >> deepti dohare >>=20 >> >