Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
86093ece8602038891da33d97af5f8ce84bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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() { | ||
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 ...