Skip to content

Commit ed2f573

Browse files
committed
Merge release branch 4.9 to master
* 4.9: Honor network.dns.basiczone.updates setting when sending DHCP config to VRs
2 parents 6d00fc1 + 550bec8 commit ed2f573

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

server/src/com/cloud/network/router/CommandSetupHelper.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ public class CommandSetupHelper {
184184
@Qualifier("networkHelper")
185185
protected NetworkHelper _networkHelper;
186186

187-
private final String _dnsBasicZoneUpdates = "all";
188-
189187
public void createVmDataCommand(final VirtualRouter router, final UserVm vm, final NicVO nic, final String publicKey, final Commands cmds) {
190188
final String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()).getDisplayText();
191189
final String zoneName = _dcDao.findById(router.getDataCenterId()).getName();
@@ -620,18 +618,17 @@ public void createVmDataCommandForVMs(final DomainRouterVO router, final Command
620618
public void createDhcpEntryCommandsForVMs(final DomainRouterVO router, final Commands cmds, final long guestNetworkId) {
621619
final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, VirtualMachine.State.Running, VirtualMachine.State.Migrating, VirtualMachine.State.Stopping);
622620
final DataCenterVO dc = _dcDao.findById(router.getDataCenterId());
621+
String dnsBasicZoneUpdates = _configDao.getValue(Config.DnsBasicZoneUpdates.key());
623622
for (final UserVmVO vm : vms) {
624-
boolean createDhcp = true;
625623
if (dc.getNetworkType() == NetworkType.Basic && router.getPodIdToDeployIn().longValue() != vm.getPodIdToDeployIn().longValue()
626-
&& _dnsBasicZoneUpdates.equalsIgnoreCase("pod")) {
627-
createDhcp = false;
624+
&& dnsBasicZoneUpdates.equalsIgnoreCase("pod")) {
625+
continue;
628626
}
629-
if (createDhcp) {
630-
final NicVO nic = _nicDao.findByNtwkIdAndInstanceId(guestNetworkId, vm.getId());
631-
if (nic != null) {
632-
s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + ".");
633-
createDhcpEntryCommand(router, vm, nic, cmds);
634-
}
627+
628+
final NicVO nic = _nicDao.findByNtwkIdAndInstanceId(guestNetworkId, vm.getId());
629+
if (nic != null) {
630+
s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + ".");
631+
createDhcpEntryCommand(router, vm, nic, cmds);
635632
}
636633
}
637634
}

0 commit comments

Comments
 (0)