Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d28cb78
Dynamic Scaling option granularity
harikrishna-patnala Jan 29, 2021
536ea98
UI changes
harikrishna-patnala Feb 1, 2021
c9e6d4d
UI changes, added new labels
harikrishna-patnala Feb 1, 2021
a397324
Added response param in UI for system service offering
harikrishna-patnala Feb 1, 2021
5794c4a
Filter service offerings based on dynamic scalable flag while listing…
harikrishna-patnala Feb 3, 2021
8f25bd1
Added tool tip during VM deployment
harikrishna-patnala Feb 3, 2021
ea91309
Added dynamic scalable flag on template while updating stopped VM. Fi…
harikrishna-patnala Feb 3, 2021
e3b2f50
Naming corrections for service offering response
harikrishna-patnala Feb 3, 2021
d63ca70
Changed name from dynamically scalable to dynamic scaling enabled for…
harikrishna-patnala Feb 3, 2021
667e741
Reverted 414 to 415 schema file empty line changes
harikrishna-patnala Feb 3, 2021
0411053
Added marvin tests required for these changes
harikrishna-patnala Apr 30, 2021
a83173e
Added version number on new API parameters Used single method for mul…
harikrishna-patnala Feb 5, 2021
55ed16f
Fixed Boolean to boolean Added UI response parameter to system VMs
harikrishna-patnala Feb 8, 2021
14d15aa
Formatting Changes
harikrishna-patnala Feb 8, 2021
dcaa72c
Set default value to true for dynamic scaling enabled column on Servi…
harikrishna-patnala Feb 10, 2021
1e84d8c
Changes added to UI to show Scale VM icon to only VMs which are marke…
harikrishna-patnala Feb 11, 2021
cb693af
Updated marvin tests and removed redundant translations
harikrishna-patnala Apr 30, 2021
90da94d
Grey out enable dynamic scaling option on deploy VM wizard when servi…
harikrishna-patnala May 21, 2021
ced6630
Greyout Scale VM Icon on a running VM, if the VM is not configured to…
harikrishna-patnala May 21, 2021
4b93c40
Add global setting value to the enable or disable the flag on UI
harikrishna-patnala May 24, 2021
10d0953
Grey out dynamic scale VM flag on Edit VM dialog if dynamic scaling i…
harikrishna-patnala May 26, 2021
d847caa
Fix test_scale.py for simulator environment
harikrishna-patnala May 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/offering/ServiceOffering.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,6 @@ public enum StorageType {
String getDeploymentPlanner();

boolean isDynamic();

boolean isDynamicScalingEnabled();
}
6 changes: 3 additions & 3 deletions api/src/main/java/com/cloud/vm/UserVmService.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering s
String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, Boolean displayVm, String keyboard,
List<Long> affinityGroupIdList, Map<String, String> customParameter, String customId, Map<String, Map<Integer, String>> dhcpOptionMap,
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
Map<String, String> userVmOVFProperties) throws InsufficientCapacityException,
Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;

