fix migration issue

This commit is contained in:
Edison Su 2011-02-25 19:54:02 -05:00
parent 2705adb3b1
commit 9b51886850
4 changed files with 15 additions and 4 deletions

View File

@ -3189,8 +3189,14 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
return false;
}
/*FIX ME: */
InterfaceDef intf = intfs.get(intfs.size() - 1);
String brname = intf.getBrName();
String brname = null;
if (vmName.startsWith("r-")) {
InterfaceDef intf = intfs.get(0);
brname = intf.getBrName();
} else {
InterfaceDef intf = intfs.get(intfs.size() - 1);
brname = intf.getBrName();
}
Script cmd = new Script(_securityGroupPath, _timeout, s_logger);
cmd.add("default_network_rules_systemvm");

View File

@ -120,6 +120,11 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
}
}
if (config.isSecurityGroupEnabled()) {
config.setName("SecurityGroupEnabledNetwork");
config.setDisplayText("SecurityGroupEnabledNetwork");
}
return config;
}

View File

@ -789,7 +789,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
Long podId = dest.getPod().getId();
//In Basic zone and Guest network we have to start domR per pod, not per network
if (dc.getNetworkType() == NetworkType.Basic && guestNetwork.getTrafficType() == TrafficType.Guest) {
if ((dc.getNetworkType() == NetworkType.Basic || guestNetwork.isSecurityGroupEnabled()) && guestNetwork.getTrafficType() == TrafficType.Guest ) {
router = _routerDao.findByNetworkAndPod(guestNetwork.getId(), podId);
} else {
router = _routerDao.findByNetwork(guestNetwork.getId());

View File

@ -417,7 +417,7 @@ public class SecurityGroupManagerImpl implements SecurityGroupManager, SecurityG
}
protected void handleVmMigrated(VMInstanceVO vm) {
if (vm.getType() == VirtualMachine.Type.User )
if (vm.getType() == VirtualMachine.Type.User || !isVmSecurityGroupEnabled(vm.getId()))
return;
NetworkRulesSystemVmCommand nrc = new NetworkRulesSystemVmCommand(vm.getInstanceName(), vm.getType());
Commands cmds = new Commands(nrc);