"http://localhost/distros/apache/1.0.1/zookeeper-3.4.3.tar.gz");
IResourcePoolService resPoolSvc =
context.getBean("resourcePoolService", IResourcePoolService.class);
IDatastoreService dsSvc =
context.getBean("datastoreService", IDatastoreService.class);
INetworkService netSvc =
context.getBean("networkService", INetworkService.class);
cleanUpUtils = new TestResourceCleanupUtils();
cleanUpUtils.setDsSvc(dsSvc);
cleanUpUtils.setNetSvc(netSvc);
cleanUpUtils.setResPoolSvc(resPoolSvc);
cleanupResources();
try {
Set<String> rpNames = resPoolSvc.getAllRPNames();
logger.info("available resource pools: " + rpNames);
resPoolSvc.addResourcePool("myRp1", "cluster1", "rp1");
} catch (Exception e) {
logger.error("ignore create resource pool myRp1 exception. ", e);
}
try {
resPoolSvc.addResourcePool("myRp2", "cluster1", "rp2");
} catch (Exception e) {
logger.error("ignore create resource pool myRp2 exception. ", e);
}
try {
resPoolSvc.addResourcePool("myRp3", "cluster2", "rp1");
} catch (Exception e) {
logger.error("ignore create resource pool myRp3 exception. ", e);
}
try {
resPoolSvc.addResourcePool("myRp4", "cluster2", "rp2");
} catch (Exception e) {
logger.error("ignore create resource pool myRp4 exception. ", e);
}
try {
resPoolSvc.addResourcePool("myRp5", "cluster4", "rp1");
} catch (Exception e) {
logger.error("ignore create resource pool myRp5 exception. ", e);
}
try {
resPoolSvc.addResourcePool("myRp6", "cluster4", "rp2");
} catch (Exception e) {
logger.error("ignore create resource pool myRp6 exception. ", e);
}
try {
netSvc.addDhcpNetwork("dhcpNet1", "CFNetwork");
} catch (Exception e) {
logger.error("ignore create network dhcpNet1 exception. ", e);
}
List<String> sharedStores = new ArrayList<String>();
sharedStores.add("share1");
sharedStores.add("share2");
try {
clusterConfigMgr.getDatastoreMgr().addDatastores("testSharedStore",
DatastoreType.SHARED, sharedStores, false);
} catch (Exception e) {
logger.error("ignore create datastore testSharedStore exception. ", e);
}
List<String> localStores = new ArrayList<String>();
localStores.add("local1");
localStores.add("vmfs*");
try {
clusterConfigMgr.getDatastoreMgr().addDatastores("testLocalStore",
DatastoreType.LOCAL, localStores, false);
} catch (Exception e) {
logger.error("ignore create datastore testLocalStore exception. ", e);
}
List<IpBlock> ipBlocks = new ArrayList<IpBlock>();
IpBlock ip1 = new IpBlock();
ip1.setBeginIp("192.168.1.1");
ip1.setEndIp("192.168.1.3");
ipBlocks.add(ip1);
IpBlock ip2 = new IpBlock();
ip2.setBeginIp("192.168.1.102");
ip2.setEndIp("192.168.1.102");
ipBlocks.add(ip2);
IpBlock ip3 = new IpBlock();
ip3.setBeginIp("192.168.1.104");
ip3.setEndIp("192.168.1.204");
ipBlocks.add(ip3);
try {
netSvc.addIpPoolNetwork("ipPool1", "CFNetwork1", "255.255.0.0",
"192.168.1.254", "2.2.2.2", null, ipBlocks);
} catch (Exception e) {
logger.error("ignore create network ipPool1 exception. ", e);
}
}