@@ -943,6 +943,38 @@ let rec create_or_get_host_on_master __context rpc session_id (host_ref, host) :
943943 create_or_get_sr_on_master __context rpc session_id
944944 (my_local_cache_sr, my_local_cache_sr_rec)
945945 in
946+ let remote_coordinator = get_master ~rpc ~session_id in
947+ let ssh_enabled =
948+ Client.Host. get_ssh_enabled ~rpc ~session_id ~self: remote_coordinator
949+ in
950+ let ssh_enabled_timeout =
951+ Client.Host. get_ssh_enabled_timeout ~rpc ~session_id
952+ ~self: remote_coordinator
953+ in
954+ let console_idle_timeout =
955+ Client.Host. get_console_idle_timeout ~rpc ~session_id
956+ ~self: remote_coordinator
957+ in
958+ (* Configure SSH service on local host *)
959+ Xapi_host. set_console_idle_timeout ~__context ~self: host_ref
960+ ~value: console_idle_timeout ;
961+ Xapi_host. set_ssh_enabled_timeout ~__context ~self: host_ref
962+ ~value: ssh_enabled_timeout ;
963+ ( match ssh_enabled with
964+ | true ->
965+ Xapi_host. enable_ssh ~__context ~self: host_ref
966+ | false ->
967+ Xapi_host. disable_ssh ~__context ~self: host_ref
968+ ) ;
969+ (* As ssh_expiry will be updated by host.enable_ssh and host.disable_ssh,
970+ there is a corner case when the joiner's SSH state will not match SSH
971+ service state in its new coordinator exactly: if the joiner joins when
972+ SSH service has been enabled in the new coordinator, while not timed
973+ out yet, the joiner will start SSH service with timeout
974+ host.ssh_enabled_timeout, which means SSH service in the joiner will
975+ be disabled later than in the new coordinator. *)
976+ let ssh_expiry = Db.Host. get_ssh_expiry ~__context ~self: host_ref in
977+
946978 debug " Creating host object on master" ;
947979 let ref =
948980 Client.Host. create ~rpc ~session_id ~uuid: my_uuid
@@ -962,7 +994,8 @@ let rec create_or_get_host_on_master __context rpc session_id (host_ref, host) :
962994 ~local_cache_sr ~chipset_info: host.API. host_chipset_info
963995 ~ssl_legacy: false
964996 ~last_software_update: host.API. host_last_software_update
965- ~last_update_hash: host.API. host_last_update_hash
997+ ~last_update_hash: host.API. host_last_update_hash ~ssh_enabled
998+ ~ssh_enabled_timeout ~ssh_expiry ~console_idle_timeout
966999 in
9671000 (* Copy other-config into newly created host record: *)
9681001 no_exn
0 commit comments