diff --git a/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java b/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java index a3c6208e4f7..23b259a788f 100755 --- a/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java +++ b/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java @@ -14,6 +14,7 @@ import javax.naming.ConfigurationException; import org.apache.log4j.Logger; import org.apache.xmlrpc.XmlRpcException; +import com.cloud.configuration.Config; import com.cloud.dc.ClusterVO; import com.cloud.dc.dao.ClusterDao; import com.cloud.exception.DiscoveryException; @@ -32,11 +33,22 @@ import com.cloud.utils.ssh.SSHCmdHelper; @Local(value=Discoverer.class) public class OvmDiscoverer extends DiscovererBase implements Discoverer { private static final Logger s_logger = Logger.getLogger(OvmDiscoverer.class); + protected String _publicNetworkDevice; + protected String _privateNetworkDevice; + protected String _guestNetworkDevice; @Inject ClusterDao _clusterDao; + @Override + public boolean configure(String name, Map params) throws ConfigurationException { + super.configure(name, params); + _publicNetworkDevice = _params.get(Config.OvmPublicNetwork.key()); + _privateNetworkDevice = _params.get(Config.OvmPrivateNetwork.key()); + _guestNetworkDevice = _params.get(Config.OvmGuestNetwork.key()); + return true; + } + protected OvmDiscoverer() { - } @Override @@ -115,6 +127,15 @@ public class OvmDiscoverer extends DiscovererBase implements Discoverer { details.put("cluster", Long.toString(clusterId)); details.put("agentusername", agentUsername); details.put("agentpassword", agentPassword); + if (_publicNetworkDevice != null) { + details.put("public.network.device", _publicNetworkDevice); + } + if (_privateNetworkDevice != null) { + details.put("private.network.device", _privateNetworkDevice); + } + if (_guestNetworkDevice != null) { + details.put("guest.network.device", _guestNetworkDevice); + } Map params = new HashMap(); params.putAll(details); diff --git a/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java b/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java index ce030230216..95120aa09a4 100755 --- a/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java +++ b/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java @@ -208,15 +208,15 @@ public class OvmResourceBase implements ServerResource, HypervisorResource { } if (_privateNetworkName != null && !bridges.contains(_privateNetworkName)) { - throw new ConfigurationException("Cannot find bridge " + _privateNetworkName + " on hsot " + _ip + ", all bridges are:" + bridges); + throw new ConfigurationException("Cannot find bridge " + _privateNetworkName + " on host " + _ip + ", all bridges are:" + bridges); } if (_publicNetworkName != null && !bridges.contains(_publicNetworkName)) { - throw new ConfigurationException("Cannot find bridge " + _publicNetworkName + " on hsot " + _ip + ", all bridges are:" + bridges); + throw new ConfigurationException("Cannot find bridge " + _publicNetworkName + " on host " + _ip + ", all bridges are:" + bridges); } if (_guestNetworkName != null && !bridges.contains(_guestNetworkName)) { - throw new ConfigurationException("Cannot find bridge " + _guestNetworkName + " on hsot " + _ip + ", all bridges are:" + bridges); + throw new ConfigurationException("Cannot find bridge " + _guestNetworkName + " on host " + _ip + ", all bridges are:" + bridges); } /* set to false so each time ModifyStoragePoolCommand will re-setup heartbeat*/ diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index fb268556a8e..8198525e609 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -206,6 +206,11 @@ public enum Config { ElasticLoadBalancerVmNumVcpu("Advanced", ManagementServer.class, Integer.class, "network.loadbalancer.basiczone.elb.vm.vcpu.num", "1", "Number of VCPU for the elastic load balancer vm", null), ElasticLoadBalancerVmGcInterval("Advanced", ManagementServer.class, Integer.class, "network.loadbalancer.basiczone.elb.gc.interval.minutes", "30", "Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5", null), + // Ovm + OvmPublicNetwork("Advanced", ManagementServer.class, String.class, "ovm.public.network.device", null, "Specify the public bridge on host for public network", null), + OvmPrivateNetwork("Advanced", ManagementServer.class, String.class, "ovm.private.network.device", null, "Specify the private bridge on host for private network", null), + OvmGuestNetwork("Advanced", ManagementServer.class, String.class, "ovm.guest.network.device", null, "Specify the private bridge on host for private network", null), + // XenServer VmAllocationAlgorithm("Advanced", ManagementServer.class, String.class, "vm.allocation.algorithm", "random", "If 'random', hosts within a pod will be randomly considered for VM/volume allocation. If 'firstfit', they will be considered on a first-fit basis.", null), XenPublicNetwork("Network", ManagementServer.class, String.class, "xen.public.network.device", null, "[ONLY IF THE PUBLIC NETWORK IS ON A DEDICATED NIC]:The network name label of the physical device dedicated to the public network on a XenServer host", null),