@@ -955,17 +955,6 @@ let rec create_or_get_host_on_master __context rpc session_id (host_ref, host) :
955
955
Client.Host. get_console_idle_timeout ~rpc ~session_id
956
956
~self: remote_coordinator
957
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
958
(* As ssh_expiry will be updated by host.enable_ssh and host.disable_ssh,
970
959
there is a corner case when the joiner's SSH state will not match SSH
971
960
service state in its new coordinator exactly: if the joiner joins when
@@ -1588,6 +1577,7 @@ let join_common ~__context ~master_address ~master_username ~master_password
1588
1577
)
1589
1578
in
1590
1579
1580
+ let remote_coordinator = get_master ~rpc ~session_id in
1591
1581
(* If management is on a VLAN, then get the Pool master
1592
1582
management network bridge before we logout the session *)
1593
1583
let pool_master_bridge, mgmt_pif =
@@ -1598,7 +1588,7 @@ let join_common ~__context ~master_address ~master_username ~master_password
1598
1588
if Db.PIF. get_VLAN_master_of ~__context ~self: my_pif <> Ref. null then
1599
1589
let pif =
1600
1590
Client.Host. get_management_interface ~rpc ~session_id
1601
- ~host: (get_master ~rpc ~session_id )
1591
+ ~host: remote_coordinator
1602
1592
in
1603
1593
let network = Client.PIF. get_network ~rpc ~session_id ~self: pif in
1604
1594
(Some (Client.Network. get_bridge ~rpc ~session_id ~self: network), my_pif)
@@ -1688,6 +1678,38 @@ let join_common ~__context ~master_address ~master_username ~master_password
1688
1678
" Unable to set the write the new pool certificates to the disk : %s"
1689
1679
(ExnHelper. string_of_exn e)
1690
1680
) ;
1681
+ ( try
1682
+ let ssh_enabled_timeout =
1683
+ Client.Host. get_ssh_enabled_timeout ~rpc ~session_id
1684
+ ~self: remote_coordinator
1685
+ in
1686
+ let console_idle_timeout =
1687
+ Client.Host. get_console_idle_timeout ~rpc ~session_id
1688
+ ~self: remote_coordinator
1689
+ in
1690
+ (* Configure SSH service on local host to apply the settings which
1691
+ will persisit after it joins the new pool.
1692
+ Please note that ssh_enabled_timeout needs be set before
1693
+ update_non_vm_metadata(), inside which ssh_expiry is queried to
1694
+ set to host obj in remote coordinator DB.
1695
+ *)
1696
+ Xapi_host. set_console_idle_timeout ~__context ~self: me
1697
+ ~value: console_idle_timeout ;
1698
+ Xapi_host. set_ssh_enabled_timeout ~__context ~self: me
1699
+ ~value: ssh_enabled_timeout ;
1700
+ let ssh_enabled =
1701
+ Client.Host. get_ssh_enabled ~rpc ~session_id
1702
+ ~self: remote_coordinator
1703
+ in
1704
+ match ssh_enabled with
1705
+ | true ->
1706
+ Xapi_host. enable_ssh ~__context ~self: me
1707
+ | false ->
1708
+ Xapi_host. disable_ssh ~__context ~self: me
1709
+ with e ->
1710
+ error " Unable to configure SSH service on local host: %s"
1711
+ (ExnHelper. string_of_exn e)
1712
+ ) ;
1691
1713
(* this is where we try and sync up as much state as we can
1692
1714
with the master. This is "best effort" rather than
1693
1715
critical; if we fail part way through this then we carry
0 commit comments