bug 12653: add default gateway support for multiple networks under VMware

This commit is contained in:
Kelven Yang 2011-12-19 14:48:47 -08:00
parent 2a2d424bcc
commit 55175fb2fd
2 changed files with 18 additions and 5 deletions

View File

@ -933,11 +933,24 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
s_logger.info("Executing resource DhcpEntryCommand: " + _gson.toJson(cmd));
}
// ssh -p 3922 -o StrictHostKeyChecking=no -i $cert root@$domr "/root/edithosts.sh $mac $ip $vm $dfltrt $ns $staticrt" >/dev/null
String args = " " + cmd.getVmMac();
args += " " + cmd.getVmIpAddress();
args += " " + cmd.getVmName();
if (s_logger.isDebugEnabled()) {
args += " " + cmd.getVmName();
if (cmd.getDefaultRouter() != null) {
args += " " + cmd.getDefaultRouter();
}
if (cmd.getDefaultDns() != null) {
args += " " + cmd.getDefaultDns();
}
if (cmd.getStaticRoutes() != null) {
args += " " + cmd.getStaticRoutes();
}
if (s_logger.isDebugEnabled()) {
s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/edithosts.sh " + args);
}

View File

@ -469,8 +469,8 @@ public class HostMO extends BaseMO implements VmwareHypervisorHost {
for(ObjectContent oc : ocs) {
String vmName = oc.getPropSet()[0].getVal().toString();
if(s_logger.isDebugEnabled())
s_logger.debug("put " + vmName + " into host cache");
if(s_logger.isTraceEnabled())
s_logger.trace("put " + vmName + " into host cache");
_vmCache.put(vmName, new VirtualMachineMO(_context, oc.getObj()));
}