Merge branch '4.5'

Conflicts:
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	tools/appliance/build.sh
This commit is contained in:
Koushik Das 2014-12-09 14:59:36 +05:30
commit ef9830d6a4
2 changed files with 12 additions and 5 deletions

View File

@ -69,5 +69,5 @@ public interface VirtualNetworkApplianceService {
List<Long> upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd);
public static final String MinVRVersion = "4.3.0";
public static final String MinVRVersion = "4.5.0";
}

View File

@ -2579,15 +2579,22 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
final VirtualMachine.Event event = transition.getEvent();
if (event == VirtualMachine.Event.FollowAgentPowerOnReport && newState == State.Running) {
if (vo.getType() == VirtualMachine.Type.DomainRouter) {
// opaque -> <hostId, powerHostId>
if (opaque != null && opaque instanceof Pair<?, ?>) {
Pair<?, ?> pair = (Pair<?, ?>)opaque;
Object first = pair.first();
Object second = pair.second();
if (first != null && second != null && first instanceof Long && second instanceof Long) {
Long hostId = (Long)first;
// powerHostId cannot be null in case of out-of-band VM movement
if (second != null && second instanceof Long) {
Long powerHostId = (Long)second;
// If VM host known to CS is different from 'PowerOn' report host, then it is out-of-band movement
if (hostId.longValue() != powerHostId.longValue()) {
Long hostId = null;
if (first != null && first instanceof Long) {
hostId = (Long)first;
}
// The following scenarios are due to out-of-band VM movement
// 1. If VM is in stopped state in CS due to 'PowerMissing' report from old host (hostId is null) and then there is a 'PowerOn' report from new host
// 2. If VM is in running state in CS and there is a 'PowerOn' report from new host
if (hostId == null || (hostId.longValue() != powerHostId.longValue())) {
s_logger.info("Schedule a router reboot task as router " + vo.getId() + " is powered-on out-of-band, need to reboot to refresh network rules");
_executor.schedule(new RebootTask(vo.getId()), 1000, TimeUnit.MICROSECONDS);
}