Skip to content

[kdump-config] update kdump default config with pre-defined value in /proc/cmdline (installer.conf) (cherry-pick from master to 202405)#236

Merged
judyjoseph merged 2 commits intosonic-net:202405from
mlok-nokia:update-kdump-config
May 7, 2025
Merged

[kdump-config] update kdump default config with pre-defined value in /proc/cmdline (installer.conf) (cherry-pick from master to 202405)#236
judyjoseph merged 2 commits intosonic-net:202405from
mlok-nokia:update-kdump-config

Conversation

@mlok-nokia
Copy link
Contributor

@mlok-nokia mlok-nokia commented Apr 4, 2025

Why I did it

Modify the hostcfgd to handle the kdump enabled to the CONFIG_DB when kdump is enabled by default in the platform installer.conf. Related PR in master branch is #237

How I did it

Added a new method init_kdump_config_from_cmdline() in the KdumpCfg class to check the /proc/cmdline. If key "crashkernel=" exists in /proc/cmdline when system is up, this means that the kdump is enabled. init_kdump_config_from_cmdline() will update the kdump_defaults and CONFIG_DB when if the current config data are not matched the pre-defined data in the /proc/cmdline. This happens during a new image upgrade with the crashkernel is defined the platform installer.conf.

How to verify it

  1. install an image with predefine kdump enabled in the grub.conf.
  2. execute the "config load_minigraph"
    • check it should not any error in the syslog
    • After the hostcfgd is running, execute "show kdump config" should show kdump is enabled. Output as below
admin@sonic:~$ show kdump config
Kdump administrative mode: Enabled
Kdump operational mode: Ready
Kdump memory reservation: 8G-:1G
Maximum number of Kdump files: 3
  1. save config and reboot the system
  2. show command should show the kdump is enabled and also there should not be any kdump/hostcfgd error log in syslog

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202405
  • 202503

@mssonicbld
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mlok-nokia
Copy link
Contributor Author

@judyjoseph and @arlakshm This PRs the set the Kdump config enabled and memory value which based on the pre-defined crashkernel in /proc/cmdline. Please review it. Thanks

@mlok-nokia mlok-nokia changed the title [kdump-config] update kdump default config with pre-define value in /proc/cmdline [kdump-config] update kdump default config with pre-defined value in /proc/cmdline (installer.conf) Apr 4, 2025
@arlakshm
Copy link
Contributor

arlakshm commented Apr 4, 2025

@mlok-nokia, as discussed can we create PR in master branch for this change?

@mlok-nokia
Copy link
Contributor Author

@mlok-nokia, as discussed can we create PR in master branch for this change?

I am working on that.....

@mssonicbld
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mlok-nokia
Copy link
Contributor Author

@mlok-nokia, as discussed can we create PR in master branch for this change?

The related master branch PR is #237

@mlok-nokia mlok-nokia changed the title [kdump-config] update kdump default config with pre-defined value in /proc/cmdline (installer.conf) [kdump-config] update kdump default config with pre-defined value in /proc/cmdline (installer.conf) (cherry-pick from master to 202405) Apr 10, 2025
@mlok-nokia mlok-nokia force-pushed the update-kdump-config branch from 906a7a5 to 0180251 Compare April 15, 2025 18:29
@mssonicbld
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mlok-nokia mlok-nokia force-pushed the update-kdump-config branch from 0180251 to 6b386db Compare April 15, 2025 18:37
@mssonicbld
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…efined in a platform installer.conf

Signed-off-by: mlok <marty.lok@nokia.com>
(cherry picked from commit bc75b4e5a40e40e49f4352c810b28dedd385d16b)
@mssonicbld
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mlok-nokia
Copy link
Contributor Author

@judyjoseph and @arlakshm This is the cherry-pick of PR of the kdump-config. Please review it. Thanks.

Copy link
Contributor

@judyjoseph judyjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM

@judyjoseph judyjoseph merged commit 9082af7 into sonic-net:202405 May 7, 2025
5 checks passed
@mlok-nokia
Copy link
Contributor Author

@judyjoseph This PR also needs to cherry-pick to 202503 branch

@mlok-nokia
Copy link
Contributor Author

@judyjoseph @arlakshm Please cherry-pick this PR to 202503 branch. Thanks.

@mlok-nokia
Copy link
Contributor Author

mlok-nokia commented Jun 10, 2025

@tjchadaga, @judyjoseph and @arlakshm This PR has not been cherry-picked to MSFT 202503 branch yet. Thanks

mssonicbld added a commit to mssonicbld/sonic-host-services that referenced this pull request Oct 24, 2025
…/proc/cmdline (installer.conf)

#### Why I did it
Modify the hostcfgd to handle the kdump enabled to the CONFIG_DB when kdump is enabled by default in the platform installer.conf . Related PR for 202405 is: sonic-net#236

### How I did it
Added a new method init_kdump_config_from_cmdline() in the KdumpCfg class to check the /proc/cmdline.  If key "crashkernel=" exists in /proc/cmdline when system is up,  this means that the kdump is enabled. init_kdump_config_from_cmdline() will  update the kdump_defaults  and CONFIG_DB when if the current config data are not matched the pre-defined data in the /proc/cmdline.  This happens during a new image upgrade with the crashkernel is defined the platform installer.conf.

### How to verify it
1)  install an image with predefine kdump enabled in the grub.conf.
2)  execute the "config load_minigraph"
    - check it should not any error in the syslog
    - After the hostcfgd is running, execute "show kdump config" should show kdump is enabled. Output as below
 ```
admin@sonic:~$ show kdump config
Kdump administrative mode: Enabled
Kdump operational mode: Ready
Kdump memory reservation: 8G-:1G
Maximum number of Kdump files: 3
```

3) save config and reboot the system
4) show command should show the kdump is enabled and also there should not be any kdump/hostcfgd error log in syslog

### Which release branch to backport (provide reason below if selected)
- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305
- [x] 202405
mssonicbld added a commit that referenced this pull request Oct 27, 2025
…-defined value in /proc/cmdline (installer.conf) (#315)

#### Why I did it
Modify the hostcfgd to handle the kdump enabled to the CONFIG_DB when kdump is enabled by default in the platform installer.conf . Related PR for 202405 is: #236

### How I did it
Added a new method init_kdump_config_from_cmdline() in the KdumpCfg class to check the /proc/cmdline. If key "crashkernel=" exists in /proc/cmdline when system is up, this means that the kdump is enabled. init_kdump_config_from_cmdline() will update the kdump_defaults and CONFIG_DB when if the current config data are not matched the pre-defined data in the /proc/cmdline. This happens during a new image upgrade with the crashkernel is defined the platform installer.conf.

### How to verify it
1) install an image with predefine kdump enabled in the grub.conf.
2) execute the "config load_minigraph"
 - check it should not any error in the syslog
 - After the hostcfgd is running, execute "show kdump config" should show kdump is enabled. Output as below
 ```
admin@sonic:~$ show kdump config
Kdump administrative mode: Enabled
Kdump operational mode: Ready
Kdump memory reservation: 8G-:1G
Maximum number of Kdump files: 3
```

3) save config and reboot the system
4) show command should show the kdump is enabled and also there should not be any kdump/hostcfgd error log in syslog

### Which release branch to backport (provide reason below if selected)
- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305
- [x] 202405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants