Skip to content

Commit 7b16c58

Browse files
committed
CP-53802: Restore SSH service to default state in pool eject
Signed-off-by: Gang Ji <[email protected]>
1 parent 49f8128 commit 7b16c58

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ocaml/xapi/xapi_pool.ml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,19 @@ let eject_self ~__context ~host =
20452045
control_domains_to_destroy
20462046
with _ -> ()
20472047
) ;
2048+
( try
2049+
(* Restore console idle timeout *)
2050+
Xapi_host.set_console_idle_timeout ~__context ~self:host
2051+
~value:0L ;
2052+
(* Restore SSH service to default state *)
2053+
Xapi_host.set_ssh_enabled_timeout ~__context ~self:host
2054+
~value:0L ;
2055+
Xapi_host.enable_ssh ~__context ~self:host
2056+
with e ->
2057+
warn "Caught %s while restoring ssh service. Ignoring"
2058+
(Printexc.to_string e)
2059+
) ;
2060+
20482061
debug "Pool.eject: setting our role to be master" ;
20492062
Xapi_pool_transition.set_role Pool_role.Master ;
20502063
debug "Pool.eject: forgetting pool secret" ;

0 commit comments

Comments
 (0)