Updated marvin tests and removed redundant translations

This commit is contained in:
Harikrishna Patnala 2021-04-30 16:25:05 +05:30
parent 1e84d8cf37
commit cb693af78a
16 changed files with 20 additions and 27 deletions

View File

@ -445,8 +445,8 @@ public class CreateServiceOfferingCmd extends BaseCmd {
return storagePolicy;
}
public Boolean getDynamicScalingEnabled() {
return isDynamicScalingEnabled == null ? Boolean.TRUE : isDynamicScalingEnabled;
public boolean getDynamicScalingEnabled() {
return isDynamicScalingEnabled == null ? true : isDynamicScalingEnabled;
}
/////////////////////////////////////////////////////

View File

@ -205,7 +205,7 @@ public class ServiceOfferingResponse extends BaseResponse {
private Long rootDiskSize;
@SerializedName(ApiConstants.DYNAMIC_SCALING_ENABLED)
@Param(description = "true if virtual machine needs to be dynamically scalable of cpu or memory")
@Param(description = "true if virtual machine needs to be dynamically scalable of cpu or memory", since = "4.16")
private Boolean dynamicScalingEnabled;
public ServiceOfferingResponse() {

View File

@ -110,7 +110,7 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA,
boolean limitResourceUse, boolean volatileVm, String displayText, ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse,
VirtualMachine.Type vmType, String hostTag, String deploymentPlanner, Boolean dynamicScalingEnabled) {
VirtualMachine.Type vmType, String hostTag, String deploymentPlanner, boolean dynamicScalingEnabled) {
super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);
this.cpu = cpu;
this.ramSize = ramSize;

View File

@ -2492,7 +2492,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
Long bytesWriteRate, Long bytesWriteRateMax, Long bytesWriteRateMaxLength,
Long iopsReadRate, Long iopsReadRateMax, Long iopsReadRateMaxLength,
Long iopsWriteRate, Long iopsWriteRateMax, Long iopsWriteRateMaxLength,
final Integer hypervisorSnapshotReserve, String cacheMode, final Long storagePolicyID, final Boolean dynamicScalingEnabled) {
final Integer hypervisorSnapshotReserve, String cacheMode, final Long storagePolicyID, final boolean dynamicScalingEnabled) {
// Filter child domains when both parent and child domains are present
List<Long> filteredDomainIds = filterChildSubDomains(domainIds);

View File

@ -7101,13 +7101,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
vm.setGuestOSId(template.getGuestOSId());
vm.setTemplateId(newTemplateId);
}
// check if VM can be dynamically scalable with the new template
ServiceOfferingVO serviceOffering = _offeringDao.findById(vm.getServiceOfferingId());
VMTemplateVO newTemplate = _templateDao.findById(newTemplateId);
boolean dynamicScalingEnabled = checkIfDynamicScalingCanBeEnabled(vm, serviceOffering, newTemplate, vm.getDataCenterId());
vm.setDynamicallyScalable(dynamicScalingEnabled);
_vmDao.update(vmId, vm);
// check and update VM if it can be dynamically scalable with the new template
updateVMDynamicallyScalabilityUsingTemplate(vm, newTemplateId);
} else {
newVol = volumeMgr.allocateDuplicateVolume(root, null);
}
@ -7195,6 +7190,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
}
private void updateVMDynamicallyScalabilityUsingTemplate(UserVmVO vm, Long newTemplateId) {
ServiceOfferingVO serviceOffering = _offeringDao.findById(vm.getServiceOfferingId());
VMTemplateVO newTemplate = _templateDao.findById(newTemplateId);
boolean dynamicScalingEnabled = checkIfDynamicScalingCanBeEnabled(vm, serviceOffering, newTemplate, vm.getDataCenterId());
vm.setDynamicallyScalable(dynamicScalingEnabled);
_vmDao.update(vm.getId(), vm);
}
/**
* Perform basic checkings to make sure restore is possible. If not, #InvalidParameterValueException is thrown.
*

View File

@ -160,6 +160,11 @@ class TestScaleVm(cloudstackTestCase):
@classmethod
def tearDownClass(cls):
Configurations.update(
cls.apiclient,
name="enable.dynamic.scale.vm",
value="false"
)
super(TestScaleVm,cls).tearDownClass()
return
@ -173,11 +178,6 @@ class TestScaleVm(cloudstackTestCase):
%s" % self.hypervisor)
def tearDown(self):
Configurations.update(
self.apiclient,
name="enable.dynamic.scale.vm",
value="false"
)
# Clean up, terminate the created ISOs
super(TestScaleVm,self).tearDown()
return

View File

@ -659,7 +659,6 @@
"label.drag.new.position": "\u0627\u0633\u062d\u0628 \u0644\u0645\u0648\u0642\u0641 \u062c\u062f\u064a\u062f",
"label.driver": "Driver",
"label.duration.in.sec": "Duration (in sec)",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.edit": "Edit",
"label.edit.acl.list": "Edit ACL List",
"label.edit.acl.rule": "Edit ACL rule",

View File

@ -659,7 +659,6 @@
"label.drag.new.position": "Arrosegar a la nova posici\u00f3",
"label.driver": "Driver",
"label.duration.in.sec": "Duration (in sec)",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.edit": "Edit",
"label.edit.acl.list": "Edit ACL List",
"label.edit.acl.rule": "Edit ACL rule",

View File

@ -659,7 +659,6 @@
"label.drag.new.position": "D\u00e9placer sur une autre position",
"label.driver": "Pilote",
"label.duration.in.sec": "Dur\u00e9e (en sec)",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.edit": "Modifier",
"label.edit.acl.list": "Edit ACL List",
"label.edit.acl.rule": "Modifier r\u00e8gle ACL",

View File

@ -659,7 +659,6 @@
"label.drag.new.position": "Trascina nella nuova posizione",
"label.driver": "Driver",
"label.duration.in.sec": "Duration (in sec)",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.edit": "Modifica",
"label.edit.acl.list": "Edit ACL List",
"label.edit.acl.rule": "Edit ACL rule",

View File

@ -658,7 +658,6 @@
"label.drag.new.position": "\u65b0\u3057\u3044\u4f4d\u7f6e\u306b\u30c9\u30e9\u30c3\u30b0",
"label.driver": "Driver",
"label.duration.in.sec": "\u6301\u7d9a\u6642\u9593(\u79d2)",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.edit": "\u7de8\u96c6",
"label.edit.acl.list": "Edit ACL List",
"label.edit.acl.rule": "ACL \u898f\u5247\u306e\u7de8\u96c6",

View File

@ -658,7 +658,6 @@
"label.dpd": "D\u00f8d endepunkt-deteksjon",
"label.drag.new.position": "Dra til ny posisjon",
"label.driver": "Driver",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.duration.in.sec": "Varighet (i sek.)",
"label.edit": "Editer",
"label.edit.acl.list": "Edit ACL List",

View File

@ -658,7 +658,6 @@
"label.dpd": "Dead Peer Detection",
"label.drag.new.position": "Przenie\u015b w nowe miejsce",
"label.driver": "Driver",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.duration.in.sec": "Duration (in sec)",
"label.edit": "Edytuj",
"label.edit.acl.list": "Edit ACL List",

View File

@ -657,7 +657,6 @@
"label.dpd": "Detec\u00e7\u00e3o de correspondente morto",
"label.drag.new.position": "Arrastar para uma nova posi\u00e7\u00e3o",
"label.driver": "Driver",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.duration.in.sec": "Dura\u00e7\u00e3o (em seg)",
"label.edit": "Editar",
"label.edit.acl.list": "Edit ACL List",

View File

@ -657,7 +657,6 @@
"label.dpd": "Dead Peer Detection",
"label.drag.new.position": "\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e",
"label.driver": "Driver",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.duration.in.sec": "Duration (in sec)",
"label.edit": "\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c",
"label.edit.acl.list": "Edit ACL List",

View File

@ -657,7 +657,6 @@
"label.dpd": "\u5931\u6548\u5bf9\u7b49\u4f53\u68c0\u6d4b",
"label.drag.new.position": "\u62d6\u52a8\u5230\u65b0\u4f4d\u7f6e",
"label.driver": "Driver",
"label.dynamicscalingenabled": "Dynamic Scaling Enabled",
"label.duration.in.sec": "\u6301\u7eed\u65f6\u95f4 (\u79d2)",
"label.edit": "\u7f16\u8f91",
"label.edit.acl.list": "Edit ACL List",