Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4E25E200D5C for ; Thu, 30 Nov 2017 09:28:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4CF15160BF4; Thu, 30 Nov 2017 08:28:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 761C9160BEA for ; Thu, 30 Nov 2017 09:28:06 +0100 (CET) Received: (qmail 58586 invoked by uid 500); 30 Nov 2017 08:28:05 -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 58576 invoked by uid 500); 30 Nov 2017 08:28:05 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 58568 invoked by uid 99); 30 Nov 2017 08:28:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Nov 2017 08:28:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 024DB1808AB for ; Thu, 30 Nov 2017 08:28:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id vJwlggvFPWMn for ; Thu, 30 Nov 2017 08:28:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id BE1FD5F640 for ; Thu, 30 Nov 2017 08:28:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id AF108E25B5 for ; Thu, 30 Nov 2017 08:28:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id E05E121061 for ; Thu, 30 Nov 2017 08:28:00 +0000 (UTC) Date: Thu, 30 Nov 2017 08:28:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-9586) When using local storage with Xenserver prepareTemplate does not work with multiple primary store MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 30 Nov 2017 08:28:07 -0000 [ https://issues.apache.org/jira/browse/CLOUDSTACK-9586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16272331#comment-16272331 ] ASF GitHub Bot commented on CLOUDSTACK-9586: -------------------------------------------- borisstoyanov commented on a change in pull request #2342: CLOUDSTACK-9586: Adding local storage test URL: https://github.com/apache/cloudstack/pull/2342#discussion_r154009949 ########## File path: test/integration/component/test_secsr_mount.py ########## @@ -0,0 +1,170 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from __builtin__ import False +""" BVT tests for Hosts Maintenance +""" + +# Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackAPI import * +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from nose.plugins.attrib import attr + +_multiprocess_shared_ = False + + +class TestSecSRMount(cloudstackTestCase): + + def setUp(self): + self.logger = logging.getLogger('TestSecSRMount') + self.stream_handler = logging.StreamHandler() + self.logger.setLevel(logging.DEBUG) + self.logger.addHandler(self.stream_handler) + self.apiclient = self.testClient.getApiClient() + self.hypervisor = self.testClient.getHypervisorInfo() + self.dbclient = self.testClient.getDbConnection() + self.services = self.testClient.getParsedTestDataConfig() + self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) + self.pod = get_pod(self.apiclient, self.zone.id) + self.cleanup = [] + self.services = { + "service_offering_local": { + "name": "Ultra Tiny Local Instance", + "displaytext": "Ultra Tiny Local Instance", + "cpunumber": 1, + "cpuspeed": 100, + "memory": 128, + "storagetype": "local" + }, + "vm": { + "username": "root", + "password": "password", + "ssh_port": 22, + # Hypervisor type should be same as + # hypervisor type of cluster + "privateport": 22, + "publicport": 22, + "protocol": 'TCP', + }, + "ostype": 'CentOS 5.3 (64-bit)', + "sleep": 30, + "timeout": 10, + } + + + def tearDown(self): + try: + # Clean up, terminate the created templates + cleanup_resources(self.apiclient, self.cleanup) + + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + + def isOnlyLocalStorageAvailable(self): + if not(self.zone.localstorageenabled): + return False + + storage_pools = StoragePool.list( + self.apiclient, + zoneid=self.zone.id, + listall=True + ) + self.assertEqual( + isinstance(storage_pools, list), + True, + "Check if listStoragePools returns a valid response" + ) + for storage_pool in storage_pools: + if storage_pool.type == u'NetworkFilesystem': + return False + + return True + + def areDownloaded(self, id): + # Fetch details of templates copied from table in database + qresultset = self.dbclient.execute( + "SELECT template_id, download_state FROM cloud.template_spool_ref, cloud.vm_template where \ + cloud.template_spool_ref.template_id=cloud.vm_template.id and cloud.vm_template.uuid='%s';" % + id) + self.logger.debug("Qresult %s" % format(qresultset)) + if not isinstance(qresultset, list) or len(qresultset) <= 1: + return False, 1 + + for result in qresultset: + self.logger.debug('Template %s download status %s' % (result[0], result[1])) + if result[1] != 'DOWNLOADED': + return False, 1 + + return True, 1 + + @attr( + tags=[ + "advanced", + "xenserver"], + required_hardware="true") + def test_01_prepare_template_local_storage(self): + + if not(self.isOnlyLocalStorageAvailable()): + raise unittest.SkipTest("Skipping this test as this is for Local storage on only."); + return + + listHost = Host.list( + self.apiclient, + type='Routing', + zoneid=self.zone.id, + podid=self.pod.id, + ) + for host in listHost: + self.logger.debug('Host id %s, hypervisor %s, localstorage %s' % (host.id, host.hypervisor, host.islocalstorageactive)) + + if len(listHost) < 2: + self.logger.debug("Prepare secondary storage race condition can be tested with two or more host only %s, found" % len(listHost)); + raise unittest.SkipTest("Prepare secondary storage can be tested with two host only %s, found" % len(listHost)); + return + + list_template_response = Template.list( + self.apiclient, + templatefilter='all', + zoneid=self.zone.id) + + template_response = list_template_response[0] Review comment: fixed ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org > When using local storage with Xenserver prepareTemplate does not work with multiple primary store > ------------------------------------------------------------------------------------------------- > > Key: CLOUDSTACK-9586 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9586 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > Components: Secondary Storage, XenServer > Affects Versions: 4.5.2 > Environment: XenServer 6.5 SP1 > Local Storage > Reporter: Abhinandan Prateek > Assignee: Abhinandan Prateek > Priority: Critical > Fix For: 4.9.1.0, 4.8.2.0, 4.10.1.0 > > > 2016-11-09 15:05:15,876 DEBUG [c.c.h.x.r.XenServerStorageProcessor] (DirectAgent-29:ctx-8d890b55) Failed to destroy pbd > SR_BACKEND_FAILURE_40The SR scan failed [opterr=['INTERNAL_ERROR', 'Db_exn.Uniqueness_constraint_violation("VDI", "uuid", "703f59ca-6e5e-38d3-bbef-707b5b14c704")']] > at com.xensource.xenapi.Types.checkResponse(Types.java:2021) > at com.xensource.xenapi.Connection.dispatch(Connection.java:395) > at com.cloud.hypervisor.xenserver.resource.XenServerConnectionPool$XenServerConnection.dispatch(XenServerConnectionPool.java:462) > at com.xensource.xenapi.SR.scan(SR.java:1257) > at com.cloud.hypervisor.xenserver.resource.Xenserver625StorageProcessor.createFileSR(Xenserver625StorageProcessor.java:113) > at com.cloud.hypervisor.xenserver.resource.Xenserver625StorageProcessor.createFileSr(Xenserver625StorageProcessor.java:139) > at com.cloud.hypervisor.xenserver.resource.Xenserver625StorageProcessor.copyTemplateToPrimaryStorage(Xenserver625StorageProcessor.java:173) > Root Cause: CloudPlatform creates a SR on each host, which points to the template location on the secondary storage (secondary_Storage/template/tmpl//). This causes the database unique constraint violation when each XenServer tries to scan the SR created on each host. The host that scans the SR last, throws the exception because VDI was recognized already from the SR scan of the first host. -- This message was sent by Atlassian JIRA (v6.4.14#64029)