Bug 11933 - Unable to add Primary Storage (OCFS2) to a OVM Cluster

Don't allow character beyond [A-Z0-9] in OCFS2 cluster name
it is not allowed by OCFS2 configure script

reviewed-by: edison
This commit is contained in:
frank 2011-11-10 17:05:11 -08:00
parent 3e124a9ad1
commit 66645ec478
3 changed files with 7 additions and 8 deletions

View File

@ -40,11 +40,13 @@ class OvmOCFS2(OvmObject):
for line in res.split('\n'):
if not 'Checking O2CB cluster' in line: continue
return not 'Offline' in line
def _load(self):
cmd = ['service o2cb load']
doCmd(cmd)
def _start(self, cluster):
#blank line are answer by clicking enter
cmd = ['service o2cb load']
doCmd(cmd)
config='''
y
o2cb

View File

@ -247,10 +247,11 @@ class OvmStoragePool(OvmObject):
def addNodes(nodes, clusterName):
ocfs2 = OvmOCFS2()
ocfs2._load()
isOnline = ocfs2._isClusterOnline(clusterName)
if not isOnline:
ocfs2._prepareConf(clusterName)
for n in nodes:
ocfs2._addNode(n['name'], n['number'], n['ip_address'], 7777, clusterName, isOnline)

View File

@ -108,11 +108,7 @@ public class OCFS2ManagerImpl implements OCFS2Manager, ResourceListener {
throw new CloudRuntimeException("Cannot get cluster for id " + clusterId);
}
String clusterName = cluster.getName();
if (clusterName == null) {
clusterName = "cluster" + cluster.getId();
}
String clusterName = "OvmCluster" + cluster.getId();
return clusterName;
}