-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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.20 from
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
sureshanaparti
commented
Feb 3, 2026
@blueorangutan package
blueorangutan
commented
Feb 3, 2026
@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:
|
blueorangutan
commented
Feb 3, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16684
sureshanaparti
commented
Feb 3, 2026
@blueorangutan test
blueorangutan
commented
Feb 3, 2026
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guys, we have a customer asking ffor a per cluster configuration, So I propose the following;
if not part of the host field (i.e. localhost:22) check the host detail, else check the cluster setting, else 22.
makes sense everybody?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @DaanHoogland - setting being global as it is now should also work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaanHoogland I suggest having either just host configuration stored on URL field -> cluster setting -> 22, or host configuration stored on host_detail -> cluster setting -> 22, depending on whichever is easier to implement without breaking compatibility.
Storing this configuration at two places for host-level seems unnecessary, and might just make it confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, simplifying to:
if not part of the host field (i.e. localhost:22), check the cluster setting, else 22.
blueorangutan
commented
Feb 4, 2026
|
[SF] Trillian test result (tid-15362)
|
engine/components-api/src/main/java/com/cloud/agent/AgentManager.java
Outdated
Show resolved
Hide resolved
@DaanHoogland
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
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?