Skip to content

CP-54010: Use xapi for ssh in xsconsole#53

Merged
BengangY merged 1 commit intoxapi-project:feature/configure-sshfrom
BengangY:private/bengangy/CP-54010
Mar 27, 2025
Merged

CP-54010: Use xapi for ssh in xsconsole#53
BengangY merged 1 commit intoxapi-project:feature/configure-sshfrom
BengangY:private/bengangy/CP-54010

Conversation

@BengangY
Copy link
Copy Markdown
Contributor

Currently, xsconsole uses systemd to manage ssh service. In the ssh configuration feature (CP-50702), ssh's status is saved in xapi DB and is updated by xapi API.
So change the way of managing ssh to xapi API in xsconsole to keep the ssh's status updating.

Comment thread XSConsoleData.py
self.session.xenapi.host.disable(self.host.opaqueref())

def EnableSSH(self):
self.session.xenapi.host.enable_ssh(self.host.opaqueref())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is xapi enable_ssh actually start the service?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it will start and enable sshd service.

@BengangY BengangY marked this pull request as ready for review March 21, 2025 02:46
Comment thread XSConsoleData.py
self.RequireSession()
self.session.xenapi.host.disable(self.host.opaqueref())

def EnableSSH(self):
Copy link
Copy Markdown

@gangj gangj Mar 25, 2025

Choose a reason for hiding this comment

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

It might be clearer to rename it like: EnableSSHOnLocalHost.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All the functions in this file are for the local host. And as I understand, xsconsole is used for the local host's configuration. So I think OnlocalHost is a bit redundant.

Comment thread XSConsoleData.py
Currently, xsconsole uses systemd to manage ssh service.
In the ssh configuration feature (CP-50702), ssh's status is saved in xapi DB
and is updated by xapi API.
So change the way of managing ssh to xapi API in xsconsole to keep the ssh's
status updating.

Signed-off-by: Bengang Yuan <bengang.yuan@cloud.com>
@BengangY BengangY force-pushed the private/bengangy/CP-54010 branch from f5762b8 to c6a19f8 Compare March 26, 2025 14:13
@BengangY BengangY merged commit 3abf5fa into xapi-project:feature/configure-ssh Mar 27, 2025
1 check passed
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.

5 participants