Currently controller-dhcp-enabled cn only be set through yang and defaults
to false. To change one must wait for bundles to come up and change
through restconf. This adds option to specif a different default at bring
up.
To set the default for controller-dhcp-enabled:
1. Change the value in dhcpservice/.../netvirt-dhcpservice.xml
2. Copy the file into the unzipped distribution before starting karaf:
cd netvirt/vpnservice
mkdir -p ./distribution/karaf/target/assembly/etc/opendaylight/datastore/initial/config
cp dhcpservice/impl/src/main/resources/netvirt-dhcpservice.xml ./distribution/karaf/target/assembly/etc/opendaylight/datastore/initial/config
Change-Id: I6768e117515a4ff2c52e70961efb3aeac65c8d5f
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
(cherry picked from commit
d115bc161fe0d562c23ae5d041778590616ca88d)
if (config.isControllerDhcpEnabled()) {
dhcpInterfaceEventListener = new DhcpInterfaceEventListener(this, broker, dhcpExternalTunnelManager);
dhcpInterfaceConfigListener = new DhcpInterfaceConfigListener(broker, dhcpExternalTunnelManager);
+ logger.info("DHCP Service initialized");
}
}
if (dhcpInterfaceConfigListener != null) {
dhcpInterfaceConfigListener.close();
}
+ logger.info("DHCP Service closed");
}
public int setLeaseDuration(int leaseDuration) {
--- /dev/null
+<dhcpservice-config xmlns="urn:opendaylight:params:xml:ns:yang:dhcpservice:config">
+ <controller-dhcp-enabled>false</controller-dhcp-enabled>
+</dhcpservice-config>
\ No newline at end of file
interface="org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService" />
<odl:clustered-app-config id="dhcpServiceConfig"
- binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dhcpservice.config.rev150710.DhcpserviceConfig">
+ binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dhcpservice.config.rev150710.DhcpserviceConfig" default-config-file-name="netvirt-dhcpservice.xml">
</odl:clustered-app-config>
<bean id="dhcpManager" class="org.opendaylight.netvirt.dhcpservice.DhcpManager"