You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2013/08/27 03:11:42 UTC
git commit: updated refs/heads/4.2-forward to 816772a
Updated Branches:
refs/heads/4.2-forward 697cc2e39 -> 816772a00
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/816772a0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/816772a0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/816772a0
Branch: refs/heads/4.2-forward
Commit: 816772a001f48f0b8f79a89242de2bc38aef8ca4
Parents: 697cc2e
Author: Edison Su <su...@gmail.com>
Authored: Mon Aug 26 18:07:18 2013 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Mon Aug 26 18:11:25 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/816772a0/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/816772a0/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 4a61f70..123a9f1 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());
}