[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14973180#comment-14973180
 ] 

ASF GitHub Bot commented on CLOUDSTACK-8941:
--------------------------------------------

Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/918#discussion_r42943657
  
    --- Diff: 
engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java ---
    @@ -1763,7 +1763,7 @@ private void orchestrateStorageMigration(final String 
vmUuid, final StoragePool
                 if (migrationResult) {
                     //if the vm is migrated to different pod in basic mode, 
need to reallocate ip
     
    -                if (!vm.getPodIdToDeployIn().equals(destPool.getPodId())) {
    +                if (destPool.getPodId() != null && 
!destPool.getPodId().equals(vm.getPodIdToDeployIn())) {
    --- End diff --
    
    destpool is not guaranteed to be not null either. Overlooked that detail 
before but maybe we want to change the condition to
    (destPool != null && destPool.getPodId() != null && 
!destPool.getPodId().equals(vm.getPodIdToDeployIn()))


> NPE when migrate vm to other zone-wide pools the second time
> ------------------------------------------------------------
>
>                 Key: CLOUDSTACK-8941
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8941
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>            Reporter: Wei Zhou
>            Assignee: Wei Zhou
>
> when I migrate vm to another zone wide pool, and migrate it again back or to 
> another pool, it will fail with the following NPE:
> 2015-10-06 12:29:11,114 ERROR [cloud.async.AsyncJobManagerImpl] 
> (Job-Executor-2:job-1587 = [ 72393be7-bc02-4974-b89d-53cbaa98916c ]) 
> Unexpected exception while executing 
> org.apache.cloudstack.api.command.admin.vm.MigrateVMCmd
> java.lang.NullPointerException
>         at 
> com.cloud.vm.VirtualMachineManagerImpl.orchestrateStorageMigration(VirtualMachineManagerImpl.java:1783)
>         at 
> com.cloud.vm.VirtualMachineManagerImpl.storageMigration(VirtualMachineManagerImpl.java:1734)
>         at 
> com.cloud.vm.UserVmManagerImpl.vmStorageMigration(UserVmManagerImpl.java:4342)
>         at 
> org.apache.cloudstack.api.command.admin.vm.MigrateVMCmd.execute(MigrateVMCmd.java:166)
>         at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:161)
>         at 
> com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:97)
>         at 
> org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:507)
> This is because the pod_id is set to NULL at the first time when I migrate 
> the instance to a zone-wide pool (not cluster-wide).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to