cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/4.4 to 93cc3e8
Date Tue, 27 May 2014 14:40:01 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 c83e90b00 -> 93cc3e80d


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.


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

Branch: refs/heads/4.4
Commit: 93cc3e80d9b534a49591f16fa9b86876f841c321
Parents: c83e90b
Author: Wido den Hollander <wido@widodh.nl>
Authored: Tue May 27 16:18:25 2014 +0200
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue May 27 16:39:49 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93cc3e80/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 52bbef3..681fcee 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
@@ -539,6 +539,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);


Mime
View raw message