This is an automated email from the ASF dual-hosted git repository. pearl11594 pushed a commit to branch patch-vpc-with-non-implemented-nws in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 4a125fee708b08773654758968062f9fcb709ad1 Author: Pearl Dsilva <pearl1...@gmail.com> AuthorDate: Tue Sep 12 13:08:26 2023 -0400 VR live patching: Allow live patch of VPC VRs even if networks are in allocated / shutdown state --- .../cloudstack/engine/orchestration/NetworkOrchestrator.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index 4ff295be78a..4750acebe2a 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -28,6 +28,7 @@ import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.UUID; import java.util.concurrent.Executors; @@ -3516,7 +3517,12 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra setRestartRequired(network, restartRequired); return status; } else if (livePatch) { - List<DomainRouterVO> domainRouters = routerDao.listByNetworkAndRole(network.getId(), VirtualRouter.Role.VIRTUAL_ROUTER, VirtualRouter.Role.INTERNAL_LB_VM); + List<DomainRouterVO> domainRouters; + if (Objects.nonNull(network.getVpcId())) { + domainRouters = routerDao.listByVpcId(network.getVpcId()); + } else { + domainRouters = routerDao.listByNetworkAndRole(network.getId(), VirtualRouter.Role.VIRTUAL_ROUTER, VirtualRouter.Role.INTERNAL_LB_VM); + } for (DomainRouterVO router: domainRouters) { try { VMInstanceVO instanceVO = _vmDao.findById(router.getId());