mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch '4.5'
Conflicts: server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java tools/appliance/build.sh
This commit is contained in:
commit
ef9830d6a4
@ -69,5 +69,5 @@ public interface VirtualNetworkApplianceService {
|
|||||||
|
|
||||||
List<Long> upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd);
|
List<Long> upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd);
|
||||||
|
|
||||||
public static final String MinVRVersion = "4.3.0";
|
public static final String MinVRVersion = "4.5.0";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2579,15 +2579,22 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
|
|||||||
final VirtualMachine.Event event = transition.getEvent();
|
final VirtualMachine.Event event = transition.getEvent();
|
||||||
if (event == VirtualMachine.Event.FollowAgentPowerOnReport && newState == State.Running) {
|
if (event == VirtualMachine.Event.FollowAgentPowerOnReport && newState == State.Running) {
|
||||||
if (vo.getType() == VirtualMachine.Type.DomainRouter) {
|
if (vo.getType() == VirtualMachine.Type.DomainRouter) {
|
||||||
|
// opaque -> <hostId, powerHostId>
|
||||||
if (opaque != null && opaque instanceof Pair<?, ?>) {
|
if (opaque != null && opaque instanceof Pair<?, ?>) {
|
||||||
Pair<?, ?> pair = (Pair<?, ?>)opaque;
|
Pair<?, ?> pair = (Pair<?, ?>)opaque;
|
||||||
Object first = pair.first();
|
Object first = pair.first();
|
||||||
Object second = pair.second();
|
Object second = pair.second();
|
||||||
if (first != null && second != null && first instanceof Long && second instanceof Long) {
|
// powerHostId cannot be null in case of out-of-band VM movement
|
||||||
Long hostId = (Long)first;
|
if (second != null && second instanceof Long) {
|
||||||
Long powerHostId = (Long)second;
|
Long powerHostId = (Long)second;
|
||||||
// If VM host known to CS is different from 'PowerOn' report host, then it is out-of-band movement
|
Long hostId = null;
|
||||||
if (hostId.longValue() != powerHostId.longValue()) {
|
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");
|
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);
|
_executor.schedule(new RebootTask(vo.getId()), 1000, TimeUnit.MICROSECONDS);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user