Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DBDF410274 for ; Mon, 24 Feb 2014 07:10:04 +0000 (UTC) Received: (qmail 6100 invoked by uid 500); 24 Feb 2014 07:10:03 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 5888 invoked by uid 500); 24 Feb 2014 07:10:01 -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 5871 invoked by uid 99); 24 Feb 2014 07:10:01 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Feb 2014 07:10:01 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 2686F1C764C; Mon, 24 Feb 2014 07:10:00 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============9142086529482325846==" MIME-Version: 1.0 Subject: Re: Review Request 18352: CLOUDSTACK-6151: Local data disk with tag goes to the wrong local storage pool From: "Koushik Das" To: "Koushik Das" , "Prachi Damle" Cc: "Saksham Srivastava" , "cloudstack" Date: Mon, 24 Feb 2014 07:10:00 -0000 Message-ID: <20140224071000.21198.11184@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Koushik Das" X-ReviewGroup: cloudstack X-ReviewRequest-URL: https://reviews.apache.org/r/18352/ X-Sender: "Koushik Das" References: <20140221113654.29785.61840@reviews.apache.org> In-Reply-To: <20140221113654.29785.61840@reviews.apache.org> Reply-To: "Koushik Das" X-ReviewRequest-Repository: cloudstack-git --===============9142086529482325846== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/18352/#review35257 ----------------------------------------------------------- engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java If you specify the host then you don't need dc, pod, cluster. engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java I would recommend that you use the createSearchBuilder() approach instead of hardcoding the sql query. Refer to PrimaryDataStoreDaoImpl() ctor. engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java What is the use case for null host id? Make it long instead of Long. - Koushik Das On Feb. 21, 2014, 11:36 a.m., Saksham Srivastava wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/18352/ > ----------------------------------------------------------- > > (Updated Feb. 21, 2014, 11:36 a.m.) > > > Review request for cloudstack, Koushik Das and Prachi Damle. > > > Bugs: CLOUDSTACK-6151 > https://issues.apache.org/jira/browse/CLOUDSTACK-6151 > > > Repository: cloudstack-git > > > Description > ------- > > Attaching a disk created from local disk offering with tags, to a VM was going to wrong local storage pool. > Cause : In LocalStoragePoolAlocator- > List hostPools = _poolHostDao.listByHostId(plan.getHostId()); > It return pools by hostId, but nowhere were the tags being compared. > > Added new method findLocalStoragePoolsByHostAndTags() that returns stoage pools by hostid and tags both. > > > Diffs > ----- > > engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java 59c338e > engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java d35aa44 > engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java 1f61e8b > > Diff: https://reviews.apache.org/r/18352/diff/ > > > Testing > ------- > > Tested the folowing scenarios: > attaching local volume with tags > attaching local volume without tags > attaching local volume with different tags > attaching shared volume > > Build passes successfully. > > > Thanks, > > Saksham Srivastava > > --===============9142086529482325846==--