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 A5C0510A51 for ; Sat, 2 Nov 2013 16:25:37 +0000 (UTC) Received: (qmail 43455 invoked by uid 500); 2 Nov 2013 16:25:34 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 43395 invoked by uid 500); 2 Nov 2013 16:25:32 -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 43387 invoked by uid 99); 2 Nov 2013 16:25:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Nov 2013 16:25:29 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of shadowsor@gmail.com designates 209.85.212.48 as permitted sender) Received: from [209.85.212.48] (HELO mail-vb0-f48.google.com) (209.85.212.48) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Nov 2013 16:25:23 +0000 Received: by mail-vb0-f48.google.com with SMTP id o19so425141vbm.7 for ; Sat, 02 Nov 2013 09:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8+dR+Crulhp7ObPg/g7UBXAAncT3rYYnerhhwS06hAk=; b=yKHf1udf/KPiZDG4kIoxuDSi+OQO6tfjbl+PLt+lipbshi4JLkkyW8kPLEz7eOqLs5 rR1FMK8tJLP0e7JsdsX5uktyNOU5DoPUo0PP3T57fkLaxwNtgn4tNXnbYLrRvMc0nHCl pSfyuzDQOxSIqLIIbrAQnz/FEA4S+5lmeitWOeejtwFljlPJAQm9fmdWq/n16gD/tAGd XICw+2BmAj5HxhSvxS/FHksbWTJ+wj9e3sBmQUH6z+6kmb/I40VUPOhMVxXuyrDWeLIJ CuKn4EPZWn8gHgnMALmnqWWyjoL8gIo5qSPlqBUT9anck2gx4ScBj3MYzBUwUDiD5p6f scbA== MIME-Version: 1.0 X-Received: by 10.52.170.232 with SMTP id ap8mr176208vdc.40.1383409502439; Sat, 02 Nov 2013 09:25:02 -0700 (PDT) Received: by 10.52.227.132 with HTTP; Sat, 2 Nov 2013 09:25:02 -0700 (PDT) Received: by 10.52.227.132 with HTTP; Sat, 2 Nov 2013 09:25:02 -0700 (PDT) In-Reply-To: <1674F150-4F00-4119-ADF4-69A2C2E9CDA2@citrix.com> References: <1674F150-4F00-4119-ADF4-69A2C2E9CDA2@citrix.com> Date: Sat, 2 Nov 2013 10:25:02 -0600 Message-ID: Subject: Re: S3 as secondary storage is broken in master From: Marcus Sorensen To: Min Chen Cc: dev@cloudstack.apache.org, "SuichII, Christopher" , Edison Su Content-Type: multipart/alternative; boundary=047d7b6d7aaef8d27a04ea341f32 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6d7aaef8d27a04ea341f32 Content-Type: text/plain; charset=ISO-8859-1 OK. I was thinking that S3 was acting as secondary storage now but really it still requires NFS as the intermediary, hence the "image cache". In that case your suggestion would work. On Nov 2, 2013 10:10 AM, "Min Chen" wrote: > No, Marcus. That piece of code worked in 4.2 for S3. Note that image ache > store is also NfsTO. > > Thanks > -min > > Sent from my iPhone > > > On Nov 2, 2013, at 7:18 AM, "Marcus Sorensen" > wrote: > > > > My only issue is that I believe copyTemplateToPrimaryStorage fails if > > the source datastore is not NfsTO, so I'm not sure if this change will > > do anything, or where S3 copy is actually handled. se > > copyTemplateToPrimaryStorage: > > > > KVM: > > if (!(imageStore instanceof NfsTO)) { > > return new CopyCmdAnswer("unsupported protocol"); > > } > > > > Xen (all logic wrapped in this if statement): > > if ((srcStore instanceof NfsTO) && (srcData.getObjectType() > > == DataObjectType.TEMPLATE)) { > > > > VMware: > > if (!(srcStore instanceof NfsTO)) { > > return new CopyCmdAnswer("unsupported protocol"); > > } > > > > This line of code has a history. In 4.2 it didn't work for S3, either. > > It specifically only allowed NFS: > > > > if ((srcData.getObjectType() == DataObjectType.TEMPLATE) && > > (srcDataStore instanceof NfsTO) && (destData.getDataStore().getRole() > > == DataStoreRole.Primary)) { > > > > Then for a short while it was changed during some refactoring Chris > > and Edison were working on: > > > > if ((srcData.getObjectType() == DataObjectType.TEMPLATE) && > > (destData.getObjectType() == DataObjectType.TEMPLATE && > > destData.getDataStore().getRole() == DataStoreRole.Primary)) { > > > > That broke CLVM, so I changed it to: > > > > if (srcData.getObjectType() == DataObjectType.TEMPLATE && > > srcData.getDataStore().getRole() == DataStoreRole.Image && > > destData.getDataStore().getRole() == DataStoreRole.Primary) { > > > >> On Fri, Nov 1, 2013 at 10:34 PM, Min Chen wrote: > >> Hi Marcus, > >> > >> Your commit a504c004bf10555e5ea67ec89fe7bf6f00fe4622 broke S3 > functionality. > >> With S3 as secondary storage, system vm cannot be started. Since for S3, > >> copy template to primary will be from an ImageCache store. Your > following > >> line of code : > >> > >> if (srcData.getObjectType() == DataObjectType.TEMPLATE && > >> srcData.getDataStore().getRole() == DataStoreRole.Image && > >> destData.getDataStore().getRole() == DataStoreRole.Primary) { > >> //copy template to primary storage > >> return processor.copyTemplateToPrimaryStorage(cmd); > >> } > >> > >> will not cover this case. I saw that you mentioned about this commit in > >> another thread about CLVM broken in master. To fix this problem, we can > >> change the above line to: > >> > >> if (srcData.getObjectType() == DataObjectType.TEMPLATE && > >> (srcData.getDataStore().getRole() == DataStoreRole.Image || > >> srcData.getDataStore().getRole() == DataStoreRole.ImageCache) && > >> destData.getDataStore().getRole() == DataStoreRole.Primary) { > >> //copy template to primary storage > >> return processor.copyTemplateToPrimaryStorage(cmd); > >> } > >> > >> Edison/Chris, do you see any issue with this fix? > >> > >> Thanks > >> -min > --047d7b6d7aaef8d27a04ea341f32--