Summary: Don't add secondary storage to KVM heartbeat

BUG-ID: CLOUDSTACK-2173
Bugfix-for: 4.2
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1366865750 -0600
This commit is contained in:
Marcus Sorensen 2013-04-24 22:55:50 -06:00
parent 299cccf779
commit 33006ff197
2 changed files with 14 additions and 5 deletions

View File

@ -55,9 +55,10 @@ public class KVMHAMonitor extends KVMHABase implements Runnable {
public void removeStoragePool(String uuid) {
synchronized (_storagePool) {
NfsStoragePool pool = this._storagePool.get(uuid);
Script.runSimpleBashScript("umount " + pool._mountDestPath);
s_logger.debug("attempted to umount '" + pool._mountDestPath + "'");
this._storagePool.remove(uuid);
if (pool != null) {
Script.runSimpleBashScript("umount " + pool._mountDestPath);
this._storagePool.remove(uuid);
}
}
}

View File

@ -94,18 +94,26 @@ public class KVMStoragePoolManager {
protocol = StoragePoolType.NetworkFilesystem;
}
return createStoragePool(uuid, sourceHost, 0, sourcePath, "", protocol);
// secondary storage registers itself through here
return createStoragePool(uuid, sourceHost, 0, sourcePath, "", protocol, false);
}
public KVMStoragePool createStoragePool( String name, String host, int port,
String path, String userInfo,
StoragePoolType type) {
// primary storage registers itself through here
return createStoragePool(name, host, port, path, userInfo, type, true);
}
private KVMStoragePool createStoragePool( String name, String host, int port,
String path, String userInfo,
StoragePoolType type, boolean primaryStorage) {
StorageAdaptor adaptor = getStorageAdaptor(type);
KVMStoragePool pool = adaptor.createStoragePool(name,
host, port, path, userInfo, type);
// LibvirtStorageAdaptor-specific statement
if (type == StoragePoolType.NetworkFilesystem) {
if (type == StoragePoolType.NetworkFilesystem && primaryStorage) {
KVMHABase.NfsStoragePool nfspool = new KVMHABase.NfsStoragePool(
pool.getUuid(), host, path, pool.getLocalPath(),
PoolType.PrimaryStorage);