You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/11/25 20:05:02 UTC

[06/20] git commit: updated refs/heads/4.3 to 67df5b9

CLOUDSTACK-6783: Return a proper LibvirtStoragePool object after creating the pool

In situations where libvirt lost the storage pool the KVM Agent will re-create the
storage pool in libvirt.

This could be then libvirt is restarted for example.

The object returned internally was missing essential information like the sourceDir
aka the Ceph pool, the monitor IPs, cephx information and such.

In this case the first operation on this newly created pool would fail. All operations
afterwards would succeed.

(cherry picked from commit 48899e4c815dc2db7c714db08577d253bd5e2a09)
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/4.3
Commit: df7be28266861a7f0d92fc3541d802d6edce5be7
Parents: 8992e18
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Tue May 27 16:18:25 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Nov 25 22:53:53 2014 +0530

----------------------------------------------------------------------
 .../hypervisor/kvm/storage/LibvirtStorageAdaptor.java | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df7be282/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 76659ec..2925b6f 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
@@ -545,6 +545,20 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
                 pool.setLocalPath("");
             }
 
+            if (pool.getType() == StoragePoolType.RBD
+             || pool.getType() == StoragePoolType.Gluster) {
+                pool.setSourceHost(spd.getSourceHost());
+                pool.setSourcePort(spd.getSourcePort());
+                pool.setSourceDir(spd.getSourceDir());
+                String authUsername = spd.getAuthUserName();
+                if (authUsername != null) {
+                    Secret secret = conn.secretLookupByUUIDString(spd.getSecretUUID());
+                    String secretValue = new String(Base64.encodeBase64(secret.getByteValue()));
+                    pool.setAuthUsername(authUsername);
+                    pool.setAuthSecret(secretValue);
+                }
+            }
+
             pool.setCapacity(sp.getInfo().capacity);
             pool.setUsed(sp.getInfo().allocation);
             pool.setAvailable(sp.getInfo().available);