Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
e85326c
Schema changes and disk offering column change from "type" to "comput…
harikrishna-patnala Apr 14, 2021
6c2f8d8
Few more changes
harikrishna-patnala Apr 16, 2021
1ffb7a5
Decoupled service offering and disk offering
harikrishna-patnala May 6, 2021
5827b62
Remove diskofferingid from vminstance VO
harikrishna-patnala May 10, 2021
5808200
Decouple service offering and disk offering states
harikrishna-patnala May 10, 2021
b0645a5
diskoffering getsize() is only for strict disk offerings
harikrishna-patnala May 11, 2021
90c83ea
Fix deployVM flow
harikrishna-patnala May 11, 2021
6854c67
Added new API params to compute offering creation
harikrishna-patnala May 18, 2021
a044a6f
Add diskofferingstrictness to serviceoffering vo under quota
harikrishna-patnala May 25, 2021
2f453a9
Added overrideDiskOfferingId parameter in deploy VM API which will ov…
harikrishna-patnala May 28, 2021
a54ec08
Fix User vm response to show proper service offering and disk offerings
harikrishna-patnala Jun 17, 2021
011aabb
Added disk size strictness in disk offering response
harikrishna-patnala Jun 17, 2021
325ebb0
Added disk offering strictness to the service offering response
harikrishna-patnala Jun 17, 2021
7c035ef
Remove comments
harikrishna-patnala Jun 17, 2021
53e653f
Added UI changes for Disk offering strictness in add compute offering…
harikrishna-patnala Jun 17, 2021
be9680b
Added diskoffering details to the service offering response
harikrishna-patnala Jun 18, 2021
aa567ae
Added UI changes in deployvm wizard to accept override disk offering id
harikrishna-patnala Jun 19, 2021
c01f4e0
Fix delete compute offering
harikrishna-patnala Jun 20, 2021
51d0493
Fix VM deployment from custom service offering
harikrishna-patnala Jun 21, 2021
f86bd07
Move uselocalstorage column access from service offering to disk offe…
harikrishna-patnala Jun 21, 2021
3a5a92a
UI: Separated compute and disk releated parameters in add compute off…
harikrishna-patnala Jun 22, 2021
1412ff9
Fixed diskoffering automatic selection on add compute offering wizard
harikrishna-patnala Jun 22, 2021
0944ef6
UI: move compute only toggle button outside the box in add compute of…
harikrishna-patnala Jun 24, 2021
9d5d89b
Added volumeId parameter to listDiskOfferings API and the disksizestr…
harikrishna-patnala Jul 15, 2021
28f5dd2
Added configuration parameter to decide whether to check volume tags …
harikrishna-patnala Jul 16, 2021
67e242d
Added disk offering change checks during resize volume operation
harikrishna-patnala Jul 16, 2021
859e3b0
Added new API changeofferingforVolume API and corresponding changes
harikrishna-patnala Aug 4, 2021
c45f9d9
Add UI form for changeOfferingForVolume API
harikrishna-patnala Aug 4, 2021
eaaa37e
Fix UI conflicts
harikrishna-patnala Aug 5, 2021
3d7a24a
Fix service offering usage as disk offering
harikrishna-patnala Aug 5, 2021
008b9f9
Fix unit test failures
harikrishna-patnala Aug 5, 2021
88050f1
fix user_vm_view
harikrishna-patnala Aug 6, 2021
bdbbd75
Addressed review comments
harikrishna-patnala Aug 9, 2021
d3a1216
Fixed service_offering_view
harikrishna-patnala Aug 9, 2021
bd85724
Fix service offering edit flow
harikrishna-patnala Aug 9, 2021
2c39302
Fix service offering constructor to address custom offering
harikrishna-patnala Aug 9, 2021
e616aaf
Fix domain_router_view to get proper service offering id
harikrishna-patnala Aug 9, 2021
c16324a
Removed unused import
harikrishna-patnala Aug 9, 2021
6de0528
Addressed review comments and fixed update service offering flow with…
harikrishna-patnala Aug 10, 2021
f5080ee
Added marvin test cases for checking disk offering strictness
harikrishna-patnala Aug 11, 2021
03947f1
review comments addressed
harikrishna-patnala Aug 11, 2021
a81455f
Remove system_use column from disk offering join
harikrishna-patnala Aug 13, 2021
e375775
update volume_view to update system_use column from service offering …
harikrishna-patnala Aug 13, 2021
62fdc9d
Fix changeOfferingForVolume API for custom disk offering
harikrishna-patnala Aug 16, 2021
bddec5e
Fix global setting implementation
harikrishna-patnala Aug 18, 2021
718de60
Fix list volumes, after changing system_use column from disk offering…
harikrishna-patnala Aug 18, 2021
b708739
Changes for override root disk offering in deployvm wizard in case of…
harikrishna-patnala Aug 19, 2021
59d0421
Fix a unit test case
harikrishna-patnala Aug 19, 2021
4f5b72e
Fixed recent unit test cases with new serviceofferingvo constructor
harikrishna-patnala Aug 23, 2021
25c2c41
Fix unit test in VolumeApiServiceImpl
harikrishna-patnala Aug 23, 2021
ece268e
Added storage id for the list disk offering API and corresponding UI …
harikrishna-patnala Aug 24, 2021
4a435d6
Rename global configuration parameter from storage.pool.tags.disk.off…
harikrishna-patnala Aug 24, 2021
63a3766
Fix smoke test failures
harikrishna-patnala Aug 27, 2021
1c5560c
Added tool tip for migrate volume UI form
harikrishna-patnala Aug 30, 2021
4670b47
Address review comments and fix UI form of deploy VM in case of ISO.
harikrishna-patnala Aug 31, 2021
42844a8
Fixed resize volume UI form for data disk
harikrishna-patnala Sep 3, 2021
8c624f9
UI changes to disable override root disk size when override root disk…
harikrishna-patnala Sep 7, 2021
5bf80cf
UI fix in deploy vm wizard
harikrishna-patnala Sep 7, 2021
ba48b94
Fix listdiskoffering after rebasing with main
harikrishna-patnala Sep 7, 2021
1b9810e
Fixed UI in migrate and changeofferingfor volume to handle empty disk…
harikrishna-patnala Sep 9, 2021
f7ba4c7
Added custom Iops to resize volume form and removed the current disk …
harikrishna-patnala Sep 11, 2021
d965060
Fix false response on updateDiskOffering API
harikrishna-patnala Sep 20, 2021
243522a
Added search field for changeofferingforvolume UI form
harikrishna-patnala Sep 20, 2021
4c29898
Fix resize volume and migrate volume to update volume path if DRS is …
harikrishna-patnala Sep 30, 2021
60d67c4
Removed DB changes from 4.16 upgrade file
harikrishna-patnala Nov 22, 2021
89cda49
Resolving merge conflicts with main 4.17
harikrishna-patnala Nov 22, 2021
71e2207
Added support for auto migration and auto resize of the root volume u…
harikrishna-patnala Nov 23, 2021
2fc0125
UI: Added automigrate checkbox in scale VM form
harikrishna-patnala Nov 23, 2021
8be72bb
Addes since attributes to new API params
harikrishna-patnala Nov 24, 2021
b1d37e0
Added shrinkOK parameter to changeofferingforvolume API
harikrishna-patnala Nov 24, 2021
5a661a2
Added shrinkOk param to UI in changeOfferingforVolume form
harikrishna-patnala Nov 24, 2021
bdc5c7f
Added shrinkOk flag to scaleVM and changeServiceForVirtualMachines an…
harikrishna-patnala Nov 24, 2021
71fa71e
Removed old foreign key constraint on IDs of service offering and dis…
harikrishna-patnala Nov 25, 2021
f1a650b
Allow resize and automigrate of root volume if required in all cases …
harikrishna-patnala Dec 16, 2021
2c6698a
Allow only resize to higher disk size from UI
harikrishna-patnala Dec 17, 2021
ff83da8
Fixing vue syntax error
harikrishna-patnala Dec 20, 2021
58dadd2
Make UI changes to provide root disk size box when the linked disk of…
harikrishna-patnala Dec 28, 2021
37c2683
Converted from check box to toggle in scale VM, changeoffering, resiz…
harikrishna-patnala Dec 28, 2021
550b6ed
Fix resize volume operation to update the VM settings
harikrishna-patnala Dec 28, 2021
c16321f
Fix migratevolume form to pick selected storage pool id in list disko…
harikrishna-patnala Dec 31, 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
Prev Previous commit
Next Next commit
review comments addressed
  • Loading branch information
