Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network_Setup for Kdump Remote Mode. #19464

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

Ghulam-Bahoo
Copy link

@Ghulam-Bahoo Ghulam-Bahoo commented Jul 3, 2024

Why I did it

When the kdump remote feature is enabled by the user, a kernel crash results in an attempt to send the crash report file to an SSH server. However, the network interfaces are down, leading to a "Network Unreachable" error. To resolve this issue, I have added custom scripts to ensure the network interfaces are up and configured correctly during the kdump process.

How I did it

Added network_setup.sh and network_setup.hook file

How to verify it

After this change, the remote SSH kdump file transfer would be possible because a network not reachable issue arose as the default crash kernel image did not change the state of the interfaces to "UP" upon load.

@ridahanif96
Copy link
Contributor

@venkatmahalingam pls review this code PR. Thanks

Copy link

@muhammadalihussnain muhammadalihussnain left a comment

Choose a reason for hiding this comment

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

@venkatmahalingam Please review the code PR

@muhammadalihussnain
Copy link

@venkatmahalingam Hi, We have updated code as per your suggestion. Please help review updated HLD and linked code PRs. Target is 202411. Thanks in advance

ip link set eth0 up

# Use DHCP to obtain IP address and default gateway
dhclient eth0
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if the DHCP server is not present in the network?

Choose a reason for hiding this comment

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

@venkatmahalingam
In the kdump-remote feature, network availability is crucial. If there's no DHCP server on the network, we'll provide a static IP address to the port instead. This way, when the DHCP server isn't available, we can rely on a static configuration as a fallback.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure why we need this change itself, SSH would work only if the network reachability is there for the remote destination.

Copy link

@muhammadalihussnain muhammadalihussnain Nov 14, 2024

Choose a reason for hiding this comment

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

You’re correct. But normally the kdump remote feature can be enabled simply by modifying the kdump-tools file. However, in the SONiC community version, when we enable the kdump remote mode, after kernel crash when it tries to send the crash report over ssh server it encounters an error of network unreachability. So we also need to bring up the network interfaces alongside ssh remote configurations. All these adjustments have been made specifically to bring up the "eth0" interface.

@ridahanif96
Copy link
Contributor

@venkatmahalingam , please help review changes, target is 202411, thanks in advance!

sudo mkdir -p /etc/initramfs-tools/scripts/init-premount
sudo mkdir -p /etc/initramfs-tools/hooks

# Copy the network setup scriptgit
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure why we need this change, as long as SSH works to the remote destination, it should be enough, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

What will be impact for DUMP remote mode feature if we dont have this pull request?

Copy link

@muhammadalihussnain muhammadalihussnain Nov 14, 2024

Choose a reason for hiding this comment

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

normally the kdump remote feature can be enabled simply by modifying the kdump-tools file. However, in the SONiC community version, when we enable the kdump remote mode, after kernel crash when it tries to send the crash report over ssh server it encounters an error of network unreachability. So we also need to bring up the network interfaces alongside ssh remote configurations. All these adjustments have been made specifically to bring up the "eth0" interface.

@wajahatrazi
Copy link

Hi @qiluo-msft, Please review to merge this PR.

@wajahatrazi
Copy link

Hi @qiluo-msft / @lguohan

PR has been reviewed by the reviewer with all checks passed, please help merge this.

@ridahanif96
Copy link
Contributor

@qiluo-msft help merge this PR, pending for long

Copy link

@wajahatrazi wajahatrazi left a comment

Choose a reason for hiding this comment

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

LGTM

@muhammadalihussnain
Copy link

/azpw ms_conflict

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants