You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This behavior works as expected in a running system.
However, on boot-up the entry in KDUMP|config won't be propagated to the USE_KDUMP kernel flag.
Problematic scenario:
config_db.json has 'enabled': 'false'
/etc/default/kdump-tools has USE_KDUMP=1
Reboot
Steps to Reproduce:
config_db.json has 'enabled': 'false'
root@nfc406-7:~# config kdump disable
KDUMP configuration changes may require a reboot to take effect.
Save SONiC configuration using 'config save' before issuing the reboot command.
root@nfc406-7:~# sonic-db-cli CONFIG_DB hgetall "KDUMP|config"
{'enabled': 'false', 'memory': '0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M', 'num_dumps': '3'}
root@nfc406-7:~# config save -y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json
root@nfc406-7:~# grep "USE_KDUMP" /etc/default/kdump-tools
# USE_KDUMP - controls kdump will be configured
USE_KDUMP=0
root@nfc406-7:~# show kdump config
Kdump administrative mode: Disabled
Kdump operational mode: Not Ready
Kdump memory reservation: 0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M
Maximum number of Kdump files: 3
Set USE_KDUMP=1 (set but don't save)
root@nfc406-7:~# config kdump enable
KDUMP configuration changes may require a reboot to take effect.
Save SONiC configuration using 'config save' before issuing the reboot command.
root@nfc406-7:~# grep "USE_KDUMP" /etc/default/kdump-tools
# USE_KDUMP - controls kdump will be configured
USE_KDUMP=1
root@nfc406-7:~# show kdump config
Kdump administrative mode: Enabled
Kdump operational mode: Ready after reboot
Kdump memory reservation: 0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M
Maximum number of Kdump files: 3
Reboot
root@nfc406-7:~# reboot
Result: KDUMP|config says it's disabled but the USE_KDUMP=1 kernel flag says it's enabled
root@nfc406-7:~# sonic-db-cli CONFIG_DB hgetall "KDUMP|config"
{'enabled': 'false', 'memory': '0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M', 'num_dumps': '3'}
root@nfc406-7:~# grep "USE_KDUMP" /etc/default/kdump-tools
# USE_KDUMP - controls kdump will be configured
USE_KDUMP=1
root@nfc406-7:~# show kdump config
Kdump administrative mode: Disabled
Kdump operational mode: Ready
Kdump memory reservation: 0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M
Maximum number of Kdump files: 3
Fallout: The startup config (config_db.json) requested the KDUMP feature be disabled but it's still enabled and rebooting the switch won't help, you'll need to re-run the config kdump disable on a running switch to re-sync the config_db and kernel flags
Note: The same thing can occur with the opposite config (CONFIG_DB: enabled=True, USE_KDUMP=0)
Analysis:
Looking at the load functions of the classes in hostcfgd it looks like it's typically used to call the handler function for the initial CONFIG_DB processing.
I'm not sure why in the case of KdumpCfg we only setup the KDUMP|config in CONFIG_DB if it's not already present:
def load(self, kdump_table):
"""
Set the KDUMP table in CFG DB to kdump_defaults if not set by the user
"""
syslog.syslog(syslog.LOG_INFO, "KdumpCfg init ...")
kdump_conf = kdump_table.get("config", {})
for row in self.kdump_defaults:
value = self.kdump_defaults.get(row)
if not kdump_conf.get(row):
self.config_db.mod_entry("KDUMP", "config", {row : value})
the
config kdump [enable|disable]
command will set theKDUMP|config
in CONFIG_DB.Changes to this config are handled by
KdumpCfg
inhostcfgd
:https://github.com/sonic-net/sonic-host-services/blob/202405/scripts/hostcfgd#L1943
Changing the
enabled
flag inKDUMP|config
will result in thesonic-kdump-config [--enable|--disable]
script to be called:https://github.com/sonic-net/sonic-host-services/blob/202405/scripts/hostcfgd#L1152-L1155
That script will in turn set the
USE_KDUMP=[0|1]
in/etc/default/kdump-tools
depending on whether or not it's enabled:https://github.com/sonic-net/sonic-utilities/blob/202405/scripts/sonic-kdump-config#L320
Changing this config requires a system reboot.
This behavior works as expected in a running system.
However, on boot-up the entry in
KDUMP|config
won't be propagated to theUSE_KDUMP
kernel flag.Problematic scenario:
'enabled': 'false'
USE_KDUMP=1
Steps to Reproduce:
'enabled': 'false'
USE_KDUMP=1
(set but don't save)Result:
KDUMP|config
says it's disabled but theUSE_KDUMP=1
kernel flag says it's enabledFallout: The startup config (config_db.json) requested the KDUMP feature be disabled but it's still enabled and rebooting the switch won't help, you'll need to re-run the
config kdump disable
on a running switch to re-sync the config_db and kernel flagsNote: The same thing can occur with the opposite config (CONFIG_DB: enabled=True, USE_KDUMP=0)
Analysis:
Looking at the
load
functions of the classes inhostcfgd
it looks like it's typically used to call the handler function for the initial CONFIG_DB processing.I'm not sure why in the case of
KdumpCfg
we only setup theKDUMP|config
in CONFIG_DB if it's not already present:https://github.com/sonic-net/sonic-host-services/blob/202405/scripts/hostcfgd#L1130-L1139
The text was updated successfully, but these errors were encountered: