CP-53711: Apply SSH settings in joiner before update_non_vm_metadata#6408
Conversation
ocaml/xapi/xapi_pool.ml
Outdated
| ) ; | ||
| Db.Host.set_latest_synced_updates_applied ~__context ~self:me | ||
| ~value:`unknown ; | ||
| let ssh_enabled_timeout = |
There was a problem hiding this comment.
This PR moved ssh operations from create_or_get_host_on_master to join_common. I'm not familiar with the logic. Could you describe the difference in detail?
There was a problem hiding this comment.
We are working for the pool join scenario, so join_common is where we should change. create_or_get_host_on_master is also called in join_common, while as it's name suggests, it is to create or get a host on the remote master, while the code we add here is related to the joiner, so we move the code out.
a106fae to
abd6703
Compare
| in | ||
| match ssh_enabled with | ||
| | true -> | ||
| Xapi_host.enable_ssh ~__context ~self:me |
There was a problem hiding this comment.
Is this not highlighting that we have two API functions where one taking an argument would have been more convenient? I am not asking for a change but the API leads to verbose clients.
ocaml/xapi/xapi_pool.ml
Outdated
| will persisit after it joins the new pool. | ||
| Please note that ssh_enabled_timeout needs be set before | ||
| update_non_vm_metadata(), inside which ssh_expiry is queried to | ||
| set to host obj in remote coordinator DB. |
There was a problem hiding this comment.
So now that we are inheriting the remote coordinator's ssh settings here, and write them to the local DB, we don't need to copy them from the remote again in L946–957?
There was a problem hiding this comment.
Ah, I see, we can query from local in L946–957!
abd6703 to
d349779
Compare
ocaml/xapi/xapi_pool.ml
Outdated
| let ssh_enabled = | ||
| Client.Host.get_ssh_enabled ~rpc ~session_id ~self:remote_coordinator | ||
| in | ||
| let ssh_enabled = Db.Host.get_ssh_enabled ~__context ~self:host_ref in |
There was a problem hiding this comment.
You can just use host.API.host_ssh_enabled etc below, as you already have the host record here.
Signed-off-by: Gang Ji <gang.ji@cloud.com>
d349779 to
5a533f5
Compare
b70078f
into
xapi-project:feature/configure-ssh-phase2
This is a follow up for #6395 (comment)