Return-Path: X-Original-To: apmail-cloudstack-issues-archive@www.apache.org Delivered-To: apmail-cloudstack-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1FBD9182EC for ; Sun, 11 Oct 2015 05:00:11 +0000 (UTC) Received: (qmail 39039 invoked by uid 500); 11 Oct 2015 05:00:11 -0000 Delivered-To: apmail-cloudstack-issues-archive@cloudstack.apache.org Received: (qmail 39010 invoked by uid 500); 11 Oct 2015 05:00:10 -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 38902 invoked by uid 500); 11 Oct 2015 05:00:10 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 38816 invoked by uid 99); 11 Oct 2015 05:00:10 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Oct 2015 05:00:10 +0000 Date: Sun, 11 Oct 2015 05:00:10 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-8944) Template download possible from new secondary storages before the download is 100 % complete MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-8944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14952157#comment-14952157 ] ASF GitHub Bot commented on CLOUDSTACK-8944: -------------------------------------------- Github user sateesh-chodapuneedi commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/921#discussion_r41705286 --- Diff: server/src/com/cloud/template/TemplateManagerImpl.java --- @@ -509,7 +509,7 @@ private String extract(Account caller, Long templateId, String url, Long zoneId, for (DataStore store : ssStores) { tmpltStoreRef = _tmplStoreDao.findByStoreTemplate(store.getId(), templateId); if (tmpltStoreRef != null) { - if (tmpltStoreRef.getDownloadState() == com.cloud.storage.VMTemplateStorageResourceAssoc.Status.DOWNLOADED) { + if (tmpltStoreRef.getDownloadState() == com.cloud.storage.VMTemplateStorageResourceAssoc.Status.DOWNLOADED && tmpltStoreRef.getDownloadPercent() == 100) { --- End diff -- @yvsubhash thanks for the patch. Can we address this (add this check) while setting the download state to DOWNLOADED? That way unless download progress is 100%, the template would not move to DOWNLOADED state. Also good add a unit here, checking if template download progress is 100 if template state is DOWNLOADED. > Template download possible from new secondary storages before the download is 100 % complete > -------------------------------------------------------------------------------------------- > > Key: CLOUDSTACK-8944 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8944 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > Affects Versions: 4.5.2 > Environment: xenserver host with nfs storage > Reporter: subhash yedugundla > > ISSUE > ================== > Secondary Storage ( Parent is NULL in the database ) > after secondary storage is added from the CloudStack GUI which in turn leads to a invalid download URL for a template > > TROUBLESHOOTING > =================== > The parameter provided when the Secondary storage created > Name: > Provider:NFS > Zone:dev3-z1 > Server:192.168.125.12 > Path:/vol/dev03/test > when we add secondary storage > {noformat} > 2015-06-11 07:27:40,686 TRACE [c.c.u.d.T.Statement] (catalina-exec-19:ctx-11906a2c ctx-550a6e46) (logid:0fb48736) Closing: com.mysql.jdbc.JDBC4PreparedStatement@7e703121: INSERT INTO image_store (image_store.id, image_store.name, image_store.uuid, image_store.protocol, image_store.url, image_store.image_provider_name, image_store.data_center_id, image_store.scope, image_store.created, image_store.role, image_store.parent, image_store.total_size, image_store.used_bytes) VALUES (0, _binary'sec3', _binary'471d5edc-424e-41fb-a21e-47e53670fe62', _binary'nfs', _binary'nfs://10.104.49.65/nfs/sec3', _binary'NFS', 1, 'ZONE', '2015-06-11 01:57:40', 'Image', null, null, null) > mysql> select * from image_store where id=3 \G; > *************************** 1. row *************************** > id: 3 > name: sec3 > image_provider_name: NFS > protocol: nfs > url: nfs://10.104.49.65/nfs/sec3 > data_center_id: 1 > scope: ZONE > role: Image > uuid: 471d5edc-424e-41fb-a21e-47e53670fe62 > parent: NULL > created: 2015-06-11 01:57:40 > removed: NULL > total_size: NULL > used_bytes: NULL > 1 row in set (0.00 sec) > {noformat} > Template download falils if the parent is NULL > The URL published when the customer extract the template gives 403 forbidden error. > Example : > Template id:3343 > The URL is below. > https://210-140-168-1.systemip.idcfcloud.com/userdata/8aa50513-e60e-481f-989d-5bbd119504df.ova > The template is stored on the new mount-point (je01v-secstr01-02 ) > {noformat} > root@s-1-VM:/var/www/html/userdata# df -h > Filesystem Size Used Avail Use% Mounted on > rootfs 276M 144M 118M 55% / > udev 10M 0 10M 0% /dev > tmpfs 201M 224K 201M 1% /run > /dev/disk/by-uuid/1458767f-a01a-4237-89e8-930f8c42fffe 276M 144M 118M 55% / > tmpfs 5.0M 0 5.0M 0% /run/lock > tmpfs 515M 0 515M 0% /run/shm > /dev/sda1 45M 22M 21M 51% /boot > /dev/sda6 98M 5.6M 88M 6% /home > /dev/sda8 368M 11M 339M 3% /opt > /dev/sda10 63M 5.3M 55M 9% /tmp > /dev/sda7 610M 518M 61M 90% /usr > /dev/sda9 415M 248M 146M 63% /var > 10.133.245.11:/je01v-secstr01-01 16T 11T 5.5T 66% /mnt/SecStorage/8c0f1709-5d1d-3f0e-b100-ccfb873cf3ff > 10.133.245.11:/je01v-secstr01-02 5.9T 4.0T 1.9T 69% /mnt/SecStorage/22836274-19c4-301a-80d8-690f16530e0a **THIS ONE > From the SSVM > root@s-1-VM:/var/www/html/userdata# ls -lah | grep 3343 > lrwxrwxrwx 1 root root 83 May 20 06:11 8aa50513-e60e-481f-989d-5bbd119504df.ova -> /mnt/SecStorage/null/template/tmpl/19/3343/d93d6fcf-bb4e-3287-8346-a7781c39ecdb.ova > {noformat} > The symbolic link is "/mnt/SecStorage/null/template/tmpl/19/3343/d93d6fcf-bb4e-3287-8346-a7781c39ecdb.ova". > We assumed the problem is that the link contains "null" directory. > The correct symbolic link should be "/mnt/SecStorage/22836274-19c4-301a-80d8-690f16530e0a/template/tmpl/19/3343/d93d6fcf-bb4e-3287-8346-a7781c39ecdb.ova" -- This message was sent by Atlassian JIRA (v6.3.4#6332)