Fix mtu configuration for dns and nfs

The MTU value was set to the default value instead of the configured
value for the interface.
This commit sets the MTU value to the configured for the interface.

The mtu value is also used to calculate the read/write size for nfs
mounts. The commit also ensures that it is set to the correct value.

Closes-Bug: 1811404
Change-Id: Ieb3c6d989726075af205823dc1d570c00a24c28d
Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
This commit is contained in:
Teresa Ho 2019-01-31 11:51:44 -05:00
parent 35e13285de
commit fda0dcd604
2 changed files with 18 additions and 14 deletions

View File

@ -214,7 +214,9 @@ class NetworkingPuppet(base.BasePuppet):
networktype = networktype.replace('-', '_') networktype = networktype.replace('-', '_')
config.update({ config.update({
'platform::network::%s::params::interface_name' % networktype: 'platform::network::%s::params::interface_name' % networktype:
interface_name interface_name,
'platform::network::%s::params::mtu' % networktype:
network_interface.imtu
}) })
interface_address = interface.get_interface_primary_address( interface_address = interface.get_interface_primary_address(

View File

@ -48,7 +48,6 @@ class PlatformPuppet(base.BasePuppet):
config.update(self._get_sm_config()) config.update(self._get_sm_config())
config.update(self._get_firewall_config()) config.update(self._get_firewall_config())
config.update(self._get_drbd_sync_config()) config.update(self._get_drbd_sync_config())
config.update(self._get_nfs_config())
config.update(self._get_remotelogging_config()) config.update(self._get_remotelogging_config())
config.update(self._get_snmp_config()) config.update(self._get_snmp_config())
return config return config
@ -61,6 +60,7 @@ class PlatformPuppet(base.BasePuppet):
def get_host_config(self, host): def get_host_config(self, host):
config = {} config = {}
config.update(self._get_hosts_config(host)) config.update(self._get_hosts_config(host))
config.update(self._get_nfs_config(host))
config.update(self._get_host_platform_config(host, self.config_uuid)) config.update(self._get_host_platform_config(host, self.config_uuid))
config.update(self._get_host_ntp_config(host)) config.update(self._get_host_ntp_config(host))
config.update(self._get_host_ptp_config(host)) config.update(self._get_host_ptp_config(host))
@ -782,24 +782,26 @@ class PlatformPuppet(base.BasePuppet):
return config return config
def _get_nfs_config(self): def _get_nfs_config(self, host):
# Calculate the optimal NFS r/w size based on the network mtu based # Calculate the optimal NFS r/w size based on the network mtu based
# on the configured network(s) # on the configured network(s)
mtu = constants.DEFAULT_MTU mtu = constants.DEFAULT_MTU
try: try:
interfaces = self.dbapi.iinterface_get_by_network( infra_network = self.dbapi.network_get_by_type(
constants.NETWORK_TYPE_INFRA) constants.NETWORK_TYPE_INFRA)
for interface in interfaces: network_id = infra_network.id
mtu = interface.imtu except exception.NetworkTypeNotFound:
except exception.InvalidParameterValue: mgmt_network = self.dbapi.network_get_by_type(
try: constants.NETWORK_TYPE_MGMT)
interfaces = self.dbapi.iinterface_get_by_network( network_id = mgmt_network.id
constants.NETWORK_TYPE_MGMT) interfaces = self.dbapi.iinterface_get_by_ihost(host.uuid)
for interface in interfaces: for interface in interfaces:
mtu = interface.imtu if interface['ifclass'] == constants.INTERFACE_CLASS_PLATFORM:
except exception.InvalidParameterValue: for net_id in interface['networks']:
pass if int(net_id) == network_id:
mtu = interface.imtu
break
if self._get_address_by_name( if self._get_address_by_name(
constants.CONTROLLER_PLATFORM_NFS, constants.CONTROLLER_PLATFORM_NFS,