From 626a03ad78de7ed1748d79eee0ff091dc9b9b132 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Mon, 20 Dec 2010 14:53:04 -0800 Subject: [PATCH] Make a Xen specific requirement for guid on cluster really Xen specific, so that it won't affect KVM/VMware --- .../cloud/agent/manager/AgentManagerImpl.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index e52ca6546c5..6d8b31d3103 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -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"));