[
https://issues.apache.org/jira/browse/CLOUDSTACK-8832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14956844#comment-14956844
]
ASF GitHub Bot commented on CLOUDSTACK-8832:
--------------------------------------------
Github user nlivens commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/801#discussion_r41988188
--- Diff:
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
---
@@ -285,60 +525,345 @@ public boolean
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
return responseList;
}
- @Override
- public boolean configure(String name, Map<String, Object> params)
throws ConfigurationException {
- try {
- initNuageScheduledTasks();
- } catch (Exception ce) {
- s_logger.warn("Failed to load NuageVsp configuration
properties. Check if the NuageVsp properties are configured correctly");
+ private void registerNewNuageVspDevice(ConfigurationVO currentConfig,
String registeredNuageVspDevice) {
+ if (currentConfig == null) {
+ ConfigKey<String> configKey = new
ConfigKey<String>("Advanced", String.class, "nuagevsp.cms.id",
registeredNuageVspDevice,
+ "<ACS Nuage VSP Device ID>:<Allocated VSD CMS ID> - Do
not edit", false);
+ ConfigurationVO configuration = new
ConfigurationVO("management-server", configKey);
+ _configDao.persist(configuration);
+ } else {
+ String newValue;
+ String currentValue = currentConfig.getValue();
+ if (!Strings.isNullOrEmpty(currentValue)) {
+ newValue = currentValue + ";" + registeredNuageVspDevice;
+ } else {
+ newValue = registeredNuageVspDevice;
+ }
+ _configDao.update("nuagevsp.cms.id", newValue);
}
- return true;
}
- private void initNuageScheduledTasks() {
- Integer numOfSyncThreads =
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
- Integer syncUpIntervalInMinutes =
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
- if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
- ThreadFactory threadFactory = new ThreadFactory() {
- public Thread newThread(Runnable runnable) {
- Thread thread = new Thread(runnable, "Nuage Vsp sync
task");
- if (thread.isDaemon())
- thread.setDaemon(false);
- if (thread.getPriority() != Thread.NORM_PRIORITY)
- thread.setPriority(Thread.NORM_PRIORITY);
- return thread;
+ private void auditHost(HostVO host) {
+ _hostDao.loadDetails(host);
+
+ boolean validateDomains = true;
+ List<NuageVspDeviceVO> nuageVspDevices =
_nuageVspDao.listByHost(host.getId());
+ if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+ for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ ConfigurationVO cmsIdConfig =
_configDao.findByName("nuagevsp.cms.id");
+ String nuageVspCmsId =
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+ SyncNuageVspCmsIdCommand syncCmd = new
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+ SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer)
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+ if (answer != null && !answer.getSuccess()) {
+ s_logger.fatal("Nuage VSP Device with ID " +
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
--- End diff --
Changed log level to <code>ERROR</code>. No reason for it to be
<code>FATAL</code>
> Update Nuage VSP plugin to work with Nuage VSP release 3.2
> ----------------------------------------------------------
>
> Key: CLOUDSTACK-8832
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8832
> Project: CloudStack
> Issue Type: Improvement
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Management Server
> Affects Versions: 4.6.0
> Reporter: Nick Livens
> Assignee: Nick Livens
> Attachments: nuageVspMarvinLogs.tar.gz
>
>
> Nuage VSP 3.2 is being released, we want to bring the plugin up to date for
> this release
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)