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

Kdump_Remote_SSH_Support #1714

Merged
merged 7 commits into from
Nov 19, 2024
Merged

Conversation

Ghulam-Bahoo
Copy link
Contributor

@Ghulam-Bahoo Ghulam-Bahoo commented Jun 14, 2024

This HLD outlines the configuration and usage of the kdump remote feature with SSH for the SONiC network operating system. Kdump, a built-in Linux kernel feature, generates and stores a crash dump file in the event of a kernel panic. It extends beyond local storage by enabling remote dumps via SSH or NFS protocols, allowing you to transmit kernel crash data to a designated remote server. This functionality facilitates offline analysis by storing crash dump files remotely.

Repo PR title State
sonic-buildimage Network_Setup for Kdump Remote Mode GitHub issue/pull request detail
sonic-utilities kdump-Remote-SSH-Configurations GitHub issue/pull request detail
sonic-buildimage YANG Model for KDUMP Remote SSH GitHub issue/pull request detail
sonic-host-services kdump-remote feature in hostcfgd GitHub issue/pull request detail

@zhangyanzhao
Copy link
Collaborator

reviewed in community on 7/9/2024, recording can be found from https://zoom.us/rec/share/vlA3FUiC7lv0UK4edaEciUabfsFzyVRtTvB4-QmEZ33b-JOLcyuZCn8lsAOc9smz.Tqd4HaNLMQJQFHDM

@zhangyanzhao
Copy link
Collaborator

asked during the review meeting and keep a record here: current design only supports kdump to remote server over IPv4, no IPv6 support.

leaf remote {
description "SSH Remote Config";

type string {
Copy link
Collaborator

@venkatmahalingam venkatmahalingam Jul 9, 2024

Choose a reason for hiding this comment

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

Can the type be boolean to represent true/false instead of string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will do this.


- Required for kdump_remote_ssh_dump: Initialize network interfaces and enable DHCP upon kernel crash.

2. files/scripts/network_setup.sh (New Addition)
Copy link
Collaborator

@venkatmahalingam venkatmahalingam Jul 9, 2024

Choose a reason for hiding this comment

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

Can you add some details for this new change? is this only for eth0 interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this script initializes the eth0 interface and enables dhcp on it.

User be prompted to choose a location to save the key pair. By default, it saves the private key to ~/.ssh/id_rsa and the public key to ~/.ssh/id_rsa.pub.

```
admin@sonic: ssh-copy-id username@server_address
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the manual setup apart from configuring kdump CLI commands? can this be abstracted within kdump command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is a manual setup apart from kdump CLI commands. The manual setup ensures clarity and avoids the complexity and prompts that might arise from using kdump CLI commands.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you handle this as part of the Click command handler?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we can implement this through the CLI, but it would be more suitable for the user to generate the key and save it to the desired path, which can then be configured in the "kdump-tools" file

}
}

leaf ssh_connection_string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to add more than one remote IPs? e.g if one of the server is not reachable, is it possible to choose the alternate server to transfer the kdump data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No this is not possible according to my understanding. There is variable #SSH in kdump-config file in /etc/default/kdump-tools directory, it allows you to add only one remote IP at a time.

Kdump memory reservation: 512
Maximum number of Kdump files: 3
remote: true
Kdump remote server user@ip/hostname: [email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have we tested the remote server reachability via mgmt VRF?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but I will test it and keep posted.

@venkatmahalingam
Copy link
Collaborator

asked during the review meeting and keep a record here: current design only supports kdump to remote server over IPv4, no IPv6 support.

IPv6 should work without any issues, we just need to validate this.

@Ghulam-Bahoo
Copy link
Contributor Author

@venkatmahalingam We have edited the HLD please help review it and related code PR's.

@Ghulam-Bahoo
Copy link
Contributor Author

asked during the review meeting and keep a record here: current design only supports kdump to remote server over IPv4, no IPv6 support.

This feature works fine with IPv6 as tested.

@ridahanif96
Copy link
Collaborator

@venkatmahalingam Hi Venkat, Can you please help review HLD and its Linked PRs. Target is 202411

@venkatmahalingam
Copy link
Collaborator

@venkatmahalingam Hi Venkat, Can you please help review HLD and its Linked PRs. Target is 202411

Sure, will take a look next week.

type boolean;
}

leaf ssh_stirng {
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo. string

Copy link
Contributor

Choose a reason for hiding this comment

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

Updated

type string;
}

leaf ssh_path {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a description explaining the format for all fields.

Copy link
Contributor

@muhammadalihussnain muhammadalihussnain Sep 6, 2024

Choose a reason for hiding this comment

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

Descriptions Added

- CLI support for configuring remote kdump feature enable/disable via ssh.
- CLI support for configuring username and hostname of ssh server (username@server_address).
- CLI support for configuring SSH private key path for ssh server (SSH_private_Key_Path).
- CLI support for displaying crededentials of ssh server.
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo. crededentials, please do a spell-checker for this HLD.

Copy link
Contributor

Choose a reason for hiding this comment

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

Updated

@muhammadalihussnain
Copy link
Contributor

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

Copy link
Collaborator

@ridahanif96 ridahanif96 left a comment

Choose a reason for hiding this comment

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

LGTM

@ridahanif96 ridahanif96 merged commit b546506 into sonic-net:master Nov 19, 2024
1 check passed
@zhangyanzhao
Copy link
Collaborator

code PRs are not merged yet, move to backlog

@wajahatrazi
Copy link
Contributor

Hi @zhangyanzhao / @qiluo-msft

We have been requesting a merge of Code PRs for days before the release.

All code PRs pass checks and have been approved by the reviewers.

Every week, we are requesting for review and approval. Kindly help merge these PRs.

Thanks

@ridahanif96
Copy link
Collaborator

code PRs are not merged yet, move to backlog

@zhangyanzhao Code PRs are done since long and approved but still awaiting for merge. We are already pushing hard for repo owner to merge it.

@qiluo-msft kindly merged these approved code PRs.

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

Successfully merging this pull request may close these issues.

6 participants