Skip to content

Conversation

@LunfanZhang
Copy link
Collaborator

No description provided.

LunfanZhang and others added 14 commits May 12, 2025 06:34
Add new host object fields:
  - ssh_auto_mode
Add new host/pool API to enable to set auto mode
  - set_ssh_auto_mode

Signed-off-by: Lunfan Zhang <[email protected]>
Implemented XAPI APIs for SSH auto mode configuration:
  - `host.set_ssh_auto_mode`: Configures SSH auto mode for a specific host.
  - `pool.set_ssh_auto_mode`: Configures SSH auto mode for all hosts in the pool.

Additionally:
  - `host.enable_ssh` now automatically sets SSH auto mode to `false`.

Signed-off-by: Lunfan Zhang <[email protected]>
Updated `records.ml` file to support `host-param-set/get/list` and `pool-param-set/get/list` for ssh-auto-mode.

Signed-off-by: Lunfan Zhang <[email protected]>
This PR introduces support for Dom0 SSH control, providing the
capability to configure the auto mode for a specific host or all hosts
in the pool.

New Host Object Fields and Host/Pool API:
- `ssh_auto_mode`: Indicates whether SSH auto mode is enabled. configure
to true means startup SSH when the XAPI service is down; stop SSH when
the XAPI service is up. configure to false means SSH service status is
independent and not effected by the XAPI service status.
- `set_ssh_auto_mode`: Allows setting auto mode for specific host or all
hosts in the pool.

(Note: Default value for XS8/XS9, pool join/eject operations, and XAPI
startup scenarios will be addressed in the next PR, this PR only include
the change of data_mode/API/cli )
- For XS8, a configuration file (/etc/xapi.conf.d/ssh-auto-mode.conf) will be loaded, and auto_mode will be set to false.
- For XS9, no configuration file exists, so the default value will be set to true.

Signed-off-by: Lunfan Zhang[Lunfan.Zhang] <[email protected]>
- Copy auto mode setting from pool coordinator in pool join
- Restore auto mode setting to default when pool eject

Signed-off-by: Lunfan Zhang[Lunfan.Zhang] <[email protected]>
…lt Values (#6484)

This PR aim to add following change for auto-mode:
Copy the auto-mode setting from the pool coordinator during a pool join.
and restore the auto-mode setting to default value when a pool eject
occurs.

- In XS8, the auto-mode is set to false by loading the config file
`/etc/xapi.conf.d/ssh-auto-mode.conf`.
- In XS9, default value is set to true.
- Move `set_ssh_expiry` outside of the `schedule_disable_ssh_job` to
avoid restart XAPI reset host.ssh_expiry
- Ensure the SSH service is enabled during auto-mode

Signed-off-by: Lunfan Zhang[Lunfan.Zhang] <[email protected]>
- Move the `set_ssh_expiry` outside of the `schedule_disable_ssh_job` to
avoid restart XAPI reset host.ssh_expiry
- Ensure the SSH service is always enabled during auto-mode
…exceeds the timeout duration

Signed-off-by: Lunfan Zhang[Lunfan.Zhang] <[email protected]>
…exceeds the timeout duration (#6574)

When XAPI fails for an extended period that exceeds the timeout
duration, it loses the original auto-mode setting that was configured
before the timeout. After XAPI restarts, the auto-mode should be reset
to true for security purposes.
For the following scenarios, console timeout may not reflect the real status
of the database:
 - XenServer upgrade to a new version
 - User accidentally deletes the configuration file

Add checks to ensure database and real status are matched.

Signed-off-by: Lunfan Zhang[Lunfan.Zhang] <[email protected]>
@BengangY
Copy link
Contributor

There are 2 conflicts. Should we resolve them?

Copy link
Contributor

@BengangY BengangY left a comment

Choose a reason for hiding this comment

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

Please resolve the conflicts first.

@LunfanZhang
Copy link
Collaborator Author

Close this PR as schema hash is conflicted

@psafont
Copy link
Member

psafont commented Jul 21, 2025

The design docs need to be included before merging the feature to master as well:
https://github.com/xapi-project/xen-api/blob/master/CONTRIBUTING.md#feature-work

If submitting a design first is not possible, include documentation alongside with your PR describing the work, like it was done in the last three commits here:

@LunfanZhang
Copy link
Collaborator Author

Design docs added at: #6608

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.

3 participants