Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ public interface StorageManager extends StorageService {
ConfigKey<String> PreferredStoragePool = new ConfigKey<String>(String.class, "preferred.storage.pool", "Advanced", "",
"The UUID of preferred storage pool for allocation.", true, ConfigKey.Scope.Account, null);

ConfigKey<Boolean> MountDisabledStoragePool = new ConfigKey<>(Boolean.class,
"mount.disabled.storage.pool",
"Storage",
"false",
"Mount all zone-wide or cluster-wide disabled storage pools after node reboot",
true,
ConfigKey.Scope.Cluster,
Comment thread
nvazquez marked this conversation as resolved.
null);

/**
* Returns a comma separated list of tags for the specified storage pool
* @param poolId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3340,7 +3340,8 @@ public ConfigKey<?>[] getConfigKeys() {
MaxDataMigrationWaitTime,
DiskProvisioningStrictness,
PreferredStoragePool,
SecStorageVMAutoScaleDown
SecStorageVMAutoScaleDown,
MountDisabledStoragePool
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import javax.inject.Inject;

import com.cloud.storage.StorageManager;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
Expand All @@ -44,7 +45,6 @@
import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StorageManagerImpl;
import com.cloud.storage.StoragePoolHostVO;
import com.cloud.storage.StoragePoolStatus;

public class StoragePoolMonitor implements Listener {
private static final Logger s_logger = Logger.getLogger(StoragePoolMonitor.class);
Expand Down Expand Up @@ -108,10 +108,17 @@ public void processConnect(Host host, StartupCommand cmd, boolean forRebalance)
List<StoragePoolVO> zoneStoragePoolsByAnyHypervisor = _poolDao.findZoneWideStoragePoolsByHypervisor(host.getDataCenterId(), HypervisorType.Any);
pools.addAll(zoneStoragePoolsByAnyHypervisor);

// get the zone wide disabled pools list if global setting is true.
if (StorageManager.MountDisabledStoragePool.value()) {
pools.addAll(_poolDao.findDisabledPoolsByScope(host.getDataCenterId(), null, null, ScopeType.ZONE));
Comment thread
nvazquez marked this conversation as resolved.
Comment thread
nvazquez marked this conversation as resolved.
}

// get the cluster wide disabled pool list
if (StorageManager.MountDisabledStoragePool.valueIn(host.getClusterId())) {
pools.addAll(_poolDao.findDisabledPoolsByScope(host.getDataCenterId(), host.getPodId(), host.getClusterId(), ScopeType.CLUSTER));
}

for (StoragePoolVO pool : pools) {
if (pool.getStatus() != StoragePoolStatus.Up) {
Comment thread
weizhouapache marked this conversation as resolved.
continue;
}
if (!pool.isShared()) {
continue;
}
Expand Down