Mp/flxcld 2802#12
Merged
Merged
Conversation
cp1362
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes
ManagementServerNodethe single, canonical source of the management-server node id (msid) and adds an opt-in mode to derive that id from the node FQDN instead of the host MAC address.By default the
msidis still derived from the host hardware MAC address, so existing behaviour is unchanged. When the MAC address is not stable across restarts, however, it produces a newmsid, which orphans themshostrow and breaks async jobs, HA work (fk_op_ha_work__mgmt_server_id), and router/stats ownership.Setting the environment variable
CLOUDSTACK_MSID_FROM_FQDN=true(or the system propertycloudstack.msid.from.fqdn=true) instead derives themsidfrom a SHA-256 hash of the node's canonical FQDN, which stays stable across restarts, so the node keeps ownership of itsmshostrow, jobs, and HA work. If the FQDN cannot be resolved, the code falls back to the MAC-based id. Accepted truthy values aretrue,1, andyes(case-insensitive); the generated id is masked to a positive, non-zero 48-bit value.Because the id must be consistent everywhere, all direct callers of
MacAddress.getMacAddress().toLong()used for node identity are refactored to obtain it fromManagementServerNode.getManagementServerId():com.cloud.hypervisor.CloudZonesStartupProcessorcom.cloud.network.NetworkUsageManagerImpl(DirectNetworkStatsListener)com.cloud.network.router.VirtualNetworkApplianceManagerImplcom.cloud.server.ManagementServerImpl#getId()com.cloud.server.StatsCollectorTypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
N/A
How Has This Been Tested?
msidis still derived from the host MAC address, so existing deployments are unaffected.CLOUDSTACK_MSID_FROM_FQDN=true): verified the generatedmsidis stable across management-server restarts, that themshostrow is reused, and that async jobs and HA work remain associated with the node.CloudZonesStartupProcessor,NetworkUsageManagerImpl,VirtualNetworkApplianceManagerImpl,ManagementServerImpl,StatsCollector) resolve the same node id.How did you try to break this feature and the system with this change?
true,1,yes, mixed case) and confirmed each enables FQDN mode, while other values leave the default MAC behaviour intact.