Support for custom SSH port for KVM hosts using the configuration#12571
Support for custom SSH port for KVM hosts using the configuration#12571sureshanaparti wants to merge 2 commits intoapache:4.20from
Conversation
…m.host.discovery.ssh.port' - Use the custom SSH port for KVM host discovery to connect to the Host during Add Host command - and any other operations on host using SSH
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12571 +/- ##
=========================================
Coverage 16.26% 16.26%
Complexity 13428 13428
=========================================
Files 5660 5660
Lines 499959 499964 +5
Branches 60707 60708 +1
=========================================
+ Hits 81326 81331 +5
+ Misses 409560 409559 -1
- Partials 9073 9074 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16684 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
| "This timeout overrides the wait global config. This holds a comma separated key value pairs containing timeout (in seconds) for specific commands. " + | ||
| "For example: DhcpEntryCommand=600, SavePasswordCommand=300, VmDataCommand=300", false); | ||
|
|
||
| ConfigKey<Integer> KVMHostDiscoverySshPort = new ConfigKey<>(ConfigKey.CATEGORY_ADVANCED, Integer.class, |
There was a problem hiding this comment.
Wouldn't it be better to have this as a parameter on host addition/edit to allow configuring it on a host-level?
There was a problem hiding this comment.
I think we can, but do we really want to allow to use a different ssh port for all hosts within a cluster? seems a bit overkill.
There was a problem hiding this comment.
I don't see a problem allowing it. Maybe a single host needs to use a different port for SSH connection.
There was a problem hiding this comment.
ok, a bit of an edge case, only applicable to smaller installations I’d guess (in my ignorance). You are not asking to remove a higher level setting are you? just to add a per host parameter..
There was a problem hiding this comment.
the config is applicable for the kvm hosts on the entire cloudstack installation, mainly for large deployments where the custom port is used for all the hosts. it doesn't provide flexibility to set few hosts on one port, and few hosts on the other. it's always better to have all these hosts accessible on the same port. a new host parameter (that can be updated through add or update host call) can provide flexibility, but it's mostly NULL/empty (when not defined or default port is used) and is not applicable for VMware hosts.
There was a problem hiding this comment.
@DaanHoogland @weizhouapache I prefer the host-level configuration too
There was a problem hiding this comment.
Hi guys, sorry but I don't see what the issue is defining this setting at cluster level, I think trying to scope the setting/detail to host level may not be necessary. Currently the host discovery port is hardcoded to be port 22 globally. This PR will give operators flexibility to set a custom port (in case its needed) for hosts to be added on a cluster (if we scope it to cluster). What do you think? @winterhazel @weizhouapache @sureshanaparti @DaanHoogland
There was a problem hiding this comment.
just an example, how to solve this ?
- host A: port 2222
- host B: port 2223
actually in the AddHost, the name of the parameter is url (the host URL)
it indicates that port should be supported, no API parameter changes needed (+ no UI, no global config changes)
what we can do
- parse the host and port from the URL (java.net.URI can be used)
- connect to host using the port (use default port 22 if not found)
There was a problem hiding this comment.
@weizhouapache I like the idea, however instead of parsing the URL can we simply add a new parameter/UI and keep the setting as a fallback to not rely on the hardcoded value?
There was a problem hiding this comment.
@nvazquez
I think it is fine to hardcode the default SSH port as 22, which is allocated by IANA
if user want to use a custom port, pass it as part of host url (host:port), it is more flexible
|
[SF] Trillian test result (tid-15362)
|
Description
This PR support custom SSH port for KVM hosts using the configuration 'kvm.host.discovery.ssh.port', during
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?