Skip to content

Commit 2dd2cb0

Browse files
authored
CA-413328 Enable auto-mode when XAPI failed for a extend period that 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.
2 parents 670f0ec + 0c5d121 commit 2dd2cb0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ocaml/xapi/xapi_periodic_scheduler_init.ml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,14 @@ let register ~__context =
9191
let remaining = Int64.sub expiry_time current_time in
9292
Xapi_host.schedule_disable_ssh_job ~__context ~self ~timeout:remaining
9393
~auto_mode:true
94-
(* handle the case where XAPI is not active when the SSH timeout expires *)
95-
else if Fe_systemctl.is_active ~service:!Xapi_globs.ssh_service then
96-
Xapi_host.disable_ssh ~__context ~self
94+
(* Handle the case where XAPI is not active when the SSH timeout expires.
95+
This typically occurs when XAPI has been down for an extended period that
96+
exceeds the timeout duration. In this scenario, we need to enable SSH auto
97+
mode to ensure the SSH service remains continuously available. *)
98+
else if Fe_systemctl.is_active ~service:!Xapi_globs.ssh_service then (
99+
Xapi_host.disable_ssh ~__context ~self ;
100+
Xapi_host.set_ssh_auto_mode ~__context ~self ~value:true
101+
)
97102
in
98103
let update_all_subjects_delay = 10.0 in
99104
(* initial delay = 10 seconds *)

0 commit comments

Comments
 (0)