mirror of https://github.com/apache/cloudstack.git
Bug 8966 - Oracle VM (OVM) support
OCFS2 support -- prepare OCFS2 nodes
This commit is contained in:
parent
c400253b54
commit
c6fba0fd42
|
|
@ -96,7 +96,8 @@ public class Storage {
|
|||
LVM(false), // XenServer local LVM SR
|
||||
SharedMountPoint(true),
|
||||
VMFS(true), // VMware VMFS storage
|
||||
PreSetup(true); // for XenServer, Storage Pool is set up by customers.
|
||||
PreSetup(true), // for XenServer, Storage Pool is set up by customers.
|
||||
OCFS2(true);
|
||||
|
||||
|
||||
boolean shared;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public interface Listener {
|
|||
* @param state the current state of the agent.
|
||||
*/
|
||||
boolean processDisconnect(long agentId, Status state);
|
||||
|
||||
|
||||
/**
|
||||
* If this Listener is passed to the send() method, this method
|
||||
* is called by AgentManager after processing an answer
|
||||
|
|
|
|||
|
|
@ -76,6 +76,5 @@ public class ClusterAsyncExectuionListener implements Listener {
|
|||
public int getTimeout() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ import com.cloud.network.security.dao.VmRulesetLogDaoImpl;
|
|||
import com.cloud.network.vpn.RemoteAccessVpnManagerImpl;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
|
||||
import com.cloud.service.dao.ServiceOfferingDaoImpl;
|
||||
import com.cloud.storage.OCFS2ManagerImpl;
|
||||
import com.cloud.storage.StorageManagerImpl;
|
||||
import com.cloud.storage.dao.DiskOfferingDaoImpl;
|
||||
import com.cloud.storage.dao.GuestOSCategoryDaoImpl;
|
||||
|
|
@ -319,6 +320,7 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com
|
|||
addManager("VirtualMachineManager", ClusteredVirtualMachineManagerImpl.class);
|
||||
addManager("HypervisorGuruManager", HypervisorGuruManagerImpl.class);
|
||||
addManager("ClusterFenceManager", ClusterFenceManagerImpl.class);
|
||||
addManager("OCFS2Manager", OCFS2ManagerImpl.class);
|
||||
|
||||
ComponentInfo<? extends Manager> info = addManager("ConsoleProxyManager", ConsoleProxyManagerImpl.class);
|
||||
info.addParameter("consoleproxy.sslEnabled", "true");
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public class ClusterDetailsDaoImpl extends GenericDaoBase<ClusterDetailsVO, Long
|
|||
|
||||
return findOneIncludingRemovedBy(sc);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, String> findDetails(long clusterId) {
|
||||
|
|
|
|||
0
server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
Normal file → Executable file
0
server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
Normal file → Executable file
|
|
@ -575,6 +575,5 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
|
|||
@Override
|
||||
public boolean processTimeout(long agentId, long seq) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,5 +181,4 @@ public class OvsListener implements Listener {
|
|||
public boolean processTimeout(long agentId, long seq) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,5 +130,4 @@ public class OvsTunnelListener implements Listener {
|
|||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,5 +152,4 @@ public class SecurityGroupListener implements Listener {
|
|||
public boolean processTimeout(long agentId, long seq) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,5 +134,4 @@ public class LocalStoragePoolListener implements Listener {
|
|||
public boolean processTimeout(long agentId, long seq) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -279,6 +279,9 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
protected StoragePoolWorkDao _storagePoolWorkDao;
|
||||
@Inject
|
||||
protected HypervisorGuruManager _hvGuruMgr;
|
||||
|
||||
@Inject
|
||||
protected OCFS2Manager _ocfs2Mgr;
|
||||
|
||||
@Inject(adapter = StoragePoolAllocator.class)
|
||||
protected Adapters<StoragePoolAllocator> _storagePoolAllocators;
|
||||
|
|
@ -1109,6 +1112,9 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
pool = new StoragePoolVO(StoragePoolType.ISO, storageHost, port, hostPath);
|
||||
} else if (scheme.equalsIgnoreCase("vmfs")) {
|
||||
pool = new StoragePoolVO(StoragePoolType.VMFS, "VMFS datastore: " + hostPath, 0, hostPath);
|
||||
} else if (scheme.equalsIgnoreCase("ocfs2")) {
|
||||
port = 7777;
|
||||
pool = new StoragePoolVO(StoragePoolType.OCFS2, "clustered", port, hostPath);
|
||||
} else {
|
||||
s_logger.warn("Unable to figure out the scheme for URI: " + uri);
|
||||
throw new IllegalArgumentException("Unable to figure out the scheme for URI: " + uri);
|
||||
|
|
@ -1156,6 +1162,12 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
pool.setStatus(StoragePoolStatus.Up);
|
||||
pool = _storagePoolDao.persist(pool, details);
|
||||
|
||||
if (pool.getPoolType() == StoragePoolType.OCFS2 && !_ocfs2Mgr.prepareNodes(allHosts, pool, cmd.getFullUrlParams())) {
|
||||
s_logger.warn("Can not create storage pool " + pool + " on cluster " + clusterId);
|
||||
_storagePoolDao.expunge(pool.getId());
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean success = false;
|
||||
for (HostVO h : allHosts) {
|
||||
success = createStoragePool(h.getId(), pool);
|
||||
|
|
@ -1348,7 +1360,7 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
s_logger.debug("creating pool " + pool.getName() + " on host " + hostId);
|
||||
if (pool.getPoolType() != StoragePoolType.NetworkFilesystem && pool.getPoolType() != StoragePoolType.Filesystem && pool.getPoolType() != StoragePoolType.IscsiLUN
|
||||
&& pool.getPoolType() != StoragePoolType.Iscsi && pool.getPoolType() != StoragePoolType.VMFS && pool.getPoolType() != StoragePoolType.SharedMountPoint
|
||||
&& pool.getPoolType() != StoragePoolType.PreSetup) {
|
||||
&& pool.getPoolType() != StoragePoolType.PreSetup && pool.getPoolType() != StoragePoolType.OCFS2) {
|
||||
s_logger.warn(" Doesn't support storage pool type " + pool.getPoolType());
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,14 +32,18 @@ import com.cloud.exception.ConnectionException;
|
|||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.storage.OCFS2Manager;
|
||||
import com.cloud.storage.StorageManagerImpl;
|
||||
import com.cloud.storage.StoragePoolVO;
|
||||
import com.cloud.storage.Storage.StoragePoolType;
|
||||
import com.cloud.storage.dao.StoragePoolDao;
|
||||
import com.cloud.utils.component.Inject;
|
||||
|
||||
public class StoragePoolMonitor implements Listener {
|
||||
private static final Logger s_logger = Logger.getLogger(StoragePoolMonitor.class);
|
||||
private final StorageManagerImpl _storageManager;
|
||||
private final StoragePoolDao _poolDao;
|
||||
@Inject OCFS2Manager _ocfs2Mgr;
|
||||
|
||||
public StoragePoolMonitor(StorageManagerImpl mgr, StoragePoolDao poolDao) {
|
||||
this._storageManager = mgr;
|
||||
|
|
@ -73,6 +77,11 @@ public class StoragePoolMonitor implements Listener {
|
|||
if (!pool.getPoolType().isShared()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pool.getPoolType() == StoragePoolType.OCFS2 && !_ocfs2Mgr.prepareNodes(pool.getClusterId())) {
|
||||
throw new ConnectionException(true, "Unable to prepare OCFS2 nodes for pool " + pool.getId());
|
||||
}
|
||||
|
||||
Long hostId = host.getId();
|
||||
s_logger.debug("Host " + hostId + " connected, sending down storage pool information ...");
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -79,6 +79,5 @@ public class StorageSyncListener implements Listener {
|
|||
@Override
|
||||
public int getTimeout() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
0
server/src/com/cloud/storage/secondary/SecondaryStorageListener.java
Normal file → Executable file
0
server/src/com/cloud/storage/secondary/SecondaryStorageListener.java
Normal file → Executable file
|
|
@ -446,5 +446,4 @@ public class UploadListener implements Listener {
|
|||
public void setCurrState(Status uploadState) {
|
||||
this.currState = getState(currState.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue