cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [15/34] git commit: updated refs/heads/ui-restyle to 23093ed
Date Thu, 26 Sep 2013 18:03:16 GMT
CLOUDSTACK-4459:
Libvirt reports:
org.libvirt.LibvirtException: Storage volume not found: no storage vol
with matching name
in some cases, if the volume is created on one kvm host, while accessed
from other host.
It's possible due to concurrent access(read/write) storage.
The current fix is to try serveral times, and wait for 30 seconds for
each retry.
If the issue still there, then need to sync the storage pool access


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b695484d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b695484d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b695484d

Branch: refs/heads/ui-restyle
Commit: b695484dc75647d01ac59c14fb859a8b0338c819
Parents: dda1133
Author: Edison Su <sudison@gmail.com>
Authored: Mon Aug 26 18:07:18 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Wed Sep 25 16:13:38 2013 -0700

----------------------------------------------------------------------
 .../hypervisor/kvm/storage/KVMStoragePoolManager.java  |  8 ++++++--
 .../hypervisor/kvm/storage/LibvirtStorageAdaptor.java  | 13 ++++++++++---
 2 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b695484d/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
index 7fef6ff..e09c9ba 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
@@ -97,6 +97,7 @@ public class KVMStoragePoolManager {
     }
 
     public KVMStoragePool getStoragePool(StoragePoolType type, String uuid) {
+
         StorageAdaptor adaptor = getStorageAdaptor(type);
         KVMStoragePool pool = null;
         try {
@@ -149,12 +150,15 @@ public class KVMStoragePoolManager {
                 if (vol != null) {
                     break;
                 }
-
-                Thread.sleep(10000);
             } catch (Exception e) {
                 s_logger.debug("Failed to find volume:" + volName + " due to" + e.toString()
+ ", retry:" + cnt);
                 errMsg = e.toString();
             }
+
+            try {
+                Thread.sleep(30000);
+            } catch (InterruptedException e) {
+            }
             cnt++;
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b695484d/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index 53eb80a..b2bdd5b 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -101,10 +101,15 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
         try {
             vol = pool.storageVolLookupByName(volName);
         } catch (LibvirtException e) {
-
+            s_logger.debug("Can't find volume: " + e.toString());
         }
         if (vol == null) {
-            storagePoolRefresh(pool);
+            try {
+                refreshPool(pool);
+            } catch (LibvirtException e) {
+                s_logger.debug("failed to refresh pool: " + e.toString());
+            }
+
             try {
                 vol = pool.storageVolLookupByName(volName);
             } catch (LibvirtException e) {
@@ -119,6 +124,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
         LibvirtStorageVolumeDef volDef = new LibvirtStorageVolumeDef(UUID
                 .randomUUID().toString(), size, format, null, null);
         s_logger.debug(volDef.toString());
+
         return pool.storageVolCreateXML(volDef.toString(), 0);
     }
 
@@ -128,7 +134,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
                 refreshPool(pool);
             }
         } catch (LibvirtException e) {
-
+            s_logger.debug("refresh storage pool failed: " + e.toString());
         }
     }
 
@@ -438,6 +444,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
             }
             return disk;
         } catch (LibvirtException e) {
+            s_logger.debug("Failed to get physical disk:", e);
             throw new CloudRuntimeException(e.toString());
         }
 


Mime
View raw message