Refactor ssh key handling logic to improve performance/efficiency
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Nova Cloud Controller Charm |
Fix Released
|
Wishlist
|
Alex Kavanagh | ||
OpenStack Nova Compute Charm |
Fix Released
|
Wishlist
|
Alex Kavanagh |
Bug Description
The current SSH key distribution code in nova-cloud-
Note that this bug will not track work associated with resolving inter- nova-cloud-
Patches will use the gerrit topic: improve-
Patches will use "Related-Bug" and NOT "Closes-Bug" so as to be tracked here. The bug will be closed when agreement has been reached as to whether any more performance can be extracted using the current approach (using relations to move keys around).
The main approach taken in rationalising the way SSH keys are managed is to:
1. Ensure that operations on SSH keys are only performed ONCE in any hook execution.
2. Cache expensive operations during a hook execution that aren't going to change.
3. Cache expensive operations between hook executions (nslookup, for example) that aren't going to change during a hook execution.
4. Use goal-state to hold off setting known_hosts and authorized_keys to reduce the number of cloud-compute relation change hooks.
5. Add an action to purge the hosts cached if DNS changes to update the known_hosts to each of the compute units.
Changed in charm-nova-cloud-controller: | |
assignee: | nobody → Alex Kavanagh (ajkavanagh) |
description: | updated |
Changed in charm-nova-cloud-controller: | |
status: | Fix Committed → Fix Released |
Changed in charm-nova-compute: | |
status: | Fix Committed → Fix Released |
https:/ /review. opendev. org/#/c/ 666374/ -- in nova-compute charm
Refactor import_ authorized_ keys() function for performance
The main change is to fetch all of the relation_data() at once, and then
iterate through the python dictionary. This speeds up processing of
potentially hundreds of hosts and authorized_keys.
Change-Id: I095104f535c1ea e1554f842502ae9 3ebb92e44fe
Related-Bug: #1833420