Fix VR inheriting boot settings from user's VM (#8894)

Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
This commit is contained in:
Henrique Sato 2024-04-16 11:54:16 -03:00 committed by GitHub
parent a55ba96a08
commit 075b413041
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -219,7 +219,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor, RedundantResource, DnsServ
return false;
}
final Map<VirtualMachineProfile.Param, Object> params = new HashMap<VirtualMachineProfile.Param, Object>(1);
final Map<VirtualMachineProfile.Param, Object> params = new HashMap<>(1);
params.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
if (network.isRollingRestart()) {
@ -264,27 +264,13 @@ NetworkMigrationResponder, AggregatedCommandExecutor, RedundantResource, DnsServ
return false;
}
final NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
if (offering.isSystemOnly()) {
return false;
}
if (!_networkMdl.isProviderEnabledInPhysicalNetwork(_networkMdl.getPhysicalNetworkId(network), getProvider().getName())) {
return false;
}
final RouterDeploymentDefinition routerDeploymentDefinition =
routerDeploymentDefinitionBuilder.create()
.setGuestNetwork(network)
.setDeployDestination(dest)
.setAccountOwner(_accountMgr.getAccount(network.getAccountId()))
.setParams(vm.getParameters())
.build();
final NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
implement(network, offering, dest, context);
final List<DomainRouterVO> routers = routerDeploymentDefinition.deployVirtualRouter();
if (routers == null || routers.size() == 0) {
throw new ResourceUnavailableException("Can't find at least one running router!", DataCenter.class, network.getDataCenterId());
}
return true;
}