Make a Xen specific requirement for guid on cluster really Xen specific, so that it won't affect KVM/VMware

This commit is contained in:
Kelven Yang 2010-12-20 14:53:04 -08:00
parent af2ce80621
commit 626a03ad78

View File

@ -1377,17 +1377,22 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS
if (host.getClusterId() != null) {
params.put("cluster", Long.toString(host.getClusterId()));
}
String guid = null;
ClusterVO cluster = _clusterDao.findById(host.getClusterId());
if ( cluster.getGuid() == null ) {
guid = host.getDetail("pool");
} else {
guid = cluster.getGuid();
if(cluster.getHypervisorType() == Hypervisor.HypervisorType.XenServer) {
if ( cluster.getGuid() == null ) {
guid = host.getDetail("pool");
} else {
guid = cluster.getGuid();
}
if( guid == null || guid.isEmpty() ) {
throw new CloudRuntimeException("Can not find guid for cluster " + cluster.getId() + " name " + cluster.getName());
}
params.put("pool", guid);
}
if( guid == null || guid.isEmpty() ) {
throw new CloudRuntimeException("Can not find guid for cluster " + cluster.getId() + " name " + cluster.getName());
}
params.put("pool", guid);
params.put("ipaddress", host.getPrivateIpAddress());
params.put("secondary.storage.vm", "false");
params.put("max.template.iso.size", _configDao.getValue("max.template.iso.size"));