@@ -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