File tree Expand file tree Collapse file tree
framework/cluster/src/main/java/com/cloud/cluster Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1048,8 +1048,9 @@ public ManagementServerHostVO doInTransaction(final TransactionStatus status) {
10481048
10491049 ManagementServerHostVO mshost = _mshostDao .findByMsid (_msId );
10501050
1051- // Look for duplicate hostname in the case of kubernetes setup where ip/mac changes but hostname is constant.
1052- if (mshost == null && StringUtils .isNotBlank (currentHostname )) {
1051+ // Look for duplicate hostname in Kubernetes setups where IP/MAC changes but hostname is constant.
1052+ // Skip the default "localhost" hostname fallback to avoid removing other active nodes when hostname resolution fails.
1053+ if (mshost == null && StringUtils .isNotBlank (currentHostname ) && !StringUtils .equalsIgnoreCase (currentHostname , "localhost" )) {
10531054 List <ManagementServerHostVO > activeEntries = _mshostDao .findAllByName (currentHostname );
10541055 for (ManagementServerHostVO activeEntry : activeEntries ) {
10551056 // Found an active entry with this hostname but different MSID
You can’t perform that action at this time.
0 commit comments