harikrishna-patnala committed Jan 25, 2022
commit 03947f1c4bee03cdb1a121d3c590842227cced54
2 changes: 0 additions & 2 deletions api/src/main/java/com/cloud/offering/DiskOffering.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public String toString() {

String getName();

boolean isSystemUse();

String getDisplayText();

ProvisioningType getProvisioningType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public class ChangeOfferingForVolumeCmd extends BaseAsyncCmd implements UserCmd
description = "new disk offering id")
private Long newDiskOfferingId;

@Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, required = false, description = "New volume size in GB")
@Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, required = false, description = "New volume size in GB for the custom disk offering")
private Long size;

@Parameter(name = ApiConstants.MIN_IOPS, type = CommandType.LONG, required = false, description = "New minimum number of IOPS")
@Parameter(name = ApiConstants.MIN_IOPS, type = CommandType.LONG, required = false, description = "New minimum number of IOPS for the custom disk offering")
private Long minIops;

@Parameter(name = ApiConstants.MAX_IOPS, type = CommandType.LONG, required = false, description = "New maximum number of IOPS")
@Parameter(name = ApiConstants.MAX_IOPS, type = CommandType.LONG, required = false, description = "New maximum number of IOPS for the custom disk offering")
private Long maxIops;

@Parameter(name = ApiConstants.AUTO_MIGRATE, type = CommandType.BOOLEAN, required = false, description = "Flag for automatic migration of the volume " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,21 @@ public class ServiceOfferingResponse extends BaseResponseWithAnnotations {
private Boolean dynamicScalingEnabled;

@SerializedName(ApiConstants.DISK_OFFERING_STRICTNESS)
@Param(description = "True/False to indicate the strictness of the disk offering association with the compute offering. When set to true, override of disk offering is not allowed when VM is deployed and change disk offering is not allowed for the ROOT disk after the VM is deployed", since = "4.16")
@Param(description = "True/False to indicate the strictness of the disk offering association with the compute offering. " +
"When set to true, override of disk offering is not allowed when VM is deployed and " +
"change disk offering is not allowed for the ROOT disk after the VM is deployed", since = "4.16")
private Boolean diskOfferingStrictness;

@SerializedName(ApiConstants.DISK_OFFERING_ID)
@Param(description = "the ID of the disk offering to which service offering is linked", since = "4.16")
private String diskOfferingId;

@SerializedName("diskofferingname")
@Param(description = "name of the disk offering")
@Param(description = "name of the disk offering", since = "4.16")
private String diskOfferingName;

@SerializedName("diskofferingdisplaytext")
@Param(description = "the display text of the disk offering")
@Param(description = "the display text of the disk offering", since = "4.16")
private String diskOfferingDisplayText;

public ServiceOfferingResponse() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void destroyVolume(String volumeEntity) {
@Override
public VirtualMachineEntity createVirtualMachine(String id, String owner, String templateId, String hostName, String displayName, String hypervisor, int cpu,
int speed, long memory, Long diskSize, List<String> computeTags, List<String> rootDiskTags, Map<String, List<NicProfile>> networkNicMap, DeploymentPlan plan,
Long rootDiskSize, Map<String, Map<Integer, String>> extraDhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Long diskOfferingId, Long rootDiskOfferingId) throws InsufficientCapacityException {
Long rootDiskSize, Map<String, Map<Integer, String>> extraDhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Long dataDiskOfferingId, Long rootDiskOfferingId) throws InsufficientCapacityException {

// VirtualMachineEntityImpl vmEntity = new VirtualMachineEntityImpl(id, owner, hostName, displayName, cpu, speed, memory, computeTags, rootDiskTags, networks,
// vmEntityManager);
Expand Down Expand Up @@ -187,7 +187,7 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String

DiskOfferingVO rootDiskOffering = _diskOfferingDao.findById(rootDiskOfferingId);
if (rootDiskOffering == null) {
throw new InvalidParameterValueException("Unable to find disk offering " + rootDiskOfferingId);
throw new InvalidParameterValueException("Unable to find root disk offering " + rootDiskOfferingId);
}
rootDiskOfferingInfo.setDiskOffering(rootDiskOffering);
rootDiskOfferingInfo.setSize(rootDiskSize);
Expand All @@ -204,10 +204,10 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String
}
}

if (diskOfferingId != null) {
DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
if (dataDiskOfferingId != null) {
DiskOfferingVO diskOffering = _diskOfferingDao.findById(dataDiskOfferingId);
if (diskOffering == null) {
throw new InvalidParameterValueException("Unable to find disk offering " + diskOfferingId);
throw new InvalidParameterValueException("Unable to find data disk offering " + dataDiskOfferingId);
}
if (!diskOffering.isComputeOnly()) {
Long size = null;
Expand Down Expand Up @@ -244,7 +244,7 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String
for (Entry<Long, DiskOffering> datadiskTemplateToDiskOffering : dataDiskTemplateToDiskOfferingMap.entrySet()) {
DiskOffering dataDiskOffering = datadiskTemplateToDiskOffering.getValue();
if (dataDiskOffering == null) {
throw new InvalidParameterValueException("Unable to find disk offering " + diskOfferingId);
throw new InvalidParameterValueException("Unable to find disk offering " + dataDiskOfferingId);
}
if (dataDiskOffering.getDiskSize() == 0) { // Custom disk offering is not supported for volumes created from datadisk templates
throw new InvalidParameterValueException("Disk offering " + dataDiskOffering + " requires size parameter.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public ServiceOfferingVO getComputeOffering(ServiceOfferingVO serviceOffering, M
public List<ServiceOfferingVO> createSystemServiceOfferings(String name, String uniqueName, int cpuCount, int ramSize, int cpuSpeed,
Integer rateMbps, Integer multicastRateMbps, boolean offerHA, String displayText, ProvisioningType provisioningType,
boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vmType, boolean defaultUse) {
DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, displayText, provisioningType, false, tags, recreatable, false, systemUse, true);
DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, displayText, provisioningType, false, tags, recreatable, false, true);
diskOfferingVO.setUniqueName(uniqueName);
diskOfferingVO = diskOfferingDao.persistDefaultDiskOffering(diskOfferingVO);

Expand All @@ -238,7 +238,7 @@ public List<ServiceOfferingVO> createSystemServiceOfferings(String name, String
useLocal = false;
}

diskOfferingVO = new DiskOfferingVO(name + (useLocal ? " - Local Storage" : ""), displayText, provisioningType, false, tags, recreatable, useLocal, systemUse, true);
diskOfferingVO = new DiskOfferingVO(name + (useLocal ? " - Local Storage" : ""), displayText, provisioningType, false, tags, recreatable, useLocal, true);
diskOfferingVO.setUniqueName(uniqueName + (useLocal ? "-Local" : ""));
diskOfferingVO = diskOfferingDao.persistDefaultDiskOffering(diskOfferingVO);

Expand Down
18 changes: 2 additions & 16 deletions engine/schema/src/main/java/com/cloud/storage/DiskOfferingVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ public class DiskOfferingVO implements DiskOffering {
@Column(name = "use_local_storage")
private boolean useLocalStorage;

@Column(name = "system_use")
private boolean systemUse;

@Column(name = "customized")
private boolean customized;

Expand Down Expand Up @@ -193,7 +190,7 @@ public DiskOfferingVO(String name, String displayText, Storage.ProvisioningType
state = State.Active;
}

public DiskOfferingVO(String name, String displayText, Storage.ProvisioningType provisioningType, boolean mirrored, String tags, boolean recreatable, boolean useLocalStorage, boolean systemUse,
public DiskOfferingVO(String name, String displayText, Storage.ProvisioningType provisioningType, boolean mirrored, String tags, boolean recreatable, boolean useLocalStorage,
boolean customized) {
computeOnly = true;
this.name = name;
Expand All @@ -202,14 +199,13 @@ public DiskOfferingVO(String name, String displayText, Storage.ProvisioningType
this.tags = tags;
this.recreatable = recreatable;
this.useLocalStorage = useLocalStorage;
this.systemUse = systemUse;
this.customized = customized;
uuid = UUID.randomUUID().toString();
state = State.Active;
}

public DiskOfferingVO(long id, String name, String displayText, Storage.ProvisioningType provisioningType, boolean mirrored, String tags, boolean recreatable, boolean useLocalStorage,
boolean systemUse, boolean customized, boolean customizedIops, Long minIops, Long maxIops) {
boolean customized, boolean customizedIops, Long minIops, Long maxIops) {
this.id = id;
computeOnly = true;
this.name = name;
Expand All @@ -218,7 +214,6 @@ public DiskOfferingVO(long id, String name, String displayText, Storage.Provisio
this.tags = tags;
this.recreatable = recreatable;
this.useLocalStorage = useLocalStorage;
this.systemUse = systemUse;
this.customized = customized;
this.customizedIops = customizedIops;
uuid = UUID.randomUUID().toString();
Expand Down Expand Up @@ -319,15 +314,6 @@ public void setName(String name) {
this.name = name;
}

@Override
public boolean isSystemUse() {
return systemUse;
}

public void setSystemUse(boolean systemUse) {
this.systemUse = systemUse;
}

@Override
public String getDisplayText() {
return displayText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

public interface DiskOfferingDao extends GenericDao<DiskOfferingVO, Long> {

List<DiskOfferingVO> findPrivateDiskOffering();

List<DiskOfferingVO> findPublicDiskOfferings();

DiskOfferingVO findByUniqueName(String uniqueName);

DiskOfferingVO persistDefaultDiskOffering(DiskOfferingVO offering);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ public class DiskOfferingDaoImpl extends GenericDaoBase<DiskOfferingVO, Long> im
@Inject
protected DiskOfferingDetailsDao detailsDao;

private final SearchBuilder<DiskOfferingVO> PrivateDiskOfferingSearch;
private final SearchBuilder<DiskOfferingVO> PublicDiskOfferingSearch;
protected final SearchBuilder<DiskOfferingVO> UniqueNameSearch;
private final String SizeDiskOfferingSearch = "SELECT * FROM disk_offering WHERE " +
"disk_size = ? AND provisioning_type = ? AND removed IS NULL";
Expand All @@ -55,29 +53,13 @@ public class DiskOfferingDaoImpl extends GenericDaoBase<DiskOfferingVO, Long> im
protected final static long GB_UNIT_BYTES = 1024 * 1024 * 1024;

protected DiskOfferingDaoImpl() {
PrivateDiskOfferingSearch = createSearchBuilder();
PrivateDiskOfferingSearch.and("diskSize", PrivateDiskOfferingSearch.entity().getDiskSize(), SearchCriteria.Op.EQ);
PrivateDiskOfferingSearch.done();

PublicDiskOfferingSearch = createSearchBuilder();
PublicDiskOfferingSearch.and("system", PublicDiskOfferingSearch.entity().isSystemUse(), SearchCriteria.Op.EQ);
PublicDiskOfferingSearch.and("removed", PublicDiskOfferingSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
PublicDiskOfferingSearch.done();

UniqueNameSearch = createSearchBuilder();
UniqueNameSearch.and("name", UniqueNameSearch.entity().getUniqueName(), SearchCriteria.Op.EQ);
UniqueNameSearch.done();

_computeOnlyAttr = _allAttributes.get("computeOnly");
}

@Override
public List<DiskOfferingVO> findPrivateDiskOffering() {
SearchCriteria<DiskOfferingVO> sc = PrivateDiskOfferingSearch.create();
sc.setParameters("diskSize", 0);
return listBy(sc);
}

@Override
public List<DiskOfferingVO> searchIncludingRemoved(SearchCriteria<DiskOfferingVO> sc, final Filter filter, final Boolean lock, final boolean cache) {
return super.searchIncludingRemoved(sc, filter, lock, cache);
Expand All @@ -101,17 +83,6 @@ protected List<DiskOfferingVO> executeList(final String sql, final Object... par
return super.executeList(sql, false, params);
}

@Override
public List<DiskOfferingVO> findPublicDiskOfferings() {
SearchCriteria<DiskOfferingVO> sc = PublicDiskOfferingSearch.create();
sc.setParameters("system", false);
List<DiskOfferingVO> offerings = listBy(sc);
if(offerings!=null) {
offerings.removeIf(o -> (!detailsDao.findDomainIds(o.getId()).isEmpty()));
}
return offerings;
}

@Override
public DiskOfferingVO findByUniqueName(String uniqueName) {
SearchCriteria<DiskOfferingVO> sc = UniqueNameSearch.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ private Long getImportingVMGuestOs(VirtualMachineConfigSummary configSummary) {
private ServiceOfferingVO createServiceOfferingForVMImporting(Integer cpus, Integer memory, Integer maxCpuUsage) {
String name = "Imported-" + cpus + "-" + memory;

DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, name, Storage.ProvisioningType.THIN, false, null, false, false, false, true);
DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, name, Storage.ProvisioningType.THIN, false, null, false, false, true);
diskOfferingVO = diskOfferingDao.persistDefaultDiskOffering(diskOfferingVO);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3022,7 +3022,7 @@ private DiskOfferingVO createDiskOfferingInternal(final long userId, final boole
Long iopsWriteRate, Long iopsWriteRateMax, Long iopsWriteRateMaxLength,
final Integer hypervisorSnapshotReserve, String cacheMode, final Long storagePolicyID) {

DiskOfferingVO diskOffering = new DiskOfferingVO(name, displayText, typedProvisioningType, false, tags, false, localStorageRequired, isSystem, true);
DiskOfferingVO diskOffering = new DiskOfferingVO(name, displayText, typedProvisioningType, false, tags, false, localStorageRequired, true);

if (Boolean.TRUE.equals(isCustomizedIops) || isCustomizedIops == null) {
minIops = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,16 +920,15 @@ private DiskOfferingVO createDefaultDiskOffering(String name, String description

DiskOfferingVO newDiskOffering = new DiskOfferingVO(name, description, provisioningType, diskSize, tags, isCustomized, null, null, null);
newDiskOffering.setUniqueName("Cloud.Com-" + name);
// leaving the above reference to cloud.com in as it is an identifyer and has no real world relevance
newDiskOffering.setSystemUse(isSystemUse);
// leaving the above reference to cloud.com in as it is an identifier and has no real world relevance
newDiskOffering = _diskOfferingDao.persistDefaultDiskOffering(newDiskOffering);
return newDiskOffering;
}

private ServiceOfferingVO createServiceOffering(long userId, String name, int cpu, int ramSize, int speed, String displayText,
ProvisioningType provisioningType, boolean localStorageRequired, boolean offerHA, String tags) {
tags = cleanupTags(tags);
DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, displayText, provisioningType, false, tags, false, false, false, true);
DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, displayText, provisioningType, false, tags, false, false, true);
diskOfferingVO.setUniqueName("Cloud.Com-" + name);
Copy link
Contributor

Choose a reason for hiding this comment

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

is this prefix "Cloud.Com-" required or offerings ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here we are splitting the service offering and disk offering, so using the same name for both offerings.

Copy link
Contributor

Choose a reason for hiding this comment

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

Post upgrade, the existing service offerings and related disk offerings have the same name. While creating a new service offering, this prefix may not be required. what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Is this just for default offerings?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes @rhtyd

diskOfferingVO = _diskOfferingDao.persistDefaultDiskOffering(diskOfferingVO);

Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/com/cloud/test/DatabaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ protected void saveServiceOffering() {
} else {
useLocalStorage = false;
}
DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, displayText, provisioningType, false, null, false, false, false, true);
DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, displayText, provisioningType, false, null, false, false, true);

ServiceOfferingVO serviceOffering =
new ServiceOfferingVO(name, cpu, ramSize, speed, null, null, ha, displayText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,6 @@ public void isNotPossibleToResizeTestNoRootDiskSize() {
prepareAndRunTestOfIsNotPossibleToResize(Type.ROOT, 0l, Storage.ImageFormat.QCOW2, false);
}

// FR123 update this test case to check service offering strictness
private void prepareAndRunTestOfIsNotPossibleToResize(Type volumeType, Long rootDisk, Storage.ImageFormat imageFormat, boolean expectedIsNotPossibleToResize) {
VolumeVO volume = Mockito.mock(VolumeVO.class);
when(volume.getVolumeType()).thenReturn(volumeType);
Expand Down