/**
Expand Down Expand Up @@ -300,7 +300,7 @@ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOfferin
HTTPMethod httpmethod, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard,
List<Long> affinityGroupIdList, Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap,
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
Map<String, String> userVmOVFProperties) throws InsufficientCapacityException,
Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;

/**
Expand Down Expand Up @@ -379,7 +379,7 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData,
String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List<Long> affinityGroupIdList,
Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
Map<String, String> templateOvfPropertiesMap)
Map<String, String> templateOvfPropertiesMap, boolean dynamicScalingEnabled)

throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;

Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/vm/VirtualMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,6 @@ public boolean isUsedBySystem() {
@Override
boolean isDisplay();

boolean isDynamicallyScalable();

}
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ public class ApiConstants {
public static final String CROSS_ZONES = "crossZones";
public static final String TEMPLATETYPE = "templatetype";
public static final String SOURCETEMPLATEID = "sourcetemplateid";
public static final String DYNAMIC_SCALING_ENABLED = "dynamicscalingenabled";

public static final String POOL_TYPE ="pooltype";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ public class CreateServiceOfferingCmd extends BaseCmd {
@Parameter(name = ApiConstants.STORAGE_POLICY, type = CommandType.UUID, entityType = VsphereStoragePoliciesResponse.class,required = false, description = "Name of the storage policy defined at vCenter, this is applicable only for VMware", since = "4.15")
private Long storagePolicy;

@Parameter(name = ApiConstants.DYNAMIC_SCALING_ENABLED, type = CommandType.BOOLEAN, since = "4.16",
description = "true if virtual machine needs to be dynamically scalable of cpu or memory")
protected Boolean isDynamicScalingEnabled;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand Down Expand Up @@ -441,6 +445,10 @@ public Long getStoragePolicy() {
return storagePolicy;
}

public boolean getDynamicScalingEnabled() {
return isDynamicScalingEnabled == null ? true : isDynamicScalingEnabled;
}

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd implements SecurityG
@LogLevel(LogLevel.Log4jLevel.Off)
private Map vAppNetworks;

@Parameter(name = ApiConstants.DYNAMIC_SCALING_ENABLED, type = CommandType.BOOLEAN, since = "4.16",
description = "true if virtual machine needs to be dynamically scalable")
protected Boolean dynamicScalingEnabled;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand Down Expand Up @@ -623,6 +627,10 @@ public Boolean getBootIntoSetup() {
return bootIntoSetup;
}

public boolean isDynamicScalingEnabled() {
return dynamicScalingEnabled == null ? true : dynamicScalingEnabled;
}

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class UpdateVMCmd extends BaseCustomIdCmd implements SecurityGroupAction,

@Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE,
type = CommandType.BOOLEAN,
description = "true if VM contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
description = "true if VM contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory. This can be updated only when dynamic scaling is enabled on template, service offering and the corresponding global setting")
protected Boolean isDynamicallyScalable;

@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "new host name of the vm. The VM has to be stopped/started for this update to take affect", since = "4.4")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ public class ServiceOfferingResponse extends BaseResponse {
@Param(description = "Root disk size in GB", since = "4.15")
private Long rootDiskSize;

@SerializedName(ApiConstants.DYNAMIC_SCALING_ENABLED)
@Param(description = "true if virtual machine needs to be dynamically scalable of cpu or memory", since = "4.16")
private Boolean dynamicScalingEnabled;

public ServiceOfferingResponse() {
}

Expand Down Expand Up @@ -457,7 +461,6 @@ public void setDetails(Map<String, String> details) {

public void setIscutomized(boolean iscutomized) {
this.isCustomized = iscutomized;

}

public void setCacheMode(String cacheMode) {
Expand All @@ -475,4 +478,12 @@ public void setVsphereStoragePolicy(String vsphereStoragePolicy) {
public void setRootDiskSize(Long rootDiskSize) {
this.rootDiskSize = rootDiskSize;
}

public Boolean getDynamicScalingEnabled() {
return dynamicScalingEnabled;
}

public void setDynamicScalingEnabled(Boolean dynamicScalingEnabled) {
this.dynamicScalingEnabled = dynamicScalingEnabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ public class SystemVmResponse extends BaseResponse {
@Param(description = "the systemvm agent version", since = "4.13.1")
private String version;

@SerializedName(ApiConstants.IS_DYNAMICALLY_SCALABLE)
@Param(description = "true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.")
private Boolean isDynamicallyScalable;

@Override
public String getObjectId() {
return this.getId();
Expand Down Expand Up @@ -442,4 +446,12 @@ public String getVersion() {
public void setVersion(String version) {
this.version = version;
}

public Boolean getDynamicallyScalable() {
return isDynamicallyScalable;
}

public void setDynamicallyScalable(Boolean dynamicallyScalable) {
isDynamicallyScalable = dynamicallyScalable;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3916,6 +3916,9 @@ public boolean upgradeVmDb(final long vmId, final ServiceOffering newServiceOffe
if (currentServiceOffering.isDynamic() && !newServiceOffering.isDynamic()) {
removeCustomOfferingDetails(vmId);
}
VMTemplateVO template = _templateDao.findById(vmForUpdate.getTemplateId());
boolean dynamicScalingEnabled = _userVmMgr.checkIfDynamicScalingCanBeEnabled(vmForUpdate, newServiceOffering, template, vmForUpdate.getDataCenterId());
vmForUpdate.setDynamicallyScalable(dynamicScalingEnabled);
return _vmDao.update(vmId, vmForUpdate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
@Column(name = "deployment_planner")
private String deploymentPlanner = null;

@Column(name = "dynamic_scaling_enabled")
private boolean dynamicScalingEnabled = true;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harikrishna-patnala what's the difference between "dynamic_scaling_enabled" vs "is_dynamic" field?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_dynamic is related to custom compute offerings and thats a transient parameter.

// This is a delayed load value. If the value is null,
// then this field has not been loaded yet.
// Call service offering dao to load it.
Expand All @@ -91,7 +94,7 @@ protected ServiceOfferingVO() {
}

public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, String displayText,
ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vmType, boolean defaultUse) {
ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vmType, boolean defaultUse) {
super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);
this.cpu = cpu;
this.ramSize = ramSize;
Expand All @@ -105,64 +108,22 @@ public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer spee
this.vmType = vmType == null ? null : vmType.toString().toLowerCase();
}

public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse,
boolean volatileVm, String displayText, ProvisioningType provisioningType, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vmType) {
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) {
super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);
this.cpu = cpu;
this.ramSize = ramSize;
this.speed = speed;
this.rateMbps = rateMbps;
this.multicastRateMbps = multicastRateMbps;
this.offerHA = offerHA;
this.limitCpuUse = limitCpuUse;
this.limitCpuUse = limitResourceUse;
this.volatileVm = volatileVm;
this.vmType = vmType == null ? null : vmType.toString().toLowerCase();
}

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) {
this(name,
cpu,
ramSize,
speed,
rateMbps,
multicastRateMbps,
offerHA,
limitResourceUse,
volatileVm,
displayText,
provisioningType,
useLocalStorage,
recreatable,
tags,
systemUse,
vmType
);
this.hostTag = hostTag;
}

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) {
this(name,
cpu,
ramSize,
speed,
rateMbps,
multicastRateMbps,
offerHA,
limitResourceUse,
volatileVm,
displayText,
provisioningType,
useLocalStorage,
recreatable,
tags,
systemUse,
vmType,
hostTag);
this.deploymentPlanner = deploymentPlanner;
this.dynamicScalingEnabled = dynamicScalingEnabled;
}

public ServiceOfferingVO(ServiceOfferingVO offering) {
Expand All @@ -189,6 +150,7 @@ public ServiceOfferingVO(ServiceOfferingVO offering) {
volatileVm = offering.isVolatileVm();
hostTag = offering.getHostTag();
vmType = offering.getSystemVmType();
dynamicScalingEnabled = offering.isDynamicScalingEnabled();
}

@Override
Expand Down Expand Up @@ -334,4 +296,13 @@ public void setDynamicFlag(boolean isdynamic) {
public boolean isCustomCpuSpeedSupported() {
return isCustomized() && getDetail("minCPU") != null;
}

@Override
public boolean isDynamicScalingEnabled() {
return dynamicScalingEnabled;
}

public void setDynamicScalingEnabled(boolean dynamicScalingEnabled) {
this.dynamicScalingEnabled = dynamicScalingEnabled;
}
}
2 changes: 1 addition & 1 deletion engine/schema/src/main/java/com/cloud/vm/VMInstanceVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ public void setDynamicallyScalable(boolean dynamicallyScalable) {
this.dynamicallyScalable = dynamicallyScalable;
}

public Boolean isDynamicallyScalable() {
public boolean isDynamicallyScalable() {
return dynamicallyScalable;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject<State, Virt
@Column(name = "backup_volumes")
private String backupVolumes;

@Column(name = "dynamically_scalable")
protected boolean dynamicallyScalable;

@Transient
private VMReservationVO vmReservation;

Expand Down Expand Up @@ -561,6 +564,11 @@ public boolean isDisplay() {
return display;
}

@Override
public boolean isDynamicallyScalable() {
return dynamicallyScalable;
}

public void setDisplay(boolean display) {
this.display = display;
}
Expand Down
Loading