mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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.
This commit is contained in:
parent
d093a8a7b4
commit
48899e4c81
@ -546,6 +546,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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user