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 AB942D40A for ; Wed, 26 Sep 2012 21:09:23 +0000 (UTC) Received: (qmail 75426 invoked by uid 500); 26 Sep 2012 21:09:23 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 75369 invoked by uid 500); 26 Sep 2012 21:09:23 -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 75361 invoked by uid 99); 26 Sep 2012 21:09:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Sep 2012 21:09:23 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Edison.su@citrix.com designates 66.165.176.89 as permitted sender) Received: from [66.165.176.89] (HELO SMTP.CITRIX.COM) (66.165.176.89) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Sep 2012 21:09:17 +0000 X-IronPort-AV: E=Sophos;i="4.80,491,1344211200"; d="scan'208";a="39294408" Received: from sjcpmailmx02.citrite.net ([10.216.14.75]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5; 26 Sep 2012 21:08:36 +0000 Received: from SJCPMAILBOX01.citrite.net ([10.216.4.72]) by SJCPMAILMX02.citrite.net ([10.216.14.75]) with mapi; Wed, 26 Sep 2012 14:08:35 -0700 From: Edison Su To: "cloudstack-dev@incubator.apache.org" Date: Wed, 26 Sep 2012 14:08:35 -0700 Subject: RE: advice: trying to fix secondary/iso nfs storage on KVM Thread-Topic: advice: trying to fix secondary/iso nfs storage on KVM Thread-Index: Ac2cKnBR803BoxbeTXiUdoVDdzc8IgAAJlJA Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Yes, you are right, getStoragePoolbyURI is the right one. > -----Original Message----- > From: Marcus Sorensen [mailto:shadowsor@gmail.com] > Sent: Wednesday, September 26, 2012 2:03 PM > To: cloudstack-dev@incubator.apache.org > Subject: Re: advice: trying to fix secondary/iso nfs storage on KVM >=20 > It looks like the aforementioned getStoragePoolbyURI takes care of > this, that is it takes the host/path, generates a UUID based on it, > and then searches existing storage pools for it. If none is found, it > creates a new one, otherwise it uses the existing pool. >=20 > So would changing KVMStoragePoolManager.java to do getStoragePoolbyURI > instead of getStoragePoolByUri be enough to fix? >=20 > On Wed, Sep 26, 2012 at 2:58 PM, Edison Su wrote: > > The latest libvirt(bundled in rhel 6.3) has this limitation, you > can't create duplicate storage pool with the same host/path, thus > breaks some of the logic in the current code. > > To fix the issue, we need to list all the available storage pools on > kvm host, check one by one: if any one of storage pools has the same > attribute(for nfs, it's host and path, for dir storage, it's path) as > we are looking for, then return. > > > >> -----Original Message----- > >> From: Marcus Sorensen [mailto:shadowsor@gmail.com] > >> Sent: Wednesday, September 26, 2012 1:32 PM > >> To: cloudstack-dev@incubator.apache.org > >> Subject: Re: advice: trying to fix secondary/iso nfs storage on KVM > >> > >> I also notice that LibvirtComputingResource calls > getStoragePoolByURI > >> > >> getStoragePoolByURI calls getStoragePoolByUri per > >> KVMStoragePoolManager.java > >> > >> in LibvirtStorageAdaptor there exists both getStoragePoolByUri and > >> getStoragePoolbyURI. The latter looks like it generates a UUID based > >> on the host/path of the secondary storage, and creates a storage > pool > >> based on it if needed. So I'm wondering if we are just calling the > >> wrong one, although this is called many times in > >> LibvirtComputingResource so perhaps we intend both behaviors at > >> certain points. > >> > >> To recap: > >> > >> getStoragePoolByUri will always try to create a new nfs pool with a > >> random UUID > >> > >> getStoragePoolbyURI attempts to generate a UUID from the > >> sourcehost/path and uses that (static UUID) > >> > >> > >> > >> On Wed, Sep 26, 2012 at 2:10 PM, Marcus Sorensen > > >> wrote: > >> > I noticed that I can no longer create multiple VMs from ISO. After > >> the > >> > first one, I get an error where the agent is trying to create a > >> > duplicate storage pool, throwing 'Storage source conflict with > pool' > >> > > >> > In looking into it, it seems that with ISOs we call > >> > getStoragePoolByURI with the path to the iso > >> > > >> > This generates a new random UUID and attempts to create a storage > >> pool > >> > with this UUID via createStoragePool > >> > > >> > createStoragePool first looks to see if the pool passed already > >> > exists, which it doesn't since we just generated the UUID out of > thin > >> > air. Then it attempts to create a new storage pool, and voila, we > get > >> > the storage source conflict because we're trying to create a new > >> > storage pool. > >> > > >> > So, I am left with a bunch of questions as to why it was done this > >> > way. Should I find a way to pull the secondary storage's real UUID, > >> > and use that in getStoragePoolByUri/createStoragePool, or should I > >> > continue using a random UUID, but fix createStoragePool to look > for > >> an > >> > existing storage source before trying to generate a new nfs > storage > >> > pool?