-
Notifications
You must be signed in to change notification settings - Fork 1.3k
KVM: Propagating changes on host parameters to the agents #3491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DaanHoogland
merged 5 commits into
apache:4.13
from
ustcweizhou:kvm-propagate-host-params
Feb 19, 2020
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
86093ec
KVM: Propagating changes on host parameters to the agents
ustcweizhou e860203
kvm: bug fix in config host param
ustcweizhou 8891da3
kvm: refactoring of propagating host params
ustcweizhou 3d97af5
test: fix build error in server/test
ustcweizhou f8ce84b
server: fix test error in IndirectAgentLBServiceImplTest.java
ustcweizhou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| // under the License. | ||
| package com.cloud.configuration; | ||
|
|
||
| import com.cloud.agent.AgentManager; | ||
| import com.cloud.alert.AlertManager; | ||
| import com.cloud.api.ApiDBUtils; | ||
| import com.cloud.api.query.dao.NetworkOfferingJoinDao; | ||
|
|
@@ -161,6 +162,8 @@ | |
| import org.apache.cloudstack.affinity.AffinityGroup; | ||
| import org.apache.cloudstack.affinity.AffinityGroupService; | ||
| import org.apache.cloudstack.affinity.dao.AffinityGroupDao; | ||
| import org.apache.cloudstack.agent.lb.IndirectAgentLB; | ||
| import org.apache.cloudstack.agent.lb.IndirectAgentLBServiceImpl; | ||
| import org.apache.cloudstack.api.ApiConstants; | ||
| import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd; | ||
| import org.apache.cloudstack.api.command.admin.network.CreateManagementNetworkIpRangeCmd; | ||
|
|
@@ -187,6 +190,7 @@ | |
| import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd; | ||
| import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd; | ||
| import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd; | ||
| import org.apache.cloudstack.config.ApiServiceConfiguration; | ||
| import org.apache.cloudstack.config.Configuration; | ||
| import org.apache.cloudstack.context.CallContext; | ||
| import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; | ||
|
|
@@ -198,6 +202,7 @@ | |
| import org.apache.cloudstack.framework.config.dao.ConfigurationDao; | ||
| import org.apache.cloudstack.framework.config.impl.ConfigurationVO; | ||
| import org.apache.cloudstack.framework.messagebus.MessageBus; | ||
| import org.apache.cloudstack.framework.messagebus.MessageSubscriber; | ||
| import org.apache.cloudstack.framework.messagebus.PublishScope; | ||
| import org.apache.cloudstack.region.PortableIp; | ||
| import org.apache.cloudstack.region.PortableIpDao; | ||
|
|
@@ -372,6 +377,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati | |
| ImageStoreDetailsDao _imageStoreDetailsDao; | ||
| @Inject | ||
| MessageBus messageBus; | ||
| @Inject | ||
| AgentManager _agentManager; | ||
| @Inject | ||
| IndirectAgentLB _indirectAgentLB; | ||
|
|
||
|
|
||
| // FIXME - why don't we have interface for DataCenterLinkLocalIpAddressDao? | ||
|
|
@@ -404,6 +413,7 @@ public boolean configure(final String name, final Map<String, Object> params) th | |
| populateConfigValuesForValidationSet(); | ||
| weightBasedParametersForValidation(); | ||
| overProvisioningFactorsForValidation(); | ||
| initMessageBusListener(); | ||
| return true; | ||
| } | ||
|
|
||
|
|
@@ -461,6 +471,24 @@ private void overProvisioningFactorsForValidation() { | |
| overprovisioningFactorsForValidation.add(CapacityManager.StorageOverprovisioningFactor.key()); | ||
| } | ||
|
|
||
| private void initMessageBusListener() { | ||
| messageBus.subscribe(EventTypes.EVENT_CONFIGURATION_VALUE_EDIT, new MessageSubscriber() { | ||
| @Override | ||
| public void onPublishMessage(String serderAddress, String subject, Object args) { | ||
| String globalSettingUpdated = (String) args; | ||
| if (Strings.isNullOrEmpty(globalSettingUpdated)) { | ||
| return; | ||
| } | ||
| if (globalSettingUpdated.equals(ApiServiceConfiguration.ManagementServerAddresses.key()) || | ||
| globalSettingUpdated.equals(IndirectAgentLBServiceImpl.IndirectAgentLBAlgorithm.key())) { | ||
| _indirectAgentLB.propagateMSListToAgents(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can unify both calls as they do basically the same |
||
| } else if (globalSettingUpdated.equals(Config.RouterAggregationCommandEachTimeout.toString())) { | ||
| _agentManager.propagateChangeToAgents(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^^ |
||
| } | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean start() { | ||
|
|
||
|
|
||
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
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
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
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.
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.
What about removing this one from here and adding
paramsas 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.
@nvazquez it is absolutely good.
I will create another PR. this PR has already been merged into 4.13 and 4.14 ...