This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 1389862  engine/storage: Fix regression on create volume from snapshot 
(#5282)
1389862 is described below

commit 1389862c22ed48234f2a3ff4e8e8d4d5ea824c7c
Author: Daniel Augusto Veronezi Salvador 
<[email protected]>
AuthorDate: Mon Aug 9 05:07:10 2021 -0300

    engine/storage: Fix regression on create volume from snapshot (#5282)
    
    * Fix regression on create volume from snapshot
    
    * Log hidden exception
    
    * Revert "Log hidden exception"
    
    This reverts commit 70e655687faf9bafe47d44b3c9177742e5cb791f.
    
    Co-authored-by: GutoVeronezi <[email protected]>
---
 .../cloudstack/storage/allocator/AbstractStoragePoolAllocator.java   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
 
b/engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
index 3b07fe9..af206a7 100644
--- 
a/engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
+++ 
b/engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
@@ -185,6 +185,11 @@ public abstract class AbstractStoragePoolAllocator extends 
AdapterBase implement
             pools = reorderPoolsByCapacity(plan, pools);
         }
 
+        if (vmProfile.getVirtualMachine() == null) {
+            s_logger.trace("The VM is null, skipping pools reordering by disk 
provisioning type.");
+            return pools;
+        }
+
         if (vmProfile.getHypervisorType() == HypervisorType.VMware &&
                 
!storageMgr.DiskProvisioningStrictness.valueIn(plan.getDataCenterId())) {
             pools = reorderPoolsByDiskProvisioningType(pools, dskCh);

Reply via email to