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 5ED4518D30 for ; Wed, 24 Feb 2016 10:03:34 +0000 (UTC) Received: (qmail 77434 invoked by uid 500); 24 Feb 2016 10:03:18 -0000 Delivered-To: apmail-cloudstack-issues-archive@cloudstack.apache.org Received: (qmail 77386 invoked by uid 500); 24 Feb 2016 10:03:18 -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 77365 invoked by uid 500); 24 Feb 2016 10:03:18 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 77361 invoked by uid 99); 24 Feb 2016 10:03:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 10:03:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 167FE2C14F8 for ; Wed, 24 Feb 2016 10:03:18 +0000 (UTC) Date: Wed, 24 Feb 2016 10:03:18 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-8829) Consecutive cold migration fails 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-8829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15162760#comment-15162760 ] ASF GitHub Bot commented on CLOUDSTACK-8829: -------------------------------------------- Github user maneesha-p commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/797#discussion_r53916405 --- Diff: engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java --- @@ -1776,19 +1773,26 @@ private void orchestrateStorageMigration(final String vmUuid, final StoragePool // If VM was cold migrated between clusters belonging to two different VMware DCs, // unregister the VM from the source host and cleanup the associated VM files. if (vm.getHypervisorType().equals(HypervisorType.VMware)) { + Long srcClusterId = null; + Long srcHostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId(); + if (srcHostId != null) { + HostVO srcHost = _hostDao.findById(srcHostId); --- End diff -- @alexandrelimassantana 'srcHost' variable is local to the if-block but 'srcClusterId' variable that is populated inside the if-block is outside the scope of it and as @GabrielBrascher mentioned its being used in line 1784. > Consecutive cold migration fails > -------------------------------- > > Key: CLOUDSTACK-8829 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8829 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > Reporter: Maneesha > Assignee: Maneesha > > The following scenario is broken: > 1. Deploy VM and stop it > 2. Migrate stopped VM to a different primary storage pool > 3. Again migrate the same VM to another/same storage pool. Fails with NPE. > java.lang.NullPointerException > at com.cloud.vm.VirtualMachineManagerImpl.orchestrateStorageMigration(VirtualMachineManagerImpl.java:1745) > at com.cloud.vm.VirtualMachineManagerImpl.orchestrateStorageMigration(VirtualMachineManagerImpl.java:4716) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at com.cloud.vm.VmWorkJobHandlerProxy.handleVmWorkJob(VmWorkJobHandlerProxy.java:107) > at com.cloud.vm.VirtualMachineManagerImpl.handleVmWorkJob(VirtualMachineManagerImpl.java:4723) > at com.cloud.vm.VmWorkJobDispatcher.runJob(VmWorkJobDispatcher.java:103) -- This message was sent by Atlassian JIRA (v6.3.4#6332)