From 90fc5acda44ed8f23d1da4b0ca76aa619f89ed5d Mon Sep 17 00:00:00 2001 From: davidjumani Date: Fri, 16 Apr 2021 12:36:38 +0530 Subject: [PATCH 1/8] ui: Show diskoffering for create volume from ROOT volume snaps (#4912) Fixes the issue of not being able to select the diskofferingid while creating volumes from snapshots of ROOT volumes --- ui/src/config/section/storage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/src/config/section/storage.js b/ui/src/config/section/storage.js index c907079864b..976cab9acde 100644 --- a/ui/src/config/section/storage.js +++ b/ui/src/config/section/storage.js @@ -284,7 +284,13 @@ export default { label: 'label.action.create.volume', dataView: true, show: (record) => { return record.state === 'BackedUp' }, - args: ['snapshotid', 'name'], + args: (record, store) => { + var fields = ['snapshotid', 'name'] + if (record.volumetype === 'ROOT') { + fields.push('diskofferingid') + } + return fields + }, mapping: { snapshotid: { value: (record) => { return record.id } From 0bbf114c79faf450457df9bce73ed3b0342589d6 Mon Sep 17 00:00:00 2001 From: slavkap <51903378+slavkap@users.noreply.github.com> Date: Fri, 16 Apr 2021 10:07:24 +0300 Subject: [PATCH 2/8] ui: Support to update disk/network offering tags from UI (#4923) added support to update tags of disk and network offerings from UI fix deletion of the last tag --- ui/src/config/section/offering.js | 4 ++-- ui/src/views/AutogenView.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/config/section/offering.js b/ui/src/config/section/offering.js index 1ec2d40d181..64678de2daf 100644 --- a/ui/src/config/section/offering.js +++ b/ui/src/config/section/offering.js @@ -150,7 +150,7 @@ export default { label: 'label.edit', docHelp: 'adminguide/service_offerings.html#modifying-or-deleting-a-service-offering', dataView: true, - args: ['name', 'displaytext'] + args: ['name', 'displaytext', 'tags'] }, { api: 'updateDiskOffering', icon: 'lock', @@ -216,7 +216,7 @@ export default { label: 'label.edit', docHelp: 'adminguide/service_offerings.html#modifying-or-deleting-a-service-offering', dataView: true, - args: ['name', 'displaytext', 'availability'], + args: ['name', 'displaytext', 'availability', 'tags'], mapping: { availability: { options: ['Optional', 'Required'] diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 7e14f9e609f..795a5d85c70 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -983,13 +983,13 @@ export default { continue } if (!input === undefined || input === null || - (input === '' && !['updateStoragePool', 'updateHost', 'updatePhysicalNetwork'].includes(action.api))) { + (input === '' && !['updateStoragePool', 'updateHost', 'updatePhysicalNetwork', 'updateDiskOffering', 'updateNetworkOffering'].includes(action.api))) { if (param.type === 'boolean') { params[key] = false } break } - if (!input) { + if (!input && !['tags'].includes(key)) { continue } if (action.mapping && key in action.mapping && action.mapping[key].options) { From 7da7c48a410731e313692713ec7a452d530f7fba Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Tue, 20 Apr 2021 16:46:59 +0530 Subject: [PATCH 3/8] debian: remove duplicate agent jar copy (#4927) * debian: remove duplicate agent jar copy The cloud-agent is dependency of the KVM hypervisor plugin, don't explicitly install/copy it again. Fixes #4906 Signed-off-by: Rohit Yadav * Update rules --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index de45255d9bd..a19089a1816 100755 --- a/debian/rules +++ b/debian/rules @@ -38,7 +38,7 @@ override_dh_auto_install: mkdir $(DESTDIR)/$(SYSCONFDIR)/profile.d mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent/plugins - install -D agent/target/cloud-agent-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/$(PACKAGE)-agent.jar + mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/ install -D plugins/hypervisors/kvm/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/ From 8edd709cad502c6abb36cac44ae28d7687446e3f Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Tue, 20 Apr 2021 18:47:30 +0700 Subject: [PATCH 4/8] ui: disabled root disk size customization if Service Offering has a fixed size (#4933) --- ui/src/views/compute/DeployVM.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue index 8c0b81c5967..c0965bfd593 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -106,7 +106,11 @@ @update-template-iso="updateFieldValue" /> {{ $t('label.override.rootdisk.size') }} - +
{{ this.$t('message.deployasis') }}
0) { deployVmData.rootdisksize = values.rootdisksize + } else if (this.rootDiskSizeFixed > 0) { + deployVmData.rootdisksize = this.rootDiskSizeFixed } if (values.hypervisor && values.hypervisor.length > 0) { deployVmData.hypervisor = values.hypervisor @@ -1958,6 +1965,10 @@ export default { this.updateFieldValue('memory', this.selectedTemplateConfiguration.memory) } } + if (offering && offering.rootdisksize > 0) { + this.rootDiskSizeFixed = offering.rootdisksize / (1024 * 1024 * 1024.0).toFixed(2) + this.showRootDiskSizeChanger = false + } } } } From 5051fde952b038536cedf6cc05e31796cff0c842 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 21 Apr 2021 12:48:11 +0530 Subject: [PATCH 5/8] server: Stat collector solidfire capacity fix (#4918) Fixes regression introduced in 71c5dbcf492a023dbea5f8c34f8fd883c3ad653f which would cause capacity bytes of certain pools to be update which shouldn't get updated by StatsCollector such as solidfire. Fixes #4911 Signed-off-by: Rohit Yadav --- .../java/com/cloud/server/StatsCollector.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/com/cloud/server/StatsCollector.java b/server/src/main/java/com/cloud/server/StatsCollector.java index 86db544a196..50f1063ad48 100644 --- a/server/src/main/java/com/cloud/server/StatsCollector.java +++ b/server/src/main/java/com/cloud/server/StatsCollector.java @@ -1020,14 +1020,22 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc if (answer != null && answer.getResult()) { storagePoolStats.put(pool.getId(), (StorageStats)answer); + boolean poolNeedsUpdating = false; // Seems like we have dynamically updated the pool size since the prev. size and the current do not match - if (pool.getCapacityBytes() != ((StorageStats)answer).getCapacityBytes() || - pool.getUsedBytes() != ((StorageStats)answer).getByteUsed()) { - pool.setCapacityBytes(((StorageStats)answer).getCapacityBytes()); - if (pool.getStorageProviderName().equalsIgnoreCase(DataStoreProvider.DEFAULT_PRIMARY)) { - pool.setUsedBytes(((StorageStats) answer).getByteUsed()); - pool.setUpdateTime(new Date()); + if (_storagePoolStats.get(poolId) != null && _storagePoolStats.get(poolId).getCapacityBytes() != ((StorageStats)answer).getCapacityBytes()) { + if (((StorageStats)answer).getCapacityBytes() > 0) { + pool.setCapacityBytes(((StorageStats)answer).getCapacityBytes()); + poolNeedsUpdating = true; + } else { + s_logger.warn("Not setting capacity bytes, received " + ((StorageStats)answer).getCapacityBytes() + " capacity for pool ID " + poolId); } + } + if (pool.getUsedBytes() != ((StorageStats)answer).getByteUsed() && pool.getStorageProviderName().equalsIgnoreCase(DataStoreProvider.DEFAULT_PRIMARY)) { + pool.setUsedBytes(((StorageStats) answer).getByteUsed()); + poolNeedsUpdating = true; + } + if (poolNeedsUpdating) { + pool.setUpdateTime(new Date()); _storagePoolDao.update(pool.getId(), pool); } } From 585164a540fcf48f870f26bfacdf22bbae2f928e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Beims=20Br=C3=A4scher?= Date: Wed, 21 Apr 2021 04:25:14 -0300 Subject: [PATCH 6/8] server: Add UnavailableCommandException at ExceptionErrorCodeMap (#4926) This PR proposes adding Exception UnavailableCommandException at the ExceptionErrorCodeMap --- .../java/com/cloud/utils/exception/CSExceptionErrorCode.java | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/src/main/java/com/cloud/utils/exception/CSExceptionErrorCode.java b/utils/src/main/java/com/cloud/utils/exception/CSExceptionErrorCode.java index 34fe46ddbdf..64978d2bc24 100644 --- a/utils/src/main/java/com/cloud/utils/exception/CSExceptionErrorCode.java +++ b/utils/src/main/java/com/cloud/utils/exception/CSExceptionErrorCode.java @@ -70,6 +70,7 @@ public class CSExceptionErrorCode { ExceptionErrorCodeMap.put("com.cloud.async.AsyncCommandQueued", 4540); ExceptionErrorCodeMap.put("com.cloud.exception.RequestLimitException", 4545); ExceptionErrorCodeMap.put("com.cloud.exception.StorageConflictException", 4550); + ExceptionErrorCodeMap.put("com.cloud.exception.UnavailableCommandException", 4555); // Have a special error code for ServerApiException when it is // thrown in a standalone manner when failing to detect any of the above From 40a2ca4e0a38f44f06c383afb30dbb2e162b3a4a Mon Sep 17 00:00:00 2001 From: davidjumani Date: Wed, 21 Apr 2021 12:59:54 +0530 Subject: [PATCH 7/8] cloudian: Set cloudian.connector.enabled as not dynamic (#4938) This PR sets cloudian.connector.enabled as not dynamic since cloudian requires the cloudianSsoLogin API which is added only once the MS is restarted --- .../java/org/apache/cloudstack/cloudian/CloudianConnector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/integrations/cloudian/src/main/java/org/apache/cloudstack/cloudian/CloudianConnector.java b/plugins/integrations/cloudian/src/main/java/org/apache/cloudstack/cloudian/CloudianConnector.java index c04d70c2601..30c8b1c1853 100644 --- a/plugins/integrations/cloudian/src/main/java/org/apache/cloudstack/cloudian/CloudianConnector.java +++ b/plugins/integrations/cloudian/src/main/java/org/apache/cloudstack/cloudian/CloudianConnector.java @@ -24,7 +24,7 @@ import com.cloud.utils.component.PluggableService; public interface CloudianConnector extends PluggableService { ConfigKey CloudianConnectorEnabled = new ConfigKey<>("Advanced", Boolean.class, "cloudian.connector.enabled", "false", - "If set to true, this enables the Cloudian Connector for CloudStack.", true); + "If set to true, this enables the Cloudian Connector for CloudStack.", false); ConfigKey CloudianAdminHost = new ConfigKey<>("Advanced", String.class, "cloudian.admin.host", "s3-admin.cloudian.com", "The hostname of the Cloudian Admin server.", true); From a5e53dc5c7f9a6e2c7119ac8ccf4de7d50293de3 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 21 Apr 2021 13:01:29 +0530 Subject: [PATCH 8/8] ui: fix autogen form exec with action mapping options (#4909) For an auto-generated form, with list mapping of action, mapped API parameter was not getting added to the request when first index from the list is selected. Change added to fix this. Signed-off-by: Abhishek Kumar Co-authored-by: Rohit Yadav --- ui/src/views/AutogenView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 795a5d85c70..dd92d72468b 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -989,7 +989,7 @@ export default { } break } - if (!input && !['tags'].includes(key)) { + if (!input && input !== 0 && !['tags'].includes(key)) { continue } if (action.mapping && key in action.mapping && action.mapping[key].options) {