From 03ad702c1be3466b982099ec8764a045411cf3bf Mon Sep 17 00:00:00 2001 From: davidjumani Date: Tue, 30 Mar 2021 14:05:46 +0530 Subject: [PATCH 01/12] server: Set free memory to zero if greater than total memory (#4571) Fixes https://github.com/apache/cloudstack/issues/4566 Sets `memoryintfreekbs` to zero if it is greater than `memorykbs`. Caused by KVM returning the RSS memory of the process running the VM rather than the free memory inside the VM. Co-authored-by: dahn --- .../org/apache/cloudstack/api/response/UserVmResponse.java | 2 +- .../java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java index 44eaba7f313..ea5300e7875 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java @@ -209,7 +209,7 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co private Long memoryKBs; @SerializedName("memoryintfreekbs") - @Param(description = "the internal memory thats free in vm") + @Param(description = "the internal memory that's free in vm or zero if it can not be calculated") private Long memoryIntFreeKBs; @SerializedName("memorytargetkbs") diff --git a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java index 8e489f89eca..1589f0151fe 100644 --- a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java @@ -222,8 +222,11 @@ public class UserVmJoinDaoImpl extends GenericDaoBaseWithTagInformation= totalMemory ? 0 : freeMemory; + userVmResponse.setMemoryKBs(totalMemory); + userVmResponse.setMemoryIntFreeKBs(correctedFreeMemory); userVmResponse.setMemoryTargetKBs((long)vmStats.getTargetMemoryKBs()); } From 5b986be5ba6915ed85a6430f19fccf6af3787cfc Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Tue, 30 Mar 2021 15:39:56 +0700 Subject: [PATCH 02/12] ui: fix the style of zone wizard on mobile view (#4764) This PR for fixes create zone form in mobile view --- .../infra/zone/AdvancedGuestTrafficForm.vue | 3 +- .../views/infra/zone/IpAddressRangeForm.vue | 146 ++++++++++-------- ui/src/views/infra/zone/StaticInputsForm.vue | 3 +- ui/src/views/infra/zone/ZoneWizard.vue | 37 ++++- .../infra/zone/ZoneWizardAddResources.vue | 39 ++++- .../infra/zone/ZoneWizardNetworkSetupStep.vue | 36 ++++- .../ZoneWizardPhysicalNetworkSetupStep.vue | 10 +- 7 files changed, 190 insertions(+), 84 deletions(-) diff --git a/ui/src/views/infra/zone/AdvancedGuestTrafficForm.vue b/ui/src/views/infra/zone/AdvancedGuestTrafficForm.vue index 8a96677859d..ca2cb0ae6cb 100644 --- a/ui/src/views/infra/zone/AdvancedGuestTrafficForm.vue +++ b/ui/src/views/infra/zone/AdvancedGuestTrafficForm.vue @@ -194,11 +194,10 @@ export default { min-height: 200px; text-align: center; vertical-align: center; - padding-top: 16px; - padding-top: 16px; margin-top: 8px; max-height: 300px; overflow-y: auto; + padding: 16px 20px 0; /deep/.has-error { .ant-form-explain { diff --git a/ui/src/views/infra/zone/IpAddressRangeForm.vue b/ui/src/views/infra/zone/IpAddressRangeForm.vue index f1082a37d9f..07b2ef9c956 100644 --- a/ui/src/views/infra/zone/IpAddressRangeForm.vue +++ b/ui/src/views/infra/zone/IpAddressRangeForm.vue @@ -24,79 +24,94 @@ + style="margin-bottom: 24px; width: 100%" > @@ -126,7 +141,10 @@