You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/09/01 07:36:25 UTC

[GitHub] [cloudstack] harikrishna-patnala opened a new pull request #5008: Decouple service (compute) offering and disk offering

harikrishna-patnala opened a new pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   ### Description
   
   Currently, our compute offerings and disk offerings are tightly coupled with respect to many aspects. For example, if a compute offering is created, a corresponding disk offering entry is also created with the same ID as the reference. Also creating compute offering takes few disk-related parameters which anyway goes to the corresponding disk offering only. I think this design was initially made to address compute offering for the root volume created from a template. Also changing the offering of a volume is tightly coupled with storage tags and has to be done in different APIs either migrateVolume or resizeVolume. Changing of disk offering should be seamless and should consider new storage tags, new size and place the volume in appropriate state as defined in disk offering.
   
   more details are mentioned here https://cwiki.apache.org/confluence/display/CLOUDSTACK/Compute+offering+and+disk+offering+refactoring
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [x] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [x] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [x] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020802011


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] borisstoyanov commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
borisstoyanov commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1023001674


   ok great!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala closed pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala closed pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864469347


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r655389615



##########
File path: engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java
##########
@@ -103,11 +146,16 @@ public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer spee
         volatileVm = false;
         this.defaultUse = defaultUse;
         this.vmType = vmType == null ? null : vmType.toString().toLowerCase();
+        uuid = UUID.randomUUID().toString();
+        this.systemUse = systemUse;
+        this.name = name;
+        this.displayText = displayText;
     }
 
-    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) {
-        super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);
+    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) {
+        //super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);

Review comment:
       +1




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-837016786


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-922798077


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r698999668



##########
File path: ui/public/locales/en.json
##########
@@ -1414,6 +1419,7 @@
 "label.migrate.to.host": "Migrate to host",
 "label.migrate.to.storage": "Migrate to storage",
 "label.migrate.volume": "Migrate Volume",
+"message.migrate.volume.tooltip": "Volume can be migrated to any suitable storagepool. Admin has to choose the appropriate disk offering to replace, that supports the new storage pool",

Review comment:
       ```suggestion
   "message.migrate.volume.tooltip": "Volume can be migrated to any suitable storage pool. Admin has to choose the appropriate disk offering to replace, that supports the new storage pool",
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897423540


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 854


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-978889217


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1784


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-997797261


   > @harikrishna-patnala can you check this Syntax Error: `/ui/src/views/storage/MigrateVolume.vue: Unexpected token, expected "," (105:2)`
   
   Thanks @sureshanaparti, fixed it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r698972958



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/volume/ChangeOfferingForVolumeCmd.java
##########
@@ -0,0 +1,141 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.volume;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.offering.DiskOffering;
+import com.cloud.storage.Volume;
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+@APICommand(name = ChangeOfferingForVolumeCmd.APINAME,
+        description = "Change disk offering of the volume and also an option to auto migrate if required to apply the new disk offering",
+        responseObject = VolumeResponse.class,
+        requestHasSensitiveInfo = false,
+        responseHasSensitiveInfo = false,
+        authorized = { RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User},
+        since = "4.16")
+public class ChangeOfferingForVolumeCmd extends BaseAsyncCmd implements UserCmd {
+
+    public static final String APINAME = "changeOfferingForVolume";
+    public static final Logger s_logger = Logger.getLogger(ChangeOfferingForVolumeCmd.class.getName());
+    private static final String s_name = "changeofferingforvolumeresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name = ApiConstants.ID, entityType = VolumeResponse.class, required = true, type = CommandType.UUID, description = "the ID of the volume")
+    private Long id;
+
+    @Parameter(name = ApiConstants.DISK_OFFERING_ID,
+            entityType = DiskOfferingResponse.class,
+            type = CommandType.UUID,
+            required = true,
+            description = "new disk offering id")
+    private Long newDiskOfferingId;
+
+    @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 for the custom disk offering")
+    private Long minIops;
+
+    @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 " +
+            "with new disk offering whenever migration is required to apply the offering")
+    private Boolean autoMigrate;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public Long getNewDiskOfferingId() {
+        return newDiskOfferingId;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public Long getMinIops() {
+        return minIops;
+    }
+
+    public Long getMaxIops() {
+        return maxIops;
+    }
+
+    public boolean getAutoMigrate() {
+        return autoMigrate == null ? true : autoMigrate;

Review comment:
       The new API changeOfferingForVolume is supposed to keep the volume in the proper state as per the provided disk offering. So if migration of volume is required (as per the new disk offering) it has to be migrated, otherwise, API will fail. There is an option in UI also to tick/untick the flag. I think default true is fine. Let me know your comments too.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864471576


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: centos8 :heavy_check_mark: debian. SL-JID 302


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699032236



##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -1596,6 +1622,341 @@ public Volume recoverVolume(long volumeId) {
         return volume;
     }
 
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_VOLUME_CHANGE_DISK_OFFERING, eventDescription = "Changing disk offering of a volume")
+    public Volume changeDiskOfferingForVolume(ChangeOfferingForVolumeCmd cmd) throws ResourceAllocationException {
+        Long newSize = cmd.getSize();
+        Long newMinIops = cmd.getMinIops();
+        Long newMaxIops = cmd.getMaxIops();
+        Integer newHypervisorSnapshotReserve = null;
+        boolean autoMigrateVolume = cmd.getAutoMigrate();
+
+        boolean volumeMigrateRequired = false;
+        boolean volumeResizeRequired = false;
+
+        VolumeVO volume = _volsDao.findById(cmd.getId());
+        if (volume == null) {
+            throw new InvalidParameterValueException("No such volume");
+        }
+        long currentSize = volume.getSize();
+
+        DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+        DiskOfferingVO newDiskOffering = _diskOfferingDao.findById(cmd.getNewDiskOfferingId());
+
+        /* Does the caller have authority to act on this volume? */
+        _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume);
+
+        // VALIDATIONS
+
+        if (newDiskOffering.getId() == diskOffering.getId()) {
+            throw new InvalidParameterValueException(String.format("Volume %s already have the new disk offering %s provided", volume.getUuid(), diskOffering.getUuid()));
+        }
+
+        Long updateNewSize[] = {newSize};
+        Long updateNewMinIops[] = {newMinIops};
+        Long updateNewMaxIops[] = {newMaxIops};
+        Integer updateNewHypervisorSnapshotReserve[] = {newHypervisorSnapshotReserve};
+        validateVolumeResizeWithNewDiskOfferingAndLoad(volume, diskOffering, newDiskOffering, updateNewSize, updateNewMinIops, updateNewMaxIops, updateNewHypervisorSnapshotReserve);
+        newSize = updateNewSize[0];
+        newMinIops = updateNewMinIops[0];
+        newMaxIops = updateNewMaxIops[0];
+        newHypervisorSnapshotReserve = updateNewHypervisorSnapshotReserve[0];
+        validateVolumeResizeWithSize(volume, currentSize, newSize, true);
+
+        /* If this volume has never been beyond allocated state, short circuit everything and simply update the database. */
+        // We need to publish this event to usage_volume table
+        if (volume.getState() == Volume.State.Allocated) {
+            s_logger.debug("Volume is in the allocated state, but has never been created. Simply updating database with new size and IOPS.");
+
+            volume.setSize(newSize);
+            volume.setMinIops(newMinIops);
+            volume.setMaxIops(newMaxIops);
+            volume.setHypervisorSnapshotReserve(newHypervisorSnapshotReserve);
+
+            if (newDiskOffering != null) {
+                volume.setDiskOfferingId(cmd.getNewDiskOfferingId());
+            }
+
+            _volsDao.update(volume.getId(), volume);
+            if (currentSize != newSize) {
+                UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_RESIZE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(),
+                        volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize(), Volume.class.getName(), volume.getUuid());
+            }
+            return volume;
+        }
+
+        if (MatchStoragePoolTagsWithDiskOffering.valueIn(volume.getDataCenterId())) {
+            if (!doesNewDiskOfferingHasTagsAsOldDiskOffering(diskOffering, newDiskOffering)) {
+                throw new InvalidParameterValueException(String.format("Selected disk offering %s does not have tags as in existing disk offering of volume", diskOffering.getUuid(), volume.getUuid()));
+            }
+        }
+
+        if (currentSize != newSize || newMaxIops != volume.getMaxIops() || newMinIops != volume.getMinIops()) {
+            volumeResizeRequired = true;
+            validateVolumeResizeChecks(volume, currentSize, newSize);
+        }
+
+        StoragePoolVO existingStoragePool = _storagePoolDao.findById(volume.getPoolId());
+
+        Pair<List<? extends StoragePool>, List<? extends StoragePool>> poolsPair = managementService.listStoragePoolsForMigrationOfVolumeInternal(volume.getId(), newDiskOffering.getId(), newSize, newMinIops, newMaxIops, true);
+        List<? extends StoragePool> suitableStoragePools = poolsPair.second();
+
+        if (!suitableStoragePools.stream().anyMatch(p -> (p.getId() == existingStoragePool.getId()))) {
+            volumeMigrateRequired = true;
+            if (!autoMigrateVolume) {
+                throw new InvalidParameterValueException("Failed to change offering for volume since automigrate is set to false but volume needs to migrated");

Review comment:
       Keep volume id / name in the log here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895590343


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907140670


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907112719


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-914930584


   @blueorangutan test matrix 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907140670






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685782352



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/volume/ChangeOfferingForVolume.java
##########
@@ -0,0 +1,139 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.volume;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.offering.DiskOffering;
+import com.cloud.storage.Volume;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+@APICommand(name = ChangeOfferingForVolume.APINAME,
+        description = "Change disk offering of the volume and also an option to auto migrate if required to apply the new disk offering",
+        responseObject = VolumeResponse.class,
+        requestHasSensitiveInfo = false,
+        responseHasSensitiveInfo = false,
+        since = "4.16")
+public class ChangeOfferingForVolume extends BaseAsyncCmd implements UserCmd {
+
+    public static final String APINAME = "changeOfferingForVolume";
+    public static final Logger s_logger = Logger.getLogger(ChangeOfferingForVolume.class.getName());
+    private static final String s_name = "changeofferingforvolumeresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name = ApiConstants.ID, entityType = VolumeResponse.class, required = true, type = CommandType.UUID, description = "the ID of the volume")
+    private Long id;
+
+    @Parameter(name = ApiConstants.DISK_OFFERING_ID,
+            entityType = DiskOfferingResponse.class,
+            type = CommandType.UUID,
+            required = true,
+            description = "new disk offering id")
+    private Long newDiskOfferingId;
+
+    @Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, required = false, description = "New volume size in GB")
+    private Long size;

Review comment:
       Does the Size and Iops parameters have to explicitly passed to the cmd with new offering?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699152278



##########
File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -1448,10 +1452,15 @@ public int compare(Volume v1, Volume v2) {
                                 else
                                     requestVolumes = new ArrayList<Volume>();
                                 requestVolumes.add(vol);
-
+                                List<Pair<Volume, DiskProfile>> volumeDiskProfilePair = new ArrayList<>();
+                                for (Volume volume: requestVolumes) {
+                                    DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+                                    DiskProfile diskProfile = new DiskProfile(volume, diskOffering, _volsDao.getHypervisorType(volume.getId()));
+                                    volumeDiskProfilePair.add(new Pair<>(volume, diskProfile));

Review comment:
       moved to a new method getVolumeDiskProfilePairs()




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-912332558


   code LGTM
   
   @harikrishna-patnala can you fix the conflicts. thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1003908584


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1004558247


   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r658843411



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41510to41600.sql
##########
@@ -19,21 +19,293 @@
 -- Schema upgrade from 4.15.1.0 to 4.16.0.0
 --;
 
--- Adding dynamic scalable flag for service offering table
-ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';
-DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
-CREATE VIEW `cloud`.`service_offering_view` AS
+
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `name` varchar(255);
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `display_text` varchar(4096);
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `unique_name` varchar(32) COMMENT 'unique name for system offerings';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `customized` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT '0 implies not customized by default';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `created` datetime COMMENT 'date when service offering was created';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `removed` datetime COMMENT 'date when service offering was removed';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `state` CHAR(40) NOT NULL DEFAULT 'Active' COMMENT 'state of service offering either Active or Inactive';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `disk_offering_id` bigint unsigned;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `system_use` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'is this offering for system used only';
+ALTER TABLE `cloud`.`service_offering` ADD CONSTRAINT `fk_service_offering__disk_offering_id` FOREIGN KEY `fk_service_offering__disk_offering_id`(`disk_offering_id`) REFERENCES `disk_offering`(`id`) ON DELETE CASCADE;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `disk_offering_strictness` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT 'strict binding with disk offering or not';
+
+ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `disk_size_strictness` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT 'To allow or disallow the resize operation on the disks created from this offering';
+ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `compute_only` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT 'when set to 1, disk offering has one to one binding with service offering';
+ALTER TABLE `cloud`.`disk_offering` DROP COLUMN `type`;
+
+ALTER TABLE `cloud`.`vm_instance` DROP COLUMN `disk_offering_id`;
+
+UPDATE `cloud`.`service_offering` so, `cloud`.`disk_offering` do SET so.`name` = do.`name`, so.`display_text` = do.`display_text` WHERE so.`id` = do.`id`;
+
+DROP VIEW IF EXISTS `cloud`.`user_vm_view`;
+CREATE
+VIEW `user_vm_view` AS
     SELECT
-        `service_offering`.`id` AS `id`,
+        `vm_instance`.`id` AS `id`,
+        `vm_instance`.`name` AS `name`,
+        `user_vm`.`display_name` AS `display_name`,
+        `user_vm`.`user_data` AS `user_data`,
+        `account`.`id` AS `account_id`,
+        `account`.`uuid` AS `account_uuid`,
+        `account`.`account_name` AS `account_name`,
+        `account`.`type` AS `account_type`,
+        `domain`.`id` AS `domain_id`,
+        `domain`.`uuid` AS `domain_uuid`,
+        `domain`.`name` AS `domain_name`,
+        `domain`.`path` AS `domain_path`,
+        `projects`.`id` AS `project_id`,
+        `projects`.`uuid` AS `project_uuid`,
+        `projects`.`name` AS `project_name`,
+        `instance_group`.`id` AS `instance_group_id`,
+        `instance_group`.`uuid` AS `instance_group_uuid`,
+        `instance_group`.`name` AS `instance_group_name`,
+        `vm_instance`.`uuid` AS `uuid`,
+        `vm_instance`.`user_id` AS `user_id`,
+        `vm_instance`.`last_host_id` AS `last_host_id`,
+        `vm_instance`.`vm_type` AS `type`,
+        `vm_instance`.`limit_cpu_use` AS `limit_cpu_use`,
+        `vm_instance`.`created` AS `created`,
+        `vm_instance`.`state` AS `state`,
+        `vm_instance`.`removed` AS `removed`,
+        `vm_instance`.`ha_enabled` AS `ha_enabled`,
+        `vm_instance`.`hypervisor_type` AS `hypervisor_type`,
+        `vm_instance`.`instance_name` AS `instance_name`,
+        `vm_instance`.`guest_os_id` AS `guest_os_id`,
+        `vm_instance`.`display_vm` AS `display_vm`,
+        `guest_os`.`uuid` AS `guest_os_uuid`,
+        `vm_instance`.`pod_id` AS `pod_id`,
+        `host_pod_ref`.`uuid` AS `pod_uuid`,
+        `vm_instance`.`private_ip_address` AS `private_ip_address`,
+        `vm_instance`.`private_mac_address` AS `private_mac_address`,
+        `vm_instance`.`vm_type` AS `vm_type`,
+        `data_center`.`id` AS `data_center_id`,
+        `data_center`.`uuid` AS `data_center_uuid`,
+        `data_center`.`name` AS `data_center_name`,
+        `data_center`.`is_security_group_enabled` AS `security_group_enabled`,
+        `data_center`.`networktype` AS `data_center_type`,
+        `host`.`id` AS `host_id`,
+        `host`.`uuid` AS `host_uuid`,
+        `host`.`name` AS `host_name`,
+        `vm_template`.`id` AS `template_id`,
+        `vm_template`.`uuid` AS `template_uuid`,
+        `vm_template`.`name` AS `template_name`,
+        `vm_template`.`display_text` AS `template_display_text`,
+        `vm_template`.`enable_password` AS `password_enabled`,
+        `iso`.`id` AS `iso_id`,
+        `iso`.`uuid` AS `iso_uuid`,
+        `iso`.`name` AS `iso_name`,
+        `iso`.`display_text` AS `iso_display_text`,
+        `service_offering`.`id` AS `service_offering_id`,
+        `service_offering`.`uuid` AS `service_offering_uuid`,
+        `disk_offering`.`uuid` AS `disk_offering_uuid`,
+        `disk_offering`.`id` AS `disk_offering_id`,
+        (CASE
+            WHEN ISNULL(`service_offering`.`cpu`) THEN `custom_cpu`.`value`
+            ELSE `service_offering`.`cpu`
+        END) AS `cpu`,
+        (CASE
+            WHEN ISNULL(`service_offering`.`speed`) THEN `custom_speed`.`value`
+            ELSE `service_offering`.`speed`
+        END) AS `speed`,
+        (CASE
+            WHEN ISNULL(`service_offering`.`ram_size`) THEN `custom_ram_size`.`value`
+            ELSE `service_offering`.`ram_size`
+        END) AS `ram_size`,
+        `backup_offering`.`uuid` AS `backup_offering_uuid`,
+        `backup_offering`.`id` AS `backup_offering_id`,
+        `service_offering`.`name` AS `service_offering_name`,
+        `disk_offering`.`name` AS `disk_offering_name`,
+        `backup_offering`.`name` AS `backup_offering_name`,
+        `storage_pool`.`id` AS `pool_id`,
+        `storage_pool`.`uuid` AS `pool_uuid`,
+        `storage_pool`.`pool_type` AS `pool_type`,
+        `volumes`.`id` AS `volume_id`,
+        `volumes`.`uuid` AS `volume_uuid`,
+        `volumes`.`device_id` AS `volume_device_id`,
+        `volumes`.`volume_type` AS `volume_type`,
+        `security_group`.`id` AS `security_group_id`,
+        `security_group`.`uuid` AS `security_group_uuid`,
+        `security_group`.`name` AS `security_group_name`,
+        `security_group`.`description` AS `security_group_description`,
+        `nics`.`id` AS `nic_id`,
+        `nics`.`uuid` AS `nic_uuid`,
+        `nics`.`network_id` AS `network_id`,
+        `nics`.`ip4_address` AS `ip_address`,
+        `nics`.`ip6_address` AS `ip6_address`,
+        `nics`.`ip6_gateway` AS `ip6_gateway`,
+        `nics`.`ip6_cidr` AS `ip6_cidr`,
+        `nics`.`default_nic` AS `is_default_nic`,
+        `nics`.`gateway` AS `gateway`,
+        `nics`.`netmask` AS `netmask`,
+        `nics`.`mac_address` AS `mac_address`,
+        `nics`.`broadcast_uri` AS `broadcast_uri`,
+        `nics`.`isolation_uri` AS `isolation_uri`,
+        `vpc`.`id` AS `vpc_id`,
+        `vpc`.`uuid` AS `vpc_uuid`,
+        `networks`.`uuid` AS `network_uuid`,
+        `networks`.`name` AS `network_name`,
+        `networks`.`traffic_type` AS `traffic_type`,
+        `networks`.`guest_type` AS `guest_type`,
+        `user_ip_address`.`id` AS `public_ip_id`,
+        `user_ip_address`.`uuid` AS `public_ip_uuid`,
+        `user_ip_address`.`public_ip_address` AS `public_ip_address`,
+        `ssh_keypairs`.`keypair_name` AS `keypair_name`,
+        `resource_tags`.`id` AS `tag_id`,
+        `resource_tags`.`uuid` AS `tag_uuid`,
+        `resource_tags`.`key` AS `tag_key`,
+        `resource_tags`.`value` AS `tag_value`,
+        `resource_tags`.`domain_id` AS `tag_domain_id`,
+        `domain`.`uuid` AS `tag_domain_uuid`,
+        `domain`.`name` AS `tag_domain_name`,
+        `resource_tags`.`account_id` AS `tag_account_id`,
+        `account`.`account_name` AS `tag_account_name`,
+        `resource_tags`.`resource_id` AS `tag_resource_id`,
+        `resource_tags`.`resource_uuid` AS `tag_resource_uuid`,
+        `resource_tags`.`resource_type` AS `tag_resource_type`,
+        `resource_tags`.`customer` AS `tag_customer`,
+        `async_job`.`id` AS `job_id`,
+        `async_job`.`uuid` AS `job_uuid`,
+        `async_job`.`job_status` AS `job_status`,
+        `async_job`.`account_id` AS `job_account_id`,
+        `affinity_group`.`id` AS `affinity_group_id`,
+        `affinity_group`.`uuid` AS `affinity_group_uuid`,
+        `affinity_group`.`name` AS `affinity_group_name`,
+        `affinity_group`.`description` AS `affinity_group_description`,
+        `vm_instance`.`dynamically_scalable` AS `dynamically_scalable`
+    FROM
+        (((((((((((((((((((((((((((((((((`user_vm`
+        JOIN `vm_instance` ON (((`vm_instance`.`id` = `user_vm`.`id`)
+            AND ISNULL(`vm_instance`.`removed`))))
+        JOIN `account` ON ((`vm_instance`.`account_id` = `account`.`id`)))
+        JOIN `domain` ON ((`vm_instance`.`domain_id` = `domain`.`id`)))
+        LEFT JOIN `guest_os` ON ((`vm_instance`.`guest_os_id` = `guest_os`.`id`)))
+        LEFT JOIN `host_pod_ref` ON ((`vm_instance`.`pod_id` = `host_pod_ref`.`id`)))
+        LEFT JOIN `projects` ON ((`projects`.`project_account_id` = `account`.`id`)))
+        LEFT JOIN `instance_group_vm_map` ON ((`vm_instance`.`id` = `instance_group_vm_map`.`instance_id`)))
+        LEFT JOIN `instance_group` ON ((`instance_group_vm_map`.`group_id` = `instance_group`.`id`)))
+        LEFT JOIN `data_center` ON ((`vm_instance`.`data_center_id` = `data_center`.`id`)))
+        LEFT JOIN `host` ON ((`vm_instance`.`host_id` = `host`.`id`)))
+        LEFT JOIN `vm_template` ON ((`vm_instance`.`vm_template_id` = `vm_template`.`id`)))
+        LEFT JOIN `vm_template` `iso` ON ((`iso`.`id` = `user_vm`.`iso_id`)))
+        LEFT JOIN `volumes` ON ((`vm_instance`.`id` = `volumes`.`instance_id`)))
+        LEFT JOIN `service_offering` ON ((`vm_instance`.`service_offering_id` = `service_offering`.`id`)))
+        LEFT JOIN `disk_offering` `svc_disk_offering` ON ((`volumes`.`disk_offering_id` = `svc_disk_offering`.`id`)))
+        LEFT JOIN `disk_offering` ON ((`volumes`.`disk_offering_id` = `disk_offering`.`id`)))
+        LEFT JOIN `backup_offering` ON ((`vm_instance`.`backup_offering_id` = `backup_offering`.`id`)))
+        LEFT JOIN `storage_pool` ON ((`volumes`.`pool_id` = `storage_pool`.`id`)))
+        LEFT JOIN `security_group_vm_map` ON ((`vm_instance`.`id` = `security_group_vm_map`.`instance_id`)))
+        LEFT JOIN `security_group` ON ((`security_group_vm_map`.`security_group_id` = `security_group`.`id`)))
+        LEFT JOIN `nics` ON (((`vm_instance`.`id` = `nics`.`instance_id`)
+            AND ISNULL(`nics`.`removed`))))
+        LEFT JOIN `networks` ON ((`nics`.`network_id` = `networks`.`id`)))
+        LEFT JOIN `vpc` ON (((`networks`.`vpc_id` = `vpc`.`id`)
+            AND ISNULL(`vpc`.`removed`))))
+        LEFT JOIN `user_ip_address` ON ((`user_ip_address`.`vm_id` = `vm_instance`.`id`)))
+        LEFT JOIN `user_vm_details` `ssh_details` ON (((`ssh_details`.`vm_id` = `vm_instance`.`id`)
+            AND (`ssh_details`.`name` = 'SSH.PublicKey'))))
+        LEFT JOIN `ssh_keypairs` ON (((`ssh_keypairs`.`public_key` = `ssh_details`.`value`)
+            AND (`ssh_keypairs`.`account_id` = `account`.`id`))))
+        LEFT JOIN `resource_tags` ON (((`resource_tags`.`resource_id` = `vm_instance`.`id`)
+            AND (`resource_tags`.`resource_type` = 'UserVm'))))
+        LEFT JOIN `async_job` ON (((`async_job`.`instance_id` = `vm_instance`.`id`)
+            AND (`async_job`.`instance_type` = 'VirtualMachine')
+            AND (`async_job`.`job_status` = 0))))
+        LEFT JOIN `affinity_group_vm_map` ON ((`vm_instance`.`id` = `affinity_group_vm_map`.`instance_id`)))
+        LEFT JOIN `affinity_group` ON ((`affinity_group_vm_map`.`affinity_group_id` = `affinity_group`.`id`)))
+        LEFT JOIN `user_vm_details` `custom_cpu` ON (((`custom_cpu`.`vm_id` = `vm_instance`.`id`)
+            AND (`custom_cpu`.`name` = 'CpuNumber'))))
+        LEFT JOIN `user_vm_details` `custom_speed` ON (((`custom_speed`.`vm_id` = `vm_instance`.`id`)
+            AND (`custom_speed`.`name` = 'CpuSpeed'))))
+        LEFT JOIN `user_vm_details` `custom_ram_size` ON (((`custom_ram_size`.`vm_id` = `vm_instance`.`id`)
+            AND (`custom_ram_size`.`name` = 'memory'))));
+
+DROP VIEW IF EXISTS `cloud`.`disk_offering_view`;
+CREATE VIEW `cloud`.`disk_offering_view` AS
+    SELECT
+        `disk_offering`.`id` AS `id`,
         `disk_offering`.`uuid` AS `uuid`,
         `disk_offering`.`name` AS `name`,
         `disk_offering`.`display_text` AS `display_text`,
         `disk_offering`.`provisioning_type` AS `provisioning_type`,
+        `disk_offering`.`disk_size` AS `disk_size`,
+        `disk_offering`.`min_iops` AS `min_iops`,
+        `disk_offering`.`max_iops` AS `max_iops`,
         `disk_offering`.`created` AS `created`,
         `disk_offering`.`tags` AS `tags`,
+        `disk_offering`.`customized` AS `customized`,
+        `disk_offering`.`customized_iops` AS `customized_iops`,
         `disk_offering`.`removed` AS `removed`,
         `disk_offering`.`use_local_storage` AS `use_local_storage`,
         `disk_offering`.`system_use` AS `system_use`,
+        `disk_offering`.`hv_ss_reserve` AS `hv_ss_reserve`,
+        `disk_offering`.`bytes_read_rate` AS `bytes_read_rate`,
+        `disk_offering`.`bytes_read_rate_max` AS `bytes_read_rate_max`,
+        `disk_offering`.`bytes_read_rate_max_length` AS `bytes_read_rate_max_length`,
+        `disk_offering`.`bytes_write_rate` AS `bytes_write_rate`,
+        `disk_offering`.`bytes_write_rate_max` AS `bytes_write_rate_max`,
+        `disk_offering`.`bytes_write_rate_max_length` AS `bytes_write_rate_max_length`,
+        `disk_offering`.`iops_read_rate` AS `iops_read_rate`,
+        `disk_offering`.`iops_read_rate_max` AS `iops_read_rate_max`,
+        `disk_offering`.`iops_read_rate_max_length` AS `iops_read_rate_max_length`,
+        `disk_offering`.`iops_write_rate` AS `iops_write_rate`,
+        `disk_offering`.`iops_write_rate_max` AS `iops_write_rate_max`,
+        `disk_offering`.`iops_write_rate_max_length` AS `iops_write_rate_max_length`,
+        `disk_offering`.`cache_mode` AS `cache_mode`,
+        `disk_offering`.`sort_key` AS `sort_key`,
+        `disk_offering`.`compute_only` AS `compute_only`,
+        `disk_offering`.`display_offering` AS `display_offering`,
+        `disk_offering`.`state` AS `state`,
+        `disk_offering`.`disk_size_strictness` AS `disk_size_strictness`,
+        `vsphere_storage_policy`.`value` AS `vsphere_storage_policy`,
+        GROUP_CONCAT(DISTINCT(domain.id)) AS domain_id,
+        GROUP_CONCAT(DISTINCT(domain.uuid)) AS domain_uuid,
+        GROUP_CONCAT(DISTINCT(domain.name)) AS domain_name,
+        GROUP_CONCAT(DISTINCT(domain.path)) AS domain_path,
+        GROUP_CONCAT(DISTINCT(zone.id)) AS zone_id,
+        GROUP_CONCAT(DISTINCT(zone.uuid)) AS zone_uuid,
+        GROUP_CONCAT(DISTINCT(zone.name)) AS zone_name
+    FROM
+        `cloud`.`disk_offering`
+            LEFT JOIN
+        `cloud`.`disk_offering_details` AS `domain_details` ON `domain_details`.`offering_id` = `disk_offering`.`id` AND `domain_details`.`name`='domainid'
+            LEFT JOIN
+        `cloud`.`domain` AS `domain` ON FIND_IN_SET(`domain`.`id`, `domain_details`.`value`)
+            LEFT JOIN
+        `cloud`.`disk_offering_details` AS `zone_details` ON `zone_details`.`offering_id` = `disk_offering`.`id` AND `zone_details`.`name`='zoneid'
+            LEFT JOIN
+        `cloud`.`data_center` AS `zone` ON FIND_IN_SET(`zone`.`id`, `zone_details`.`value`)
+			LEFT JOIN
+		`cloud`.`disk_offering_details` AS `vsphere_storage_policy` ON `vsphere_storage_policy`.`offering_id` = `disk_offering`.`id`
+				AND `vsphere_storage_policy`.`name` = 'storagepolicy'
+    WHERE
+        `disk_offering`.`state`='Active'
+    GROUP BY
+        `disk_offering`.`id`;
+
+-- Adding dynamic scalable flag for service offering table
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';

Review comment:
       @harikrishna-patnala is this new column relavent / necessary for decoupling compute & disk offering?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864926232


   <b>Trillian test result (tid-1020)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 48456 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1020-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_accounts.py
   Intermittent failure detected: /marvin/tests/smoke/test_domain_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
   Smoke tests completed. 80 look OK, 8 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_service_offering_hierarchy | `Failure` | 0.02 | test_accounts.py
   test_01_service_offering_siblings | `Failure` | 0.02 | test_accounts.py
   test_01_create_domain_service_offering | `Error` | 0.08 | test_domain_service_offerings.py
   test_02_edit_domain_service_offering | `Error` | 0.06 | test_domain_service_offerings.py
   test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 | `Failure` | 496.71 | test_internal_lb.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 369.17 | test_privategw_acl.py
   test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true | `Failure` | 340.16 | test_routers_network_ops.py
   test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false | `Failure` | 337.95 | test_routers_network_ops.py
   test_07_resize_fail | `Failure` | 122.81 | test_volumes.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 532.97 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 545.35 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 486.30 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 486.31 | test_vpc_redundant.py
   test_01_vpc_site2site_vpn_multiple_options | `Failure` | 462.84 | test_vpc_vpn.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907242678


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895176627


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895157908


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893343108


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685682021



##########
File path: api/src/main/java/com/cloud/storage/VolumeApiService.java
##########
@@ -22,6 +22,7 @@
 import java.util.Map;
 
 import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
+import org.apache.cloudstack.api.command.user.volume.ChangeOfferingForVolume;

Review comment:
       Is this command class (to change offering)? If so, update class name to *Cmd notation, to keep same as other classes.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r697353145



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/volume/ChangeOfferingForVolumeCmd.java
##########
@@ -0,0 +1,141 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.volume;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.offering.DiskOffering;
+import com.cloud.storage.Volume;
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+@APICommand(name = ChangeOfferingForVolumeCmd.APINAME,
+        description = "Change disk offering of the volume and also an option to auto migrate if required to apply the new disk offering",
+        responseObject = VolumeResponse.class,
+        requestHasSensitiveInfo = false,
+        responseHasSensitiveInfo = false,
+        authorized = { RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User},
+        since = "4.16")
+public class ChangeOfferingForVolumeCmd extends BaseAsyncCmd implements UserCmd {
+
+    public static final String APINAME = "changeOfferingForVolume";
+    public static final Logger s_logger = Logger.getLogger(ChangeOfferingForVolumeCmd.class.getName());
+    private static final String s_name = "changeofferingforvolumeresponse";

Review comment:
       Nit - we want to look at more modern API implementation which were APINAME + response string (see Roles related API for example).

##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/volume/ChangeOfferingForVolumeCmd.java
##########
@@ -0,0 +1,141 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.volume;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.offering.DiskOffering;
+import com.cloud.storage.Volume;
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+@APICommand(name = ChangeOfferingForVolumeCmd.APINAME,
+        description = "Change disk offering of the volume and also an option to auto migrate if required to apply the new disk offering",
+        responseObject = VolumeResponse.class,
+        requestHasSensitiveInfo = false,
+        responseHasSensitiveInfo = false,
+        authorized = { RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User},
+        since = "4.16")
+public class ChangeOfferingForVolumeCmd extends BaseAsyncCmd implements UserCmd {
+
+    public static final String APINAME = "changeOfferingForVolume";
+    public static final Logger s_logger = Logger.getLogger(ChangeOfferingForVolumeCmd.class.getName());
+    private static final String s_name = "changeofferingforvolumeresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name = ApiConstants.ID, entityType = VolumeResponse.class, required = true, type = CommandType.UUID, description = "the ID of the volume")
+    private Long id;
+
+    @Parameter(name = ApiConstants.DISK_OFFERING_ID,
+            entityType = DiskOfferingResponse.class,
+            type = CommandType.UUID,
+            required = true,
+            description = "new disk offering id")
+    private Long newDiskOfferingId;
+
+    @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 for the custom disk offering")
+    private Long minIops;
+
+    @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 " +
+            "with new disk offering whenever migration is required to apply the offering")
+    private Boolean autoMigrate;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public Long getNewDiskOfferingId() {
+        return newDiskOfferingId;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public Long getMinIops() {
+        return minIops;
+    }
+
+    public Long getMaxIops() {
+        return maxIops;
+    }
+
+    public boolean getAutoMigrate() {
+        return autoMigrate == null ? true : autoMigrate;

Review comment:
       Should the default be true or false (for ex. when option not provided?)

##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/volume/ChangeOfferingForVolumeCmd.java
##########
@@ -0,0 +1,141 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.volume;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.offering.DiskOffering;
+import com.cloud.storage.Volume;
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+@APICommand(name = ChangeOfferingForVolumeCmd.APINAME,
+        description = "Change disk offering of the volume and also an option to auto migrate if required to apply the new disk offering",
+        responseObject = VolumeResponse.class,
+        requestHasSensitiveInfo = false,
+        responseHasSensitiveInfo = false,
+        authorized = { RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User},
+        since = "4.16")
+public class ChangeOfferingForVolumeCmd extends BaseAsyncCmd implements UserCmd {
+

Review comment:
       nit - new line

##########
File path: test/integration/smoke/test_service_offerings.py
##########
@@ -614,6 +615,204 @@ def test_04_change_offering_small(self):
         )
         return
 
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_05_disk_offering_strictness_true(self):
+        """Test to see change service offering is not possible when disk offering strictness is set to true
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is true
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering
+        # 4. Try change service offering for VM and it will fail since disk offering strictness is true (not allowed to change the disk offering)
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue',
+            'cpuspeed': 512,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue)
+
+        self.virtual_machine_with_diskoffering_strictness_true = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.serviceOfferingWithDiskOfferingStrictnessTrue.id,
+            mode=self.services["mode"]
+        )
+
+        try:
+            self.virtual_machine_with_diskoffering_strictness_true.stop(self.apiclient)
+
+            timeout = self.services["timeout"]
+
+            while True:
+                time.sleep(self.services["sleep"])
+
+                # Ensure that VM is in stopped state
+                list_vm_response = list_virtual_machines(
+                    self.apiclient,
+                    id=self.virtual_machine_with_diskoffering_strictness_true.id
+                )
+
+                if isinstance(list_vm_response, list):
+                    vm = list_vm_response[0]
+                    if vm.state == 'Stopped':
+                        self.debug("VM state: %s" % vm.state)
+                        break
+
+                if timeout == 0:
+                    raise Exception(
+                        "Failed to stop VM (ID: %s) in change service offering" % vm.id)
+
+                timeout = timeout - 1
+        except Exception as e:
+            self.fail("Failed to stop VM: %s" % e)
+
+        offering_data = {

Review comment:
       self.offering_data?

##########
File path: test/integration/smoke/test_service_offerings.py
##########
@@ -614,6 +615,204 @@ def test_04_change_offering_small(self):
         )
         return
 
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_05_disk_offering_strictness_true(self):
+        """Test to see change service offering is not possible when disk offering strictness is set to true
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is true
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering
+        # 4. Try change service offering for VM and it will fail since disk offering strictness is true (not allowed to change the disk offering)
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+        offering_data = {

Review comment:
       You might want to say - self.offering_data?

##########
File path: test/integration/smoke/test_service_offerings.py
##########
@@ -614,6 +615,204 @@ def test_04_change_offering_small(self):
         )
         return
 
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_05_disk_offering_strictness_true(self):
+        """Test to see change service offering is not possible when disk offering strictness is set to true
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is true
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering
+        # 4. Try change service offering for VM and it will fail since disk offering strictness is true (not allowed to change the disk offering)
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue',
+            'cpuspeed': 512,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue)
+
+        self.virtual_machine_with_diskoffering_strictness_true = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.serviceOfferingWithDiskOfferingStrictnessTrue.id,
+            mode=self.services["mode"]
+        )
+
+        try:
+            self.virtual_machine_with_diskoffering_strictness_true.stop(self.apiclient)
+
+            timeout = self.services["timeout"]
+
+            while True:
+                time.sleep(self.services["sleep"])
+
+                # Ensure that VM is in stopped state
+                list_vm_response = list_virtual_machines(
+                    self.apiclient,
+                    id=self.virtual_machine_with_diskoffering_strictness_true.id
+                )
+
+                if isinstance(list_vm_response, list):
+                    vm = list_vm_response[0]
+                    if vm.state == 'Stopped':
+                        self.debug("VM state: %s" % vm.state)
+                        break
+
+                if timeout == 0:
+                    raise Exception(
+                        "Failed to stop VM (ID: %s) in change service offering" % vm.id)
+
+                timeout = timeout - 1
+        except Exception as e:
+            self.fail("Failed to stop VM: %s" % e)
+
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue2',
+            'cpuspeed': 1000,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue2',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue2 = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue2)
+        cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd()
+        cmd.id = self.virtual_machine_with_diskoffering_strictness_true.id
+        cmd.serviceofferingid = self.serviceOfferingWithDiskOfferingStrictnessTrue2.id
+
+        with self.assertRaises(Exception) as e:
+            self.apiclient.changeServiceForVirtualMachine(cmd)
+            self.debug("Upgrade VM with new service offering having different disk offering operation failed as expected with exception: %s" %
+                       e.exception)
+        return
+
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_06_disk_offering_strictness_false(self):
+        """Test to see change service offering is possible when disk offering strictness is set to false
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is false
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering and disk offering strictness is false
+        # 4. Try change service offering for VM should succeed
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessFalse',
+            'cpuspeed': 512,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessFalse',
+            'memory': 1024,
+            'diskofferingstrictness': False
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessFalse = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessFalse)
+
+        self.virtual_machine_with_diskoffering_strictness_false = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.serviceOfferingWithDiskOfferingStrictnessFalse.id,
+            mode=self.services["mode"]
+        )
+
+        try:
+            self.virtual_machine_with_diskoffering_strictness_false.stop(self.apiclient)
+
+            timeout = self.services["timeout"]
+
+            while True:
+                time.sleep(self.services["sleep"])
+
+                # Ensure that VM is in stopped state
+                list_vm_response = list_virtual_machines(
+                    self.apiclient,
+                    id=self.virtual_machine_with_diskoffering_strictness_false.id
+                )
+
+                if isinstance(list_vm_response, list):
+                    vm = list_vm_response[0]
+                    if vm.state == 'Stopped':
+                        self.debug("VM state: %s" % vm.state)
+                        break
+
+                if timeout == 0:
+                    raise Exception(
+                        "Failed to stop VM (ID: %s) in change service offering" % vm.id)
+
+                timeout = timeout - 1
+        except Exception as e:
+            self.fail("Failed to stop VM: %s" % e)
+
+        self.disk_offering2 = DiskOffering.create(
+                                    self.apiclient,
+                                    self.services["disk_offering"],
+                                    )
+        self._cleanup.append(self.disk_offering2)
+        offering_data = {

Review comment:
       self.offering_data (actually ignore this and above if this is highly test-case specific data)

##########
File path: test/integration/smoke/test_service_offerings.py
##########
@@ -614,6 +615,204 @@ def test_04_change_offering_small(self):
         )
         return
 
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_05_disk_offering_strictness_true(self):
+        """Test to see change service offering is not possible when disk offering strictness is set to true
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is true
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering
+        # 4. Try change service offering for VM and it will fail since disk offering strictness is true (not allowed to change the disk offering)
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue',
+            'cpuspeed': 512,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue)
+
+        self.virtual_machine_with_diskoffering_strictness_true = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.serviceOfferingWithDiskOfferingStrictnessTrue.id,
+            mode=self.services["mode"]
+        )
+
+        try:
+            self.virtual_machine_with_diskoffering_strictness_true.stop(self.apiclient)
+
+            timeout = self.services["timeout"]
+
+            while True:
+                time.sleep(self.services["sleep"])
+
+                # Ensure that VM is in stopped state
+                list_vm_response = list_virtual_machines(
+                    self.apiclient,
+                    id=self.virtual_machine_with_diskoffering_strictness_true.id
+                )
+
+                if isinstance(list_vm_response, list):
+                    vm = list_vm_response[0]
+                    if vm.state == 'Stopped':
+                        self.debug("VM state: %s" % vm.state)
+                        break
+
+                if timeout == 0:
+                    raise Exception(
+                        "Failed to stop VM (ID: %s) in change service offering" % vm.id)
+
+                timeout = timeout - 1
+        except Exception as e:
+            self.fail("Failed to stop VM: %s" % e)
+
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue2',
+            'cpuspeed': 1000,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue2',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue2 = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue2)
+        cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd()
+        cmd.id = self.virtual_machine_with_diskoffering_strictness_true.id
+        cmd.serviceofferingid = self.serviceOfferingWithDiskOfferingStrictnessTrue2.id
+
+        with self.assertRaises(Exception) as e:
+            self.apiclient.changeServiceForVirtualMachine(cmd)
+            self.debug("Upgrade VM with new service offering having different disk offering operation failed as expected with exception: %s" %
+                       e.exception)
+        return
+
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_06_disk_offering_strictness_false(self):
+        """Test to see change service offering is possible when disk offering strictness is set to false
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is false
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering and disk offering strictness is false
+        # 4. Try change service offering for VM should succeed
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+
+        offering_data = {

Review comment:
       self.offering_data?

##########
File path: engine/api/src/main/java/org/apache/cloudstack/engine/service/api/OrchestrationService.java
##########
@@ -67,14 +67,15 @@ VirtualMachineEntity createVirtualMachine(@QueryParam("id") String id, @QueryPar
         @QueryParam("compute-tags") List<String> computeTags, @QueryParam("root-disk-tags") List<String> rootDiskTags,
         @QueryParam("network-nic-map") Map<String, List<NicProfile>> networkNicMap, @QueryParam("deploymentplan") DeploymentPlan plan,
         @QueryParam("root-disk-size") Long rootDiskSize, @QueryParam("extra-dhcp-option-map") Map<String, Map<Integer, String>> extraDhcpOptionMap,
-        @QueryParam("datadisktemplate-diskoffering-map") Map<Long, DiskOffering> datadiskTemplateToDiskOfferingMap) throws InsufficientCapacityException;
+        @QueryParam("datadisktemplate-diskoffering-map") Map<Long, DiskOffering> datadiskTemplateToDiskOfferingMap, @QueryParam("disk-offering-id") Long diskOfferingId, @QueryParam("root-disk-offering-id") Long rootDiskOfferingId) throws InsufficientCapacityException;

Review comment:
       I don't think codebase in engine/api is used (the restful api is not maintained/does not run)

##########
File path: server/src/main/java/com/cloud/server/ConfigurationServerImpl.java
##########
@@ -926,16 +926,21 @@ private DiskOfferingVO createDefaultDiskOffering(String name, String description
         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);
-        newDiskOffering = _diskOfferingDao.persistDeafultDiskOffering(newDiskOffering);
+        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.setUniqueName("Cloud.Com-" + name);

Review comment:
       Is this just for default offerings?

##########
File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -1655,19 +1660,6 @@ protected boolean hostCanAccessSPool(Host host, StoragePool pool) {
                 }
             } else {
                 useLocalStorage = diskOffering.isUseLocalStorage();
-
-                // TODO: this is a hacking fix for the problem of deploy
-                // ISO-based VM on local storage
-                // when deploying VM based on ISO, we have a service offering
-                // and an additional disk offering, use-local storage flag is
-                // actually
-                // saved in service offering, override the flag from service
-                // offering when it is a ROOT disk
-                if (!useLocalStorage && vmProfile.getServiceOffering().isUseLocalStorage()) {

Review comment:
       Wont' this case of ISO-based VM cause issue now?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895590556


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907140471


   <b>Trillian Build Failed (tid-1801)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-904489861


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-899223436


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 879


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897037346


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897036520


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907127789


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1037


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-917898785


   @borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1001886456


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020879228


   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699026784



##########
File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
##########
@@ -3453,6 +3491,7 @@ public long getMemoryOrCpuCapacityByHost(final Long hostId, final short capacity
         cmdList.add(IssueOutOfBandManagementPowerActionCmd.class);
         cmdList.add(ChangeOutOfBandManagementPasswordCmd.class);
         cmdList.add(GetUserKeysCmd.class);
+        cmdList.add(ChangeOfferingForVolumeCmd.class);

Review comment:
       Better to move this to the volume cmds added above.
   
   https://github.com/apache/cloudstack/blob/3ddcf858767ff5f79986457cbbac4c856b73e0bd/server/src/main/java/com/cloud/server/ManagementServerImpl.java#L3260-L3271
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-911770056


   <b>Trillian test result (tid-1926)</b>
   Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 40278 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1926-vmware-65u2.zip
   Smoke tests completed. 88 look OK, 1 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_offline_migrate_VM_and_root_volume | `Error` | 96.96 | test_vm_life_cycle.py
   test_03_live_migrate_VM_with_two_data_disks | `Error` | 58.35 | test_vm_life_cycle.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909118245


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-914875876


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1153


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-914854703


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-976151815


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-980045971


   <b>Trillian test result (tid-2590)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 31201 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t2590-xenserver-71.zip
   Smoke tests completed. 91 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-980161555


   <b>Trillian test result (tid-2591)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 38438 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t2591-kvm-centos7.zip
   Smoke tests completed. 90 look OK, 1 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_08_upgrade_kubernetes_ha_cluster | `Error` | 3759.58 | test_kubernetes_clusters.py
   test_09_delete_kubernetes_ha_cluster | `Failure` | 0.07 | test_kubernetes_clusters.py
   ContextSuite context=TestKubernetesCluster>:teardown | `Error` | 73.47 | test_kubernetes_clusters.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r756720190



##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2857,7 +2857,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, true);
+        DiskOfferingVO diskOffering = new DiskOfferingVO(name, displayText, typedProvisioningType, false, tags, false, localStorageRequired, false);

Review comment:
       This method createDiskOfferingInternal is used only to create disk offering entry for compute only service offering. In this case customized is always false since compute offering creation does not allow creating customized disk size disk offering.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-997544301


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala closed pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala closed pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909123054


   <b>Trillian Build Failed (tid-1856)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-904323536






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864938606


   <b>Trillian test result (tid-1019)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 50472 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1019-xenserver-71.zip
   Intermittent failure detected: /marvin/tests/smoke/test_accounts.py
   Intermittent failure detected: /marvin/tests/smoke/test_domain_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_router_nics.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
   Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
   Smoke tests completed. 83 look OK, 5 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_service_offering_hierarchy | `Failure` | 0.02 | test_accounts.py
   test_01_service_offering_siblings | `Failure` | 0.02 | test_accounts.py
   test_01_create_domain_service_offering | `Error` | 0.08 | test_domain_service_offerings.py
   test_02_edit_domain_service_offering | `Error` | 0.06 | test_domain_service_offerings.py
   test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true | `Error` | 39.91 | test_routers_network_ops.py
   test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false | `Failure` | 362.68 | test_routers_network_ops.py
   test_07_resize_fail | `Failure` | 677.33 | test_volumes.py
   test_07_resize_fail | `Error` | 677.33 | test_volumes.py
   test_08_resize_volume | `Error` | 1.07 | test_volumes.py
   test_10_list_volumes | `Failure` | 373.21 | test_volumes.py
   test_11_attach_volume_with_unstarted_vm | `Error` | 2.19 | test_volumes.py
   ContextSuite context=TestVolumes>:teardown | `Error` | 15.61 | test_volumes.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 650.79 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 681.79 | test_vpc_redundant.py
   test_04_rvpc_network_garbage_collector_nics | `Failure` | 406.85 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 574.85 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 574.87 | test_vpc_redundant.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909119019






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-894031118


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864469468


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-904335706


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 988


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-905660283


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685788356



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
##########
@@ -185,10 +185,14 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String
 
         ServiceOfferingVO computeOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId());
 
-        rootDiskOfferingInfo.setDiskOffering(computeOffering);
+        DiskOfferingVO rootDiskOffering = _diskOfferingDao.findById(rootDiskOfferingId);
+        if (rootDiskOffering == null) {
+            throw new InvalidParameterValueException("Unable to find disk offering " + rootDiskOfferingId);

Review comment:
       ```suggestion
               throw new InvalidParameterValueException("Unable to find root disk offering " + rootDiskOfferingId);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r655398004



##########
File path: server/src/main/java/com/cloud/server/ConfigurationServerImpl.java
##########
@@ -926,16 +926,21 @@ private DiskOfferingVO createDefaultDiskOffering(String name, String description
         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);
-        newDiskOffering = _diskOfferingDao.persistDeafultDiskOffering(newDiskOffering);
+        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.setUniqueName("Cloud.Com-" + name);

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




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897469503






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895576580






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893315923


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895173647


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 811


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907138042


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-908571675


   @harikrishna-patnala a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-912280781


   Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 1122


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-908570833


   @blueorangutan test centos7 xenserver-71


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r658831956



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41510to41600.sql
##########
@@ -19,21 +19,293 @@
 -- Schema upgrade from 4.15.1.0 to 4.16.0.0
 --;
 
--- Adding dynamic scalable flag for service offering table
-ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';
-DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
-CREATE VIEW `cloud`.`service_offering_view` AS
+
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `name` varchar(255);
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `display_text` varchar(4096);
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `unique_name` varchar(32) COMMENT 'unique name for system offerings';

Review comment:
       same here, add DEFAULT NULL




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909097256


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1076


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-914962151


   <b>Trillian Build Failed (tid-1985)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r687088993



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
##########
@@ -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) throws InsufficientCapacityException {
+        Long rootDiskSize, Map<String, Map<Integer, String>> extraDhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Long diskOfferingId, Long rootDiskOfferingId) throws InsufficientCapacityException {

Review comment:
       yes it is for data disk, updated it as suggested




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-908592362


   <b>Trillian Build Failed (tid-1840)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907170492


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1041


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd closed pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
rhtyd closed pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907560331


   <b>Trillian test result (tid-1813)</b>
   Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 44192 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1813-vmware-65u2.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Smoke tests completed. 88 look OK, 1 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_offline_migrate_VM_and_root_volume | `Error` | 93.88 | test_vm_life_cycle.py
   test_03_live_migrate_VM_with_two_data_disks | `Error` | 59.50 | test_vm_life_cycle.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020879228


   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1022360079


   @harikrishna-patnala a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-996516457


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-997865406


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1960


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-997703849


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1004274009


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1002241106


   @sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r754983508



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
##########
@@ -70,6 +70,16 @@
     @Parameter(name = ApiConstants.DETAILS, type = BaseCmd.CommandType.MAP, description = "name value pairs of custom parameters for cpu,memory and cpunumber. example details[i].name=value")
     private Map<String, String> details;
 
+    @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 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 root volume " +

Review comment:
       add "since" attribute to these parameters if needed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897068539


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897064282


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 846


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala closed pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala closed pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-894639107


   <b>Trillian test result (tid-1508)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 97918 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1508-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_accounts.py
   Intermittent failure detected: /marvin/tests/smoke/test_affinity_groups_projects.py
   Intermittent failure detected: /marvin/tests/smoke/test_async_job.py
   Intermittent failure detected: /marvin/tests/smoke/test_deploy_virtio_scsi_vm.py
   Intermittent failure detected: /marvin/tests/smoke/test_deploy_vm_iso.py
   Intermittent failure detected: /marvin/tests/smoke/test_deploy_vms_with_varied_deploymentplanners.py
   Intermittent failure detected: /marvin/tests/smoke/test_deploy_vm_with_userdata.py
   Intermittent failure detected: /marvin/tests/smoke/test_diagnostics.py
   Intermittent failure detected: /marvin/tests/smoke/test_domain_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
   Intermittent failure detected: /marvin/tests/smoke/test_iso.py
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_supported_versions.py
   Intermittent failure detected: /marvin/tests/smoke/test_list_ids_parameter.py
   Intermittent failure detected: /marvin/tests/smoke/test_loadbalance.py
   Intermittent failure detected: /marvin/tests/smoke/test_metrics_api.py
   Intermittent failure detected: /marvin/tests/smoke/test_multipleips_per_nic.py
   Intermittent failure detected: /marvin/tests/smoke/test_nested_virtualization.py
   Intermittent failure detected: /marvin/tests/smoke/test_network_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_network.py
   Intermittent failure detected: /marvin/tests/smoke/test_password_server.py
   Intermittent failure detected: /marvin/tests/smoke/test_portforwardingrules.py
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_projects.py
   Intermittent failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
   Intermittent failure detected: /marvin/tests/smoke/test_resource_accounting.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dhcphosts.py
   Intermittent failure detected: /marvin/tests/smoke/test_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_templates.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_snapshots.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
   Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
   Smoke tests completed. 56 look OK, 33 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestAccounts>:setup | `Error` | 0.00 | test_accounts.py
   ContextSuite context=TestAddVmToSubDomain>:setup | `Error` | 0.00 | test_accounts.py
   test_DeleteDomain | `Error` | 4.44 | test_accounts.py
   test_forceDeleteDomain | `Failure` | 6.27 | test_accounts.py
   ContextSuite context=TestRemoveUserFromAccount>:setup | `Error` | 8.38 | test_accounts.py
   test_01_service_offering_hierarchy | `Failure` | 0.02 | test_accounts.py
   test_01_service_offering_siblings | `Failure` | 0.02 | test_accounts.py
   ContextSuite context=TestDeployVmWithAffinityGroup>:setup | `Error` | 0.00 | test_affinity_groups_projects.py
   ContextSuite context=TestInternalLb>:setup | `Error` | 0.00 | test_internal_lb.py
   ContextSuite context=TestAsyncJob>:setup | `Error` | 0.00 | test_async_job.py
   test_01_create_iso_with_checksum_sha1 | `Error` | 68.44 | test_iso.py
   test_01_create_iso_with_checksum_sha1 | `Error` | 68.44 | test_iso.py
   test_02_create_iso_with_checksum_sha256 | `Error` | 66.40 | test_iso.py
   test_02_create_iso_with_checksum_sha256 | `Error` | 66.40 | test_iso.py
   test_03_create_iso_with_checksum_md5 | `Error` | 66.41 | test_iso.py
   test_04_create_iso_with_no_checksum | `Error` | 66.39 | test_iso.py
   test_01_create_iso | `Failure` | 1562.23 | test_iso.py
   ContextSuite context=TestISO>:setup | `Error` | 3103.38 | test_iso.py
   test_01_create_domain_service_offering | `Error` | 0.07 | test_domain_service_offerings.py
   ContextSuite context=TestDomainsServiceOfferings>:setup | `Error` | 1600.58 | test_domain_service_offerings.py
   ContextSuite context=TestLoadBalance>:setup | `Error` | 0.00 | test_loadbalance.py
   ContextSuite context=TestDeployVirtioSCSIVM>:setup | `Error` | 0.00 | test_deploy_virtio_scsi_vm.py
   ContextSuite context=TestDeployVMFromISO>:setup | `Error` | 0.00 | test_deploy_vm_iso.py
   test_list_clusters_metrics | `Error` | 1516.40 | test_metrics_api.py
   test_list_vms_metrics | `Error` | 0.15 | test_metrics_api.py
   ContextSuite context=TestDeployVmWithVariedPlanners>:setup | `Error` | 0.00 | test_deploy_vms_with_varied_deploymentplanners.py
   ContextSuite context=TestDeployVmWithUserData>:setup | `Error` | 0.00 | test_deploy_vm_with_userdata.py
   ContextSuite context=TestRemoteDiagnostics>:setup | `Error` | 0.00 | test_diagnostics.py
   ContextSuite context=TestNetworkACL>:setup | `Error` | 0.00 | test_network_acl.py
   test_delete_account | `Error` | 0.43 | test_network.py
   test_delete_network_while_vm_on_it | `Error` | 1.09 | test_network.py
   test_deploy_vm_l2network | `Error` | 1.22 | test_network.py
   test_l2network_restart | `Error` | 2.19 | test_network.py
   ContextSuite context=TestPortForwarding>:setup | `Error` | 3.34 | test_network.py
   ContextSuite context=TestPublicIP>:setup | `Error` | 0.97 | test_network.py
   test_reboot_router | `Failure` | 0.04 | test_network.py
   test_releaseIP | `Error` | 0.41 | test_network.py
   ContextSuite context=TestRouterRules>:setup | `Error` | 0.46 | test_network.py
   test_01_invalid_upgrade_kubernetes_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_02_deploy_and_upgrade_kubernetes_cluster | `Failure` | 0.00 | test_kubernetes_clusters.py
   test_03_deploy_and_scale_kubernetes_cluster | `Failure` | 0.00 | test_kubernetes_clusters.py
   test_04_basic_lifecycle_kubernetes_cluster | `Failure` | 0.00 | test_kubernetes_clusters.py
   test_05_delete_kubernetes_cluster | `Failure` | 0.00 | test_kubernetes_clusters.py
   test_06_deploy_invalid_kubernetes_ha_cluster | `Failure` | 0.00 | test_kubernetes_clusters.py
   test_07_deploy_kubernetes_ha_cluster | `Failure` | 0.00 | test_kubernetes_clusters.py
   test_08_deploy_and_upgrade_kubernetes_ha_cluster | `Failure` | 0.00 | test_kubernetes_clusters.py
   test_09_delete_kubernetes_ha_cluster | `Failure` | 0.00 | test_kubernetes_clusters.py
   test_01_add_delete_kubernetes_supported_version | `Error` | 1801.94 | test_kubernetes_supported_versions.py
   ContextSuite context=TestListIdsParams>:setup | `Error` | 0.00 | test_list_ids_parameter.py
   test_nic_secondaryip_add_remove | `Error` | 1603.82 | test_multipleips_per_nic.py
   ContextSuite context=TestNestedVirtualization>:setup | `Error` | 0.00 | test_nested_virtualization.py
   ContextSuite context=TestIsolatedNetworksPasswdServer>:setup | `Error` | 0.00 | test_password_server.py
   test_01_redundant_vpc_site2site_vpn | `Failure` | 405.84 | test_vpc_vpn.py
   ContextSuite context=TestPortForwardingRules>:setup | `Error` | 0.00 | test_portforwardingrules.py
   ContextSuite context=TestPrivateGwACL>:setup | `Error` | 0.00 | test_privategw_acl.py
   test_09_project_suspend | `Error` | 1.07 | test_projects.py
   test_10_project_activation | `Error` | 1.06 | test_projects.py
   ContextSuite context=TestResetVmOnReboot>:setup | `Error` | 0.00 | test_reset_vm_on_reboot.py
   ContextSuite context=TestRAMCPUResourceAccounting>:setup | `Error` | 0.00 | test_resource_accounting.py
   ContextSuite context=TestRouterDHCPHosts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDHCPOpts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   test_02_edit_service_offering | `Error` | 0.02 | test_service_offerings.py
   test_04_extract_template | `Failure` | 16.09 | test_templates.py
   test_06_download_detached_volume | `Failure` | 306.50 | test_volumes.py
   test_07_resize_fail | `Failure` | 127.54 | test_volumes.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 650.86 | test_vpc_redundant.py
   test_02_redundant_VPC_default_routes | `Failure` | 338.90 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 505.21 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 528.02 | test_vpc_redundant.py
   test_disable_oobm_ha_state_ineligible | `Error` | 1518.37 | test_hostha_kvm.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909070620


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893315331






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895674987


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907140670






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-904323315


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895601149


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 819


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895176972


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907555749


   <b>Trillian test result (tid-1812)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 41547 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1812-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Intermittent failure detected: /marvin/tests/smoke/test_snapshots.py
   Smoke tests completed. 89 look OK, 0 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-894044000


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-836591034


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864607216


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895579388


   Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian. SL-JID 818


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909070335






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699019773



##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2501,14 +2501,23 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
             }
         }
 
+        // Check that the the disk offering is specified
+        final Long diskOfferingId = cmd.getDiskOfferingId();
+        if (diskOfferingId != null) {
+            DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
+            if ((diskOffering == null) || diskOffering.getRemoved() != null || diskOffering.isComputeOnly()) {

Review comment:
       `diskOffering.getRemoved()` is null all time, may not be required in the cond.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] borisstoyanov commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
borisstoyanov commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-917898378


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r754985647



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
##########
@@ -68,6 +68,16 @@
     @Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, description = "name value pairs of custom parameters for cpu, memory and cpunumber. example details[i].name=value")
     private Map<String, String> details;
 
+    @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 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 root volume " +

Review comment:
       same, "since" attribute missing.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-979030809


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893343506


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895402682


   @harikrishna-patnala a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907141084






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-916238203


   <b>Trillian test result (tid-1996)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 33848 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1996-kvm-centos7.zip
   Smoke tests completed. 89 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r655386222



##########
File path: api/src/main/java/org/apache/cloudstack/api/response/DiskOfferingResponse.java
##########
@@ -155,6 +155,10 @@
     @Param(description = "the vsphere storage policy tagged to the disk offering in case of VMware", since = "4.15")
     private String vsphereStoragePolicy;
 
+    @SerializedName("disksizestrictness")

Review comment:
       ```suggestion
       @SerializedName("ApiConstants.DISK_SIZE_STRICTNESS")
   ```
   
   Can use the defined constant.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rohityadavcloud merged pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
rohityadavcloud merged pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-998407742


   <b>Trillian test result (tid-2689)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 44556 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t2689-kvm-centos7.zip
   Smoke tests completed. 89 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-979717459


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1002240691


   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1004939647


   <b>Trillian test result (tid-2772)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 33255 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t2772-kvm-centos7.zip
   Smoke tests completed. 91 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1004558565


   @sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r655927095



##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -3851,8 +3851,9 @@ public void checkIfCanUpgrade(final VirtualMachine vmInstance, final ServiceOffe
 
         final ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId());
         final DiskOfferingVO currentDiskOffering = _diskOfferingDao.findByIdIncludingRemoved(currentServiceOffering.getDiskOfferingId());
+        final DiskOfferingVO newDiskOffering = _diskOfferingDao.findByIdIncludingRemoved(newServiceOffering.getDiskOfferingId());
 
-        checkIfNewOfferingStorageScopeMatchesStoragePool(vmInstance, newServiceOffering);
+        checkIfNewOfferingStorageScopeMatchesStoragePool(vmInstance, newDiskOffering);

Review comment:
       so we allow for the upgrade to a deleted disk-offering?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-899213560


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala closed pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala closed pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-908571675






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r658828915



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41510to41600.sql
##########
@@ -19,21 +19,293 @@
 -- Schema upgrade from 4.15.1.0 to 4.16.0.0
 --;
 
--- Adding dynamic scalable flag for service offering table
-ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';
-DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
-CREATE VIEW `cloud`.`service_offering_view` AS
+
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE;

Review comment:
       check other offering(s), and set DEFAULT NULL / NOT NULL whatever is relevant here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864595046


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685824727



##########
File path: server/src/test/java/com/cloud/storage/VolumeApiServiceImplTest.java
##########
@@ -1113,6 +1138,7 @@ 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) {

Review comment:
       Is this test case to be updated? remove the comment if not required / after updating it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685801841



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41510to41600.sql
##########
@@ -19,21 +19,112 @@
 -- Schema upgrade from 4.15.1.0 to 4.16.0.0
 --;
 
--- Adding dynamic scalable flag for service offering table
-ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';
-DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
-CREATE VIEW `cloud`.`service_offering_view` AS
+
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE DEFAULT NULL;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `name` varchar(255) NOT NULL;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `display_text` varchar(4096) DEFAULT NULL ;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `unique_name` varchar(32) DEFAULT NULL COMMENT 'unique name for system offerings';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `customized` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT '0 implies not customized by default';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `created` datetime DEFAULT NULL COMMENT 'date when service offering was created';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `removed` datetime DEFAULT NULL COMMENT 'date when service offering was removed';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `state` CHAR(40) NOT NULL DEFAULT 'Active' COMMENT 'state of service offering either Active or Inactive';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `disk_offering_id` bigint unsigned;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `system_use` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'is this offering for system used only';

Review comment:
       check if 'system_use' column is required in disk_offering table or not, after moving & updating here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-911694596


   <b>Trillian test result (tid-1924)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 37498 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1924-xenserver-71.zip
   Smoke tests completed. 89 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-878722129


   Hi @harikrishna-patnala please advise when this PR is ready for review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-915440759


   <b>Trillian test result (tid-1987)</b>
   Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 40687 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1987-vmware-65u2.zip
   Smoke tests completed. 88 look OK, 1 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_offline_migrate_VM_and_root_volume | `Error` | 98.22 | test_vm_life_cycle.py
   test_03_live_migrate_VM_with_two_data_disks | `Error` | 62.34 | test_vm_life_cycle.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909070620






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala closed pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala closed pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-912280177


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-904490701


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-836591034


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-863760404






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-915777555


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020825956


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2294


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-997544104


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1002400385


   <b>Trillian test result (tid-2750)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 35132 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t2750-kvm-centos7.zip
   Smoke tests completed. 91 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1001886297


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] borisstoyanov commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
borisstoyanov commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1003278530


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r756602261



##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2857,7 +2857,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, true);
+        DiskOfferingVO diskOffering = new DiskOfferingVO(name, displayText, typedProvisioningType, false, tags, false, localStorageRequired, false);

Review comment:
       Can you check if 'customized' flag has to be set for disk offering, when `rootDiskSizeInGiB == 0`? Or Is it set else where?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r684897193



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41510to41600.sql
##########
@@ -19,21 +19,293 @@
 -- Schema upgrade from 4.15.1.0 to 4.16.0.0
 --;
 
--- Adding dynamic scalable flag for service offering table
-ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';
-DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
-CREATE VIEW `cloud`.`service_offering_view` AS
+
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `name` varchar(255);
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `display_text` varchar(4096);
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `unique_name` varchar(32) COMMENT 'unique name for system offerings';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `customized` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT '0 implies not customized by default';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `created` datetime COMMENT 'date when service offering was created';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `removed` datetime COMMENT 'date when service offering was removed';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `state` CHAR(40) NOT NULL DEFAULT 'Active' COMMENT 'state of service offering either Active or Inactive';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `disk_offering_id` bigint unsigned;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `system_use` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'is this offering for system used only';
+ALTER TABLE `cloud`.`service_offering` ADD CONSTRAINT `fk_service_offering__disk_offering_id` FOREIGN KEY `fk_service_offering__disk_offering_id`(`disk_offering_id`) REFERENCES `disk_offering`(`id`) ON DELETE CASCADE;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `disk_offering_strictness` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT 'strict binding with disk offering or not';
+
+ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `disk_size_strictness` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT 'To allow or disallow the resize operation on the disks created from this offering';
+ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `compute_only` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT 'when set to 1, disk offering has one to one binding with service offering';
+ALTER TABLE `cloud`.`disk_offering` DROP COLUMN `type`;
+
+ALTER TABLE `cloud`.`vm_instance` DROP COLUMN `disk_offering_id`;
+
+UPDATE `cloud`.`service_offering` so, `cloud`.`disk_offering` do SET so.`name` = do.`name`, so.`display_text` = do.`display_text` WHERE so.`id` = do.`id`;
+
+DROP VIEW IF EXISTS `cloud`.`user_vm_view`;
+CREATE
+VIEW `user_vm_view` AS
     SELECT
-        `service_offering`.`id` AS `id`,
+        `vm_instance`.`id` AS `id`,
+        `vm_instance`.`name` AS `name`,
+        `user_vm`.`display_name` AS `display_name`,
+        `user_vm`.`user_data` AS `user_data`,
+        `account`.`id` AS `account_id`,
+        `account`.`uuid` AS `account_uuid`,
+        `account`.`account_name` AS `account_name`,
+        `account`.`type` AS `account_type`,
+        `domain`.`id` AS `domain_id`,
+        `domain`.`uuid` AS `domain_uuid`,
+        `domain`.`name` AS `domain_name`,
+        `domain`.`path` AS `domain_path`,
+        `projects`.`id` AS `project_id`,
+        `projects`.`uuid` AS `project_uuid`,
+        `projects`.`name` AS `project_name`,
+        `instance_group`.`id` AS `instance_group_id`,
+        `instance_group`.`uuid` AS `instance_group_uuid`,
+        `instance_group`.`name` AS `instance_group_name`,
+        `vm_instance`.`uuid` AS `uuid`,
+        `vm_instance`.`user_id` AS `user_id`,
+        `vm_instance`.`last_host_id` AS `last_host_id`,
+        `vm_instance`.`vm_type` AS `type`,
+        `vm_instance`.`limit_cpu_use` AS `limit_cpu_use`,
+        `vm_instance`.`created` AS `created`,
+        `vm_instance`.`state` AS `state`,
+        `vm_instance`.`removed` AS `removed`,
+        `vm_instance`.`ha_enabled` AS `ha_enabled`,
+        `vm_instance`.`hypervisor_type` AS `hypervisor_type`,
+        `vm_instance`.`instance_name` AS `instance_name`,
+        `vm_instance`.`guest_os_id` AS `guest_os_id`,
+        `vm_instance`.`display_vm` AS `display_vm`,
+        `guest_os`.`uuid` AS `guest_os_uuid`,
+        `vm_instance`.`pod_id` AS `pod_id`,
+        `host_pod_ref`.`uuid` AS `pod_uuid`,
+        `vm_instance`.`private_ip_address` AS `private_ip_address`,
+        `vm_instance`.`private_mac_address` AS `private_mac_address`,
+        `vm_instance`.`vm_type` AS `vm_type`,
+        `data_center`.`id` AS `data_center_id`,
+        `data_center`.`uuid` AS `data_center_uuid`,
+        `data_center`.`name` AS `data_center_name`,
+        `data_center`.`is_security_group_enabled` AS `security_group_enabled`,
+        `data_center`.`networktype` AS `data_center_type`,
+        `host`.`id` AS `host_id`,
+        `host`.`uuid` AS `host_uuid`,
+        `host`.`name` AS `host_name`,
+        `vm_template`.`id` AS `template_id`,
+        `vm_template`.`uuid` AS `template_uuid`,
+        `vm_template`.`name` AS `template_name`,
+        `vm_template`.`display_text` AS `template_display_text`,
+        `vm_template`.`enable_password` AS `password_enabled`,
+        `iso`.`id` AS `iso_id`,
+        `iso`.`uuid` AS `iso_uuid`,
+        `iso`.`name` AS `iso_name`,
+        `iso`.`display_text` AS `iso_display_text`,
+        `service_offering`.`id` AS `service_offering_id`,
+        `service_offering`.`uuid` AS `service_offering_uuid`,
+        `disk_offering`.`uuid` AS `disk_offering_uuid`,
+        `disk_offering`.`id` AS `disk_offering_id`,
+        (CASE
+            WHEN ISNULL(`service_offering`.`cpu`) THEN `custom_cpu`.`value`
+            ELSE `service_offering`.`cpu`
+        END) AS `cpu`,
+        (CASE
+            WHEN ISNULL(`service_offering`.`speed`) THEN `custom_speed`.`value`
+            ELSE `service_offering`.`speed`
+        END) AS `speed`,
+        (CASE
+            WHEN ISNULL(`service_offering`.`ram_size`) THEN `custom_ram_size`.`value`
+            ELSE `service_offering`.`ram_size`
+        END) AS `ram_size`,
+        `backup_offering`.`uuid` AS `backup_offering_uuid`,
+        `backup_offering`.`id` AS `backup_offering_id`,
+        `service_offering`.`name` AS `service_offering_name`,
+        `disk_offering`.`name` AS `disk_offering_name`,
+        `backup_offering`.`name` AS `backup_offering_name`,
+        `storage_pool`.`id` AS `pool_id`,
+        `storage_pool`.`uuid` AS `pool_uuid`,
+        `storage_pool`.`pool_type` AS `pool_type`,
+        `volumes`.`id` AS `volume_id`,
+        `volumes`.`uuid` AS `volume_uuid`,
+        `volumes`.`device_id` AS `volume_device_id`,
+        `volumes`.`volume_type` AS `volume_type`,
+        `security_group`.`id` AS `security_group_id`,
+        `security_group`.`uuid` AS `security_group_uuid`,
+        `security_group`.`name` AS `security_group_name`,
+        `security_group`.`description` AS `security_group_description`,
+        `nics`.`id` AS `nic_id`,
+        `nics`.`uuid` AS `nic_uuid`,
+        `nics`.`network_id` AS `network_id`,
+        `nics`.`ip4_address` AS `ip_address`,
+        `nics`.`ip6_address` AS `ip6_address`,
+        `nics`.`ip6_gateway` AS `ip6_gateway`,
+        `nics`.`ip6_cidr` AS `ip6_cidr`,
+        `nics`.`default_nic` AS `is_default_nic`,
+        `nics`.`gateway` AS `gateway`,
+        `nics`.`netmask` AS `netmask`,
+        `nics`.`mac_address` AS `mac_address`,
+        `nics`.`broadcast_uri` AS `broadcast_uri`,
+        `nics`.`isolation_uri` AS `isolation_uri`,
+        `vpc`.`id` AS `vpc_id`,
+        `vpc`.`uuid` AS `vpc_uuid`,
+        `networks`.`uuid` AS `network_uuid`,
+        `networks`.`name` AS `network_name`,
+        `networks`.`traffic_type` AS `traffic_type`,
+        `networks`.`guest_type` AS `guest_type`,
+        `user_ip_address`.`id` AS `public_ip_id`,
+        `user_ip_address`.`uuid` AS `public_ip_uuid`,
+        `user_ip_address`.`public_ip_address` AS `public_ip_address`,
+        `ssh_keypairs`.`keypair_name` AS `keypair_name`,
+        `resource_tags`.`id` AS `tag_id`,
+        `resource_tags`.`uuid` AS `tag_uuid`,
+        `resource_tags`.`key` AS `tag_key`,
+        `resource_tags`.`value` AS `tag_value`,
+        `resource_tags`.`domain_id` AS `tag_domain_id`,
+        `domain`.`uuid` AS `tag_domain_uuid`,
+        `domain`.`name` AS `tag_domain_name`,
+        `resource_tags`.`account_id` AS `tag_account_id`,
+        `account`.`account_name` AS `tag_account_name`,
+        `resource_tags`.`resource_id` AS `tag_resource_id`,
+        `resource_tags`.`resource_uuid` AS `tag_resource_uuid`,
+        `resource_tags`.`resource_type` AS `tag_resource_type`,
+        `resource_tags`.`customer` AS `tag_customer`,
+        `async_job`.`id` AS `job_id`,
+        `async_job`.`uuid` AS `job_uuid`,
+        `async_job`.`job_status` AS `job_status`,
+        `async_job`.`account_id` AS `job_account_id`,
+        `affinity_group`.`id` AS `affinity_group_id`,
+        `affinity_group`.`uuid` AS `affinity_group_uuid`,
+        `affinity_group`.`name` AS `affinity_group_name`,
+        `affinity_group`.`description` AS `affinity_group_description`,
+        `vm_instance`.`dynamically_scalable` AS `dynamically_scalable`
+    FROM
+        (((((((((((((((((((((((((((((((((`user_vm`
+        JOIN `vm_instance` ON (((`vm_instance`.`id` = `user_vm`.`id`)
+            AND ISNULL(`vm_instance`.`removed`))))
+        JOIN `account` ON ((`vm_instance`.`account_id` = `account`.`id`)))
+        JOIN `domain` ON ((`vm_instance`.`domain_id` = `domain`.`id`)))
+        LEFT JOIN `guest_os` ON ((`vm_instance`.`guest_os_id` = `guest_os`.`id`)))
+        LEFT JOIN `host_pod_ref` ON ((`vm_instance`.`pod_id` = `host_pod_ref`.`id`)))
+        LEFT JOIN `projects` ON ((`projects`.`project_account_id` = `account`.`id`)))
+        LEFT JOIN `instance_group_vm_map` ON ((`vm_instance`.`id` = `instance_group_vm_map`.`instance_id`)))
+        LEFT JOIN `instance_group` ON ((`instance_group_vm_map`.`group_id` = `instance_group`.`id`)))
+        LEFT JOIN `data_center` ON ((`vm_instance`.`data_center_id` = `data_center`.`id`)))
+        LEFT JOIN `host` ON ((`vm_instance`.`host_id` = `host`.`id`)))
+        LEFT JOIN `vm_template` ON ((`vm_instance`.`vm_template_id` = `vm_template`.`id`)))
+        LEFT JOIN `vm_template` `iso` ON ((`iso`.`id` = `user_vm`.`iso_id`)))
+        LEFT JOIN `volumes` ON ((`vm_instance`.`id` = `volumes`.`instance_id`)))
+        LEFT JOIN `service_offering` ON ((`vm_instance`.`service_offering_id` = `service_offering`.`id`)))
+        LEFT JOIN `disk_offering` `svc_disk_offering` ON ((`volumes`.`disk_offering_id` = `svc_disk_offering`.`id`)))
+        LEFT JOIN `disk_offering` ON ((`volumes`.`disk_offering_id` = `disk_offering`.`id`)))
+        LEFT JOIN `backup_offering` ON ((`vm_instance`.`backup_offering_id` = `backup_offering`.`id`)))
+        LEFT JOIN `storage_pool` ON ((`volumes`.`pool_id` = `storage_pool`.`id`)))
+        LEFT JOIN `security_group_vm_map` ON ((`vm_instance`.`id` = `security_group_vm_map`.`instance_id`)))
+        LEFT JOIN `security_group` ON ((`security_group_vm_map`.`security_group_id` = `security_group`.`id`)))
+        LEFT JOIN `nics` ON (((`vm_instance`.`id` = `nics`.`instance_id`)
+            AND ISNULL(`nics`.`removed`))))
+        LEFT JOIN `networks` ON ((`nics`.`network_id` = `networks`.`id`)))
+        LEFT JOIN `vpc` ON (((`networks`.`vpc_id` = `vpc`.`id`)
+            AND ISNULL(`vpc`.`removed`))))
+        LEFT JOIN `user_ip_address` ON ((`user_ip_address`.`vm_id` = `vm_instance`.`id`)))
+        LEFT JOIN `user_vm_details` `ssh_details` ON (((`ssh_details`.`vm_id` = `vm_instance`.`id`)
+            AND (`ssh_details`.`name` = 'SSH.PublicKey'))))
+        LEFT JOIN `ssh_keypairs` ON (((`ssh_keypairs`.`public_key` = `ssh_details`.`value`)
+            AND (`ssh_keypairs`.`account_id` = `account`.`id`))))
+        LEFT JOIN `resource_tags` ON (((`resource_tags`.`resource_id` = `vm_instance`.`id`)
+            AND (`resource_tags`.`resource_type` = 'UserVm'))))
+        LEFT JOIN `async_job` ON (((`async_job`.`instance_id` = `vm_instance`.`id`)
+            AND (`async_job`.`instance_type` = 'VirtualMachine')
+            AND (`async_job`.`job_status` = 0))))
+        LEFT JOIN `affinity_group_vm_map` ON ((`vm_instance`.`id` = `affinity_group_vm_map`.`instance_id`)))
+        LEFT JOIN `affinity_group` ON ((`affinity_group_vm_map`.`affinity_group_id` = `affinity_group`.`id`)))
+        LEFT JOIN `user_vm_details` `custom_cpu` ON (((`custom_cpu`.`vm_id` = `vm_instance`.`id`)
+            AND (`custom_cpu`.`name` = 'CpuNumber'))))
+        LEFT JOIN `user_vm_details` `custom_speed` ON (((`custom_speed`.`vm_id` = `vm_instance`.`id`)
+            AND (`custom_speed`.`name` = 'CpuSpeed'))))
+        LEFT JOIN `user_vm_details` `custom_ram_size` ON (((`custom_ram_size`.`vm_id` = `vm_instance`.`id`)
+            AND (`custom_ram_size`.`name` = 'memory'))));
+
+DROP VIEW IF EXISTS `cloud`.`disk_offering_view`;
+CREATE VIEW `cloud`.`disk_offering_view` AS
+    SELECT
+        `disk_offering`.`id` AS `id`,
         `disk_offering`.`uuid` AS `uuid`,
         `disk_offering`.`name` AS `name`,
         `disk_offering`.`display_text` AS `display_text`,
         `disk_offering`.`provisioning_type` AS `provisioning_type`,
+        `disk_offering`.`disk_size` AS `disk_size`,
+        `disk_offering`.`min_iops` AS `min_iops`,
+        `disk_offering`.`max_iops` AS `max_iops`,
         `disk_offering`.`created` AS `created`,
         `disk_offering`.`tags` AS `tags`,
+        `disk_offering`.`customized` AS `customized`,
+        `disk_offering`.`customized_iops` AS `customized_iops`,
         `disk_offering`.`removed` AS `removed`,
         `disk_offering`.`use_local_storage` AS `use_local_storage`,
         `disk_offering`.`system_use` AS `system_use`,
+        `disk_offering`.`hv_ss_reserve` AS `hv_ss_reserve`,
+        `disk_offering`.`bytes_read_rate` AS `bytes_read_rate`,
+        `disk_offering`.`bytes_read_rate_max` AS `bytes_read_rate_max`,
+        `disk_offering`.`bytes_read_rate_max_length` AS `bytes_read_rate_max_length`,
+        `disk_offering`.`bytes_write_rate` AS `bytes_write_rate`,
+        `disk_offering`.`bytes_write_rate_max` AS `bytes_write_rate_max`,
+        `disk_offering`.`bytes_write_rate_max_length` AS `bytes_write_rate_max_length`,
+        `disk_offering`.`iops_read_rate` AS `iops_read_rate`,
+        `disk_offering`.`iops_read_rate_max` AS `iops_read_rate_max`,
+        `disk_offering`.`iops_read_rate_max_length` AS `iops_read_rate_max_length`,
+        `disk_offering`.`iops_write_rate` AS `iops_write_rate`,
+        `disk_offering`.`iops_write_rate_max` AS `iops_write_rate_max`,
+        `disk_offering`.`iops_write_rate_max_length` AS `iops_write_rate_max_length`,
+        `disk_offering`.`cache_mode` AS `cache_mode`,
+        `disk_offering`.`sort_key` AS `sort_key`,
+        `disk_offering`.`compute_only` AS `compute_only`,
+        `disk_offering`.`display_offering` AS `display_offering`,
+        `disk_offering`.`state` AS `state`,
+        `disk_offering`.`disk_size_strictness` AS `disk_size_strictness`,
+        `vsphere_storage_policy`.`value` AS `vsphere_storage_policy`,
+        GROUP_CONCAT(DISTINCT(domain.id)) AS domain_id,
+        GROUP_CONCAT(DISTINCT(domain.uuid)) AS domain_uuid,
+        GROUP_CONCAT(DISTINCT(domain.name)) AS domain_name,
+        GROUP_CONCAT(DISTINCT(domain.path)) AS domain_path,
+        GROUP_CONCAT(DISTINCT(zone.id)) AS zone_id,
+        GROUP_CONCAT(DISTINCT(zone.uuid)) AS zone_uuid,
+        GROUP_CONCAT(DISTINCT(zone.name)) AS zone_name
+    FROM
+        `cloud`.`disk_offering`
+            LEFT JOIN
+        `cloud`.`disk_offering_details` AS `domain_details` ON `domain_details`.`offering_id` = `disk_offering`.`id` AND `domain_details`.`name`='domainid'
+            LEFT JOIN
+        `cloud`.`domain` AS `domain` ON FIND_IN_SET(`domain`.`id`, `domain_details`.`value`)
+            LEFT JOIN
+        `cloud`.`disk_offering_details` AS `zone_details` ON `zone_details`.`offering_id` = `disk_offering`.`id` AND `zone_details`.`name`='zoneid'
+            LEFT JOIN
+        `cloud`.`data_center` AS `zone` ON FIND_IN_SET(`zone`.`id`, `zone_details`.`value`)
+			LEFT JOIN
+		`cloud`.`disk_offering_details` AS `vsphere_storage_policy` ON `vsphere_storage_policy`.`offering_id` = `disk_offering`.`id`
+				AND `vsphere_storage_policy`.`name` = 'storagepolicy'
+    WHERE
+        `disk_offering`.`state`='Active'
+    GROUP BY
+        `disk_offering`.`id`;
+
+-- Adding dynamic scalable flag for service offering table
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';

Review comment:
       This is part of another PR#4643
   -- Adding dynamic scalable flag for service offering table
   ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';
   
   I've just changed the place of the existing ALTER command, not sure why the delete change is missing.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-908570833






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893358536


   <b>Trillian Build Failed (tid-1489)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909123129






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699005166



##########
File path: test/integration/smoke/test_service_offerings.py
##########
@@ -614,6 +615,204 @@ def test_04_change_offering_small(self):
         )
         return
 
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_05_disk_offering_strictness_true(self):
+        """Test to see change service offering is not possible when disk offering strictness is set to true
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is true
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering
+        # 4. Try change service offering for VM and it will fail since disk offering strictness is true (not allowed to change the disk offering)
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue',
+            'cpuspeed': 512,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue)
+
+        self.virtual_machine_with_diskoffering_strictness_true = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.serviceOfferingWithDiskOfferingStrictnessTrue.id,
+            mode=self.services["mode"]
+        )
+
+        try:
+            self.virtual_machine_with_diskoffering_strictness_true.stop(self.apiclient)
+
+            timeout = self.services["timeout"]
+
+            while True:
+                time.sleep(self.services["sleep"])
+
+                # Ensure that VM is in stopped state
+                list_vm_response = list_virtual_machines(
+                    self.apiclient,
+                    id=self.virtual_machine_with_diskoffering_strictness_true.id
+                )
+
+                if isinstance(list_vm_response, list):
+                    vm = list_vm_response[0]
+                    if vm.state == 'Stopped':
+                        self.debug("VM state: %s" % vm.state)
+                        break
+
+                if timeout == 0:
+                    raise Exception(
+                        "Failed to stop VM (ID: %s) in change service offering" % vm.id)
+
+                timeout = timeout - 1
+        except Exception as e:
+            self.fail("Failed to stop VM: %s" % e)
+
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue2',
+            'cpuspeed': 1000,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue2',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue2 = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue2)
+        cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd()
+        cmd.id = self.virtual_machine_with_diskoffering_strictness_true.id
+        cmd.serviceofferingid = self.serviceOfferingWithDiskOfferingStrictnessTrue2.id
+
+        with self.assertRaises(Exception) as e:
+            self.apiclient.changeServiceForVirtualMachine(cmd)
+            self.debug("Upgrade VM with new service offering having different disk offering operation failed as expected with exception: %s" %
+                       e.exception)
+        return
+
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_06_disk_offering_strictness_false(self):
+        """Test to see change service offering is possible when disk offering strictness is set to false
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is false
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering and disk offering strictness is false
+        # 4. Try change service offering for VM should succeed
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessFalse',
+            'cpuspeed': 512,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessFalse',
+            'memory': 1024,
+            'diskofferingstrictness': False
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessFalse = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessFalse)
+
+        self.virtual_machine_with_diskoffering_strictness_false = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.serviceOfferingWithDiskOfferingStrictnessFalse.id,
+            mode=self.services["mode"]
+        )
+
+        try:
+            self.virtual_machine_with_diskoffering_strictness_false.stop(self.apiclient)
+
+            timeout = self.services["timeout"]
+
+            while True:
+                time.sleep(self.services["sleep"])
+
+                # Ensure that VM is in stopped state
+                list_vm_response = list_virtual_machines(
+                    self.apiclient,
+                    id=self.virtual_machine_with_diskoffering_strictness_false.id
+                )
+
+                if isinstance(list_vm_response, list):
+                    vm = list_vm_response[0]
+                    if vm.state == 'Stopped':
+                        self.debug("VM state: %s" % vm.state)
+                        break
+
+                if timeout == 0:
+                    raise Exception(
+                        "Failed to stop VM (ID: %s) in change service offering" % vm.id)
+
+                timeout = timeout - 1
+        except Exception as e:
+            self.fail("Failed to stop VM: %s" % e)
+
+        self.disk_offering2 = DiskOffering.create(
+                                    self.apiclient,
+                                    self.services["disk_offering"],
+                                    )
+        self._cleanup.append(self.disk_offering2)
+        offering_data = {

Review comment:
       Yes, it is test case specific. Resolving the previous comments too.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699027764



##########
File path: server/src/main/java/com/cloud/storage/StorageManagerImpl.java
##########
@@ -2317,13 +2322,13 @@ public boolean storagePoolHasEnoughIops(List<Volume> requestedVolumes, StoragePo
     }
 
     @Override
-    public boolean storagePoolHasEnoughSpace(List<Volume> volumes, StoragePool pool) {
-        return storagePoolHasEnoughSpace(volumes, pool, null);
+    public boolean storagePoolHasEnoughSpace(List<Pair<Volume, DiskProfile>> volumeDiskProfilePairs, StoragePool pool) {
+        return storagePoolHasEnoughSpace(volumeDiskProfilePairs, pool, null);
     }
 
     @Override
-    public boolean storagePoolHasEnoughSpace(List<Volume> volumes, StoragePool pool, Long clusterId) {
-        if (volumes == null || volumes.isEmpty()) {
+    public boolean storagePoolHasEnoughSpace(List<Pair<Volume, DiskProfile>> volumeDiskProfilesList, StoragePool pool, Long clusterId) {
+        if (volumeDiskProfilesList == null || volumeDiskProfilesList.isEmpty()) {

Review comment:
       ```suggestion
           if (CollectionUtils.isEmpty(volumeDiskProfilesList)) {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699152278



##########
File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -1448,10 +1452,15 @@ public int compare(Volume v1, Volume v2) {
                                 else
                                     requestVolumes = new ArrayList<Volume>();
                                 requestVolumes.add(vol);
-
+                                List<Pair<Volume, DiskProfile>> volumeDiskProfilePair = new ArrayList<>();
+                                for (Volume volume: requestVolumes) {
+                                    DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+                                    DiskProfile diskProfile = new DiskProfile(volume, diskOffering, _volsDao.getHypervisorType(volume.getId()));
+                                    volumeDiskProfilePair.add(new Pair<>(volume, diskProfile));

Review comment:
       moved to a new method getVolumeDiskProfilePairs()




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699030583



##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -1596,6 +1622,341 @@ public Volume recoverVolume(long volumeId) {
         return volume;
     }
 
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_VOLUME_CHANGE_DISK_OFFERING, eventDescription = "Changing disk offering of a volume")
+    public Volume changeDiskOfferingForVolume(ChangeOfferingForVolumeCmd cmd) throws ResourceAllocationException {
+        Long newSize = cmd.getSize();
+        Long newMinIops = cmd.getMinIops();
+        Long newMaxIops = cmd.getMaxIops();
+        Integer newHypervisorSnapshotReserve = null;
+        boolean autoMigrateVolume = cmd.getAutoMigrate();
+
+        boolean volumeMigrateRequired = false;
+        boolean volumeResizeRequired = false;
+
+        VolumeVO volume = _volsDao.findById(cmd.getId());
+        if (volume == null) {
+            throw new InvalidParameterValueException("No such volume");
+        }
+        long currentSize = volume.getSize();
+
+        DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+        DiskOfferingVO newDiskOffering = _diskOfferingDao.findById(cmd.getNewDiskOfferingId());
+
+        /* Does the caller have authority to act on this volume? */
+        _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume);
+
+        // VALIDATIONS
+
+        if (newDiskOffering.getId() == diskOffering.getId()) {
+            throw new InvalidParameterValueException(String.format("Volume %s already have the new disk offering %s provided", volume.getUuid(), diskOffering.getUuid()));
+        }
+
+        Long updateNewSize[] = {newSize};
+        Long updateNewMinIops[] = {newMinIops};
+        Long updateNewMaxIops[] = {newMaxIops};
+        Integer updateNewHypervisorSnapshotReserve[] = {newHypervisorSnapshotReserve};
+        validateVolumeResizeWithNewDiskOfferingAndLoad(volume, diskOffering, newDiskOffering, updateNewSize, updateNewMinIops, updateNewMaxIops, updateNewHypervisorSnapshotReserve);
+        newSize = updateNewSize[0];
+        newMinIops = updateNewMinIops[0];
+        newMaxIops = updateNewMaxIops[0];
+        newHypervisorSnapshotReserve = updateNewHypervisorSnapshotReserve[0];
+        validateVolumeResizeWithSize(volume, currentSize, newSize, true);
+
+        /* If this volume has never been beyond allocated state, short circuit everything and simply update the database. */
+        // We need to publish this event to usage_volume table
+        if (volume.getState() == Volume.State.Allocated) {
+            s_logger.debug("Volume is in the allocated state, but has never been created. Simply updating database with new size and IOPS.");

Review comment:
       Better to keep volume id / name in the log here 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-915777204


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-914020324


   > code LGTM
   > 
   > @harikrishna-patnala can you fix the conflicts. thanks!
   
   Thanks Suresh, resolved the conflicts with main.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-909119019


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-905982143


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893361043


   <b>Trillian Build Failed (tid-1487)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685787678



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
##########
@@ -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) throws InsufficientCapacityException {
+        Long rootDiskSize, Map<String, Map<Integer, String>> extraDhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Long diskOfferingId, Long rootDiskOfferingId) throws InsufficientCapacityException {

Review comment:
       ```suggestion
           Long rootDiskSize, Map<String, Map<Integer, String>> extraDhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Long dataDiskOfferingId, Long rootDiskOfferingId) throws InsufficientCapacityException {
   ```
   
   Update this if  the 'diskOfferingId' here is for data disk?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r633608983



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
##########
@@ -185,25 +185,25 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String
 
         ServiceOfferingVO computeOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId());
 
-        rootDiskOfferingInfo.setDiskOffering(computeOffering);
-        rootDiskOfferingInfo.setSize(rootDiskSize);
-
-        if (computeOffering.isCustomizedIops() != null && computeOffering.isCustomizedIops()) {
-            Map<String, String> userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId());
+        Long diskOfferingId = computeOffering.getDiskOfferingId();
+        if (diskOfferingId != null) {
+            DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
+            if (diskOffering == null) {
+                throw new InvalidParameterValueException("Unable to find disk offering " + diskOfferingId);
+            }
+            rootDiskOfferingInfo.setDiskOffering(diskOffering);
+            rootDiskOfferingInfo.setSize(rootDiskSize);
 
-            if (userVmDetails != null) {
-                String minIops = userVmDetails.get("minIops");
-                String maxIops = userVmDetails.get("maxIops");
+            if (diskOffering.isCustomizedIops() != null && diskOffering.isCustomizedIops()) {
+                Map<String, String> userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId());
 
-                rootDiskOfferingInfo.setMinIops(minIops != null && minIops.trim().length() > 0 ? Long.parseLong(minIops) : null);
-                rootDiskOfferingInfo.setMaxIops(maxIops != null && maxIops.trim().length() > 0 ? Long.parseLong(maxIops) : null);
-            }
-        }
+                if (userVmDetails != null) {
+                    String minIops = userVmDetails.get("minIops");
+                    String maxIops = userVmDetails.get("maxIops");
 
-        if (vm.getDiskOfferingId() != null) {
-            DiskOfferingVO diskOffering = _diskOfferingDao.findById(vm.getDiskOfferingId());
-            if (diskOffering == null) {
-                throw new InvalidParameterValueException("Unable to find disk offering " + vm.getDiskOfferingId());
+                    rootDiskOfferingInfo.setMinIops(minIops != null && minIops.trim().length() > 0 ? Long.parseLong(minIops) : null);

Review comment:
       We can use `StringUtils` here:
   
   ```java
   import org.apache.commons.lang3.StringUtils;
   ```
   
   ```java
   rootDiskOfferingInfo.setMinIops(StringUtils.isNotBlank(minIops) ? Long.parseLong(minIops) : null);
   ```
   Or, to simplify the logic:
   
   ```java
   rootDiskOfferingInfo.setMinIops(StringUtils.isBlank(minIops) ? null : Long.parseLong(minIops));
   ```
   

##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
##########
@@ -185,25 +185,25 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String
 
         ServiceOfferingVO computeOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId());
 
-        rootDiskOfferingInfo.setDiskOffering(computeOffering);
-        rootDiskOfferingInfo.setSize(rootDiskSize);
-
-        if (computeOffering.isCustomizedIops() != null && computeOffering.isCustomizedIops()) {
-            Map<String, String> userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId());
+        Long diskOfferingId = computeOffering.getDiskOfferingId();
+        if (diskOfferingId != null) {
+            DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
+            if (diskOffering == null) {
+                throw new InvalidParameterValueException("Unable to find disk offering " + diskOfferingId);
+            }
+            rootDiskOfferingInfo.setDiskOffering(diskOffering);
+            rootDiskOfferingInfo.setSize(rootDiskSize);
 
-            if (userVmDetails != null) {
-                String minIops = userVmDetails.get("minIops");
-                String maxIops = userVmDetails.get("maxIops");
+            if (diskOffering.isCustomizedIops() != null && diskOffering.isCustomizedIops()) {
+                Map<String, String> userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId());
 
-                rootDiskOfferingInfo.setMinIops(minIops != null && minIops.trim().length() > 0 ? Long.parseLong(minIops) : null);
-                rootDiskOfferingInfo.setMaxIops(maxIops != null && maxIops.trim().length() > 0 ? Long.parseLong(maxIops) : null);
-            }
-        }
+                if (userVmDetails != null) {
+                    String minIops = userVmDetails.get("minIops");
+                    String maxIops = userVmDetails.get("maxIops");
 
-        if (vm.getDiskOfferingId() != null) {
-            DiskOfferingVO diskOffering = _diskOfferingDao.findById(vm.getDiskOfferingId());
-            if (diskOffering == null) {
-                throw new InvalidParameterValueException("Unable to find disk offering " + vm.getDiskOfferingId());
+                    rootDiskOfferingInfo.setMinIops(minIops != null && minIops.trim().length() > 0 ? Long.parseLong(minIops) : null);
+                    rootDiskOfferingInfo.setMaxIops(maxIops != null && maxIops.trim().length() > 0 ? Long.parseLong(maxIops) : null);

Review comment:
       We can use `StringUtils` here:
   
   ```java
   import org.apache.commons.lang3.StringUtils;
   ```
   
   ```java
   rootDiskOfferingInfo.setMaxIops(StringUtils.isNotBlank(maxIops) ? Long.parseLong(maxIops) : null);
   ```
   Or, to simplify the logic:
   
   ```java
   rootDiskOfferingInfo.setMaxIops(StringUtils.isBlank(maxIops) ? null : Long.parseLong(maxIops));
   ```
   

##########
File path: engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java
##########
@@ -103,11 +146,16 @@ public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer spee
         volatileVm = false;
         this.defaultUse = defaultUse;
         this.vmType = vmType == null ? null : vmType.toString().toLowerCase();
+        uuid = UUID.randomUUID().toString();
+        this.systemUse = systemUse;
+        this.name = name;
+        this.displayText = displayText;
     }
 
-    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) {
-        super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);
+    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) {
+        //super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);

Review comment:
       As git will keep the history, we can remove the code.

##########
File path: engine/schema/src/main/java/com/cloud/service/dao/ServiceOfferingDaoImpl.java
##########
@@ -214,10 +218,16 @@ 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.setUniqueName(uniqueName);
+        diskOfferingVO = diskOfferingDao.persistDefaultDiskOffering(diskOfferingVO);
+
         List<ServiceOfferingVO> list = new ArrayList<ServiceOfferingVO>();
         ServiceOfferingVO offering = new ServiceOfferingVO(name, cpuCount, ramSize, cpuSpeed, rateMbps, multicastRateMbps, offerHA, displayText,
                 provisioningType, false, recreatable, tags, systemUse, vmType, defaultUse);
+        //        super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);

Review comment:
       As git will keep the history, we can remove the code.

##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2605,46 +2607,51 @@ protected ServiceOfferingVO createServiceOffering(final long userId, final boole
                     // Add in disk offering details
                     continue;
                 }
-                detailsVO.add(new ServiceOfferingDetailsVO(offering.getId(), detailEntry.getKey(), detailEntryValue, true));
+                detailsVO.add(new ServiceOfferingDetailsVO(serviceOffering.getId(), detailEntry.getKey(), detailEntryValue, true));
             }
         }
 
         if (storagePolicyID != null) {
-            detailsVO.add(new ServiceOfferingDetailsVO(offering.getId(), ApiConstants.STORAGE_POLICY, String.valueOf(storagePolicyID), false));
+            detailsVO.add(new ServiceOfferingDetailsVO(serviceOffering.getId(), ApiConstants.STORAGE_POLICY, String.valueOf(storagePolicyID), false));
         }
 
-        if ((offering = _serviceOfferingDao.persist(offering)) != null) {
-            for (Long domainId : filteredDomainIds) {
-                detailsVO.add(new ServiceOfferingDetailsVO(offering.getId(), ApiConstants.DOMAIN_ID, String.valueOf(domainId), false));
-            }
-            if (CollectionUtils.isNotEmpty(zoneIds)) {
-                for (Long zoneId : zoneIds) {
-                    detailsVO.add(new ServiceOfferingDetailsVO(offering.getId(), ApiConstants.ZONE_ID, String.valueOf(zoneId), false));
-                }
-            }
-            if (!detailsVO.isEmpty()) {
-                for (ServiceOfferingDetailsVO detail : detailsVO) {
-                    detail.setResourceId(offering.getId());
-                }
-                _serviceOfferingDetailsDao.saveDetails(detailsVO);
-            }
-
+        if ((diskOffering = _diskOfferingDao.persist(diskOffering)) != null) {
+            serviceOffering.setDiskOfferingId(diskOffering.getId());
             if (details != null && !details.isEmpty()) {
                 List<DiskOfferingDetailVO> diskDetailsVO = new ArrayList<DiskOfferingDetailVO>();
                 // Support disk offering details for below parameters
                 if (details.containsKey(Volume.BANDWIDTH_LIMIT_IN_MBPS)) {
-                    diskDetailsVO.add(new DiskOfferingDetailVO(offering.getId(), Volume.BANDWIDTH_LIMIT_IN_MBPS, details.get(Volume.BANDWIDTH_LIMIT_IN_MBPS), false));
+                    diskDetailsVO.add(new DiskOfferingDetailVO(diskOffering.getId(), Volume.BANDWIDTH_LIMIT_IN_MBPS, details.get(Volume.BANDWIDTH_LIMIT_IN_MBPS), false));
                 }
                 if (details.containsKey(Volume.IOPS_LIMIT)) {
-                    diskDetailsVO.add(new DiskOfferingDetailVO(offering.getId(), Volume.IOPS_LIMIT, details.get(Volume.IOPS_LIMIT), false));
+                    diskDetailsVO.add(new DiskOfferingDetailVO(diskOffering.getId(), Volume.IOPS_LIMIT, details.get(Volume.IOPS_LIMIT), false));
                 }
                 if (!diskDetailsVO.isEmpty()) {
                     diskOfferingDetailsDao.saveDetails(diskDetailsVO);
                 }
             }
+        } else {
+            return null;
+        }
 
-            CallContext.current().setEventDetails("Service offering id=" + offering.getId());
-            return offering;
+        if ((serviceOffering = _serviceOfferingDao.persist(serviceOffering)) != null) {
+            for (Long domainId : filteredDomainIds) {
+                detailsVO.add(new ServiceOfferingDetailsVO(serviceOffering.getId(), ApiConstants.DOMAIN_ID, String.valueOf(domainId), false));
+            }
+            if (CollectionUtils.isNotEmpty(zoneIds)) {
+                for (Long zoneId : zoneIds) {
+                    detailsVO.add(new ServiceOfferingDetailsVO(serviceOffering.getId(), ApiConstants.ZONE_ID, String.valueOf(zoneId), false));
+                }
+            }
+            if (!detailsVO.isEmpty()) {

Review comment:
       We can use `CollectionUtils.isNotEmpty` here.

##########
File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -1557,9 +1555,10 @@ protected boolean hostCanAccessSPool(Host host, StoragePool pool) {
 
             DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
 
-            if (vmProfile.getTemplate().getFormat() == Storage.ImageFormat.ISO && vmProfile.getServiceOffering().getTagsArray().length != 0) {
-                diskOffering.setTagsArray(Arrays.asList(vmProfile.getServiceOffering().getTagsArray()));
-            }
+            //FR123 check how is it different for service offering getTagsArray and disk offering's
+            //if (vmProfile.getTemplate().getFormat() == Storage.ImageFormat.ISO && vmProfile.getServiceOffering().getTagsArray().length != 0) {
+              //  diskOffering.setTagsArray(Arrays.asList(vmProfile.getServiceOffering().getTagsArray()));
+            //}

Review comment:
       As git will keep the history, we can remove the code and move the comment from code to commit message. If it is really needed in code, we can turn it into a javadoc.

##########
File path: server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
##########
@@ -835,9 +823,11 @@ private UserVm migrateImportedVM(HostVO sourceHost, VirtualMachineTemplate templ
             if (CollectionUtils.isNotEmpty(storagePools)) {
                 for (StoragePool pool : storagePools) {
                     if (diskProfileStoragePool.second().getId() != pool.getId() &&
-                            storagePoolSupportsDiskOffering(pool, dOffering) &&
-                            (!profile.getType().equals(Volume.Type.ROOT) ||
-                                    profile.getType().equals(Volume.Type.ROOT) && storagePoolSupportsServiceOffering(pool, serviceOffering))) {
+                            storagePoolSupportsDiskOffering(pool, dOffering)
+                            //FR123 get confirmation from Abhishek
+                            //(!profile.getType().equals(Volume.Type.ROOT) ||
+                                    //profile.getType().equals(Volume.Type.ROOT) && storagePoolSupportsServiceOffering(pool, serviceOffering))
+                            ) {

Review comment:
       As git will keep the history, we can remove the code and move the comment from code to commit message. If it is really needed in code, we can turn it into a javadoc.

##########
File path: engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java
##########
@@ -90,9 +132,10 @@ protected ServiceOfferingVO() {
         super();
     }
 
+    //FR123 split the usage of below constructor to create service offering vo and disk offering vo in different daoImpl.java files. Currently it is only under serviceofferingdaoimpl.java
     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) {
-        super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);
+        //super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);

Review comment:
       As git will keep the history, we can remove the code.

##########
File path: engine/schema/src/main/java/com/cloud/service/dao/ServiceOfferingDaoImpl.java
##########
@@ -58,7 +62,7 @@ public ServiceOfferingDaoImpl() {
 
         UniqueNameSearch = createSearchBuilder();
         UniqueNameSearch.and("name", UniqueNameSearch.entity().getUniqueName(), SearchCriteria.Op.EQ);
-        UniqueNameSearch.and("system", UniqueNameSearch.entity().isSystemUse(), SearchCriteria.Op.EQ);
+        UniqueNameSearch.and("system_use", UniqueNameSearch.entity().isSystemUse(), SearchCriteria.Op.EQ);

Review comment:
       As it will be used more times in this class, could it be extracted to a variable?

##########
File path: engine/schema/src/main/java/com/cloud/storage/dao/DiskOfferingDaoImpl.java
##########
@@ -82,13 +80,13 @@ protected DiskOfferingDaoImpl() {
 
     @Override
     public List<DiskOfferingVO> searchIncludingRemoved(SearchCriteria<DiskOfferingVO> sc, final Filter filter, final Boolean lock, final boolean cache) {
-        sc.addAnd(_typeAttr, Op.EQ, Type.Disk);
+        //sc.addAnd(_computeOnlyAttr, Op.EQ, false);
         return super.searchIncludingRemoved(sc, filter, lock, cache);
     }
 
     @Override
     public <K> List<K> customSearchIncludingRemoved(SearchCriteria<K> sc, final Filter filter) {
-        sc.addAnd(_typeAttr, Op.EQ, Type.Disk);
+        //sc.addAnd(_computeOnlyAttr, Op.EQ, false);

Review comment:
       As git will keep the history, we can remove the code.

##########
File path: server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
##########
@@ -818,9 +806,9 @@ private UserVm migrateImportedVM(HostVO sourceHost, VirtualMachineTemplate templ
                 continue;
             }
             boolean poolSupportsOfferings = storagePoolSupportsDiskOffering(diskProfileStoragePool.second(), dOffering);
-            if (poolSupportsOfferings && profile.getType() == Volume.Type.ROOT) {
-                poolSupportsOfferings = storagePoolSupportsServiceOffering(diskProfileStoragePool.second(), serviceOffering);
-            }
+            //FR123 get confirmation from Abhishek if (poolSupportsOfferings && profile.getType() == Volume.Type.ROOT) {
+            //    poolSupportsOfferings = storagePoolSupportsServiceOffering(diskProfileStoragePool.second(), serviceOffering);
+            //}

Review comment:
       As git will keep the history, we can remove the code and move the comment from code to commit message. If it is really needed in code, we can turn it into a javadoc.

##########
File path: server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
##########
@@ -848,9 +838,10 @@ private UserVm migrateImportedVM(HostVO sourceHost, VirtualMachineTemplate templ
                 storagePools = poolsPair.first();
                 for (StoragePool pool : storagePools) {
                     if (diskProfileStoragePool.second().getId() != pool.getId() &&
-                            storagePoolSupportsDiskOffering(pool, dOffering) &&
-                            (!profile.getType().equals(Volume.Type.ROOT) ||
-                                    profile.getType().equals(Volume.Type.ROOT) && storagePoolSupportsServiceOffering(pool, serviceOffering))) {
+                            storagePoolSupportsDiskOffering(pool, dOffering)
+                            //FR123 get confimration from Abhishek(!profile.getType().equals(Volume.Type.ROOT) ||
+                                    //profile.getType().equals(Volume.Type.ROOT) && storagePoolSupportsServiceOffering(pool, serviceOffering))

Review comment:
       As git will keep the history, we can remove the code and move the comment from code to commit message. If it is really needed in code, we can turn it into a javadoc.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r655374654



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
##########
@@ -239,6 +239,10 @@
             description = "true if virtual machine needs to be dynamically scalable")
     protected Boolean dynamicScalingEnabled;
 
+    @Parameter(name = ApiConstants.OVERRIDE_DISK_OFFERING_ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, description = "the ID of the disk offering for the virtual machine to be used for root volume instead of the disk offering mapped in service offering." +
+            "In case of virtual machine deploying from ISO, then the diskofferingid specified for root volume is ignored and uses this override disk offering id")

Review comment:
       @harikrishna-patnala Add `since` attribute to this parameter




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699015611



##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2501,14 +2501,23 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
             }
         }
 
+        // Check that the the disk offering is specified

Review comment:
       ```suggestion
           // Check that the disk offering is specified
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-908898625


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1068


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r698999926



##########
File path: ui/public/locales/en.json
##########
@@ -844,6 +846,9 @@
 "label.duration.in.sec": "Duration (in sec)",
 "label.dynamicscalingenabled": "Dynamic Scaling Enabled",
 "label.dynamicscalingenabled.tooltip": "VM can dynamically scale only when dynamic scaling is enabled on template, service offering and global setting",
+"label.diskofferingstrictness": "Disk Offering Strictness",
+"label.disksizestrictness": "Disk Size Strictness",
+"label.iscomputeonly.offering": "Compute only Disk Offering",

Review comment:
       ```suggestion
   "label.computeonly.offering": "Compute only Disk Offering",
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895674724


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907551332


   <b>Trillian test result (tid-1811)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 40534 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1811-xenserver-71.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Intermittent failure detected: /marvin/tests/smoke/test_pvlan.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dhcphosts.py
   Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
   Smoke tests completed. 87 look OK, 2 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_deploy_and_upgrade_kubernetes_cluster | `Failure` | 943.25 | test_kubernetes_clusters.py
   test_07_deploy_kubernetes_ha_cluster | `Failure` | 92.13 | test_kubernetes_clusters.py
   ContextSuite context=TestKubernetesCluster>:teardown | `Error` | 94.87 | test_kubernetes_clusters.py
   test_create_pvlan_network | `Error` | 0.03 | test_pvlan.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893363562


   <b>Trillian Build Failed (tid-1488)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-910171051


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-908885127


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864595046


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-837501904


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: centos8 :heavy_check_mark: debian. SL-JID 574


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897441898


   <b>Trillian Build Failed (tid-1618)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-906391129


   <b>Trillian test result (tid-1778)</b>
   Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 40139 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1778-vmware-65u2.zip
   Intermittent failure detected: /marvin/tests/smoke/test_diagnostics.py
   Intermittent failure detected: /marvin/tests/smoke/test_domain_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_storage_policy.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Smoke tests completed. 86 look OK, 3 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_import_storage_policies | `Error` | 4.39 | test_storage_policy.py
   ContextSuite context=TestVMWareStoragePolicies>:teardown | `Error` | 4.50 | test_storage_policy.py
   test_01_offline_migrate_VM_and_root_volume | `Error` | 95.79 | test_vm_life_cycle.py
   test_03_live_migrate_VM_with_two_data_disks | `Error` | 57.39 | test_vm_life_cycle.py
   test_01_vapps_vm_cycle | `Error` | 1.52 | test_vm_life_cycle.py
   ContextSuite context=TestVolumes>:setup | `Error` | 451.93 | test_volumes.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895197324


   <b>Trillian Build Failed (tid-1554)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-894041560


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 775


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r687090012



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41510to41600.sql
##########
@@ -19,21 +19,112 @@
 -- Schema upgrade from 4.15.1.0 to 4.16.0.0
 --;
 
--- Adding dynamic scalable flag for service offering table
-ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';
-DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
-CREATE VIEW `cloud`.`service_offering_view` AS
+
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE DEFAULT NULL;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `name` varchar(255) NOT NULL;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `display_text` varchar(4096) DEFAULT NULL ;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `unique_name` varchar(32) DEFAULT NULL COMMENT 'unique name for system offerings';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `customized` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT '0 implies not customized by default';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `created` datetime DEFAULT NULL COMMENT 'date when service offering was created';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `removed` datetime DEFAULT NULL COMMENT 'date when service offering was removed';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `state` CHAR(40) NOT NULL DEFAULT 'Active' COMMENT 'state of service offering either Active or Inactive';
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `disk_offering_id` bigint unsigned;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `system_use` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'is this offering for system used only';

Review comment:
       Yes, checked the references of system_use of disk offering and it is not used. Removed it




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-904323536


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699015611



##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2501,14 +2501,23 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
             }
         }
 
+        // Check that the the disk offering is specified

Review comment:
       ```suggestion
           // Check that the disk offering is specified
   ```
   
   can remove this comment, as it is evident from code ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-997722504


   Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 1957


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-997797550


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1001928889


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2030


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-980078690


   <b>Trillian test result (tid-2592)</b>
   Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 34691 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t2592-vmware-65u2.zip
   Smoke tests completed. 90 look OK, 1 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_offline_migrate_VM_and_root_volume | `Error` | 91.84 | test_vm_life_cycle.py
   test_03_live_migrate_VM_with_two_data_disks | `Error` | 59.44 | test_vm_life_cycle.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020801543


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020879439


   @harikrishna-patnala a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020801543






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rohityadavcloud commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
rohityadavcloud commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1023018575


   Last round of smoketests LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020879439


   @harikrishna-patnala a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] borisstoyanov commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
borisstoyanov commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1003309168


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1003944974


   Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2066


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r655374654



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
##########
@@ -239,6 +239,10 @@
             description = "true if virtual machine needs to be dynamically scalable")
     protected Boolean dynamicScalingEnabled;
 
+    @Parameter(name = ApiConstants.OVERRIDE_DISK_OFFERING_ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, description = "the ID of the disk offering for the virtual machine to be used for root volume instead of the disk offering mapped in service offering." +
+            "In case of virtual machine deploying from ISO, then the diskofferingid specified for root volume is ignored and uses this override disk offering id")

Review comment:
       @harikrishna-patnala Add `since` attribute to this parameter

##########
File path: api/src/main/java/org/apache/cloudstack/api/response/DiskOfferingResponse.java
##########
@@ -155,6 +155,10 @@
     @Param(description = "the vsphere storage policy tagged to the disk offering in case of VMware", since = "4.15")
     private String vsphereStoragePolicy;
 
+    @SerializedName("disksizestrictness")

Review comment:
       ```suggestion
       @SerializedName("ApiConstants.DISK_SIZE_STRICTNESS")
   ```
   
   Can use the defined constant.

##########
File path: engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java
##########
@@ -103,11 +146,16 @@ public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer spee
         volatileVm = false;
         this.defaultUse = defaultUse;
         this.vmType = vmType == null ? null : vmType.toString().toLowerCase();
+        uuid = UUID.randomUUID().toString();
+        this.systemUse = systemUse;
+        this.name = name;
+        this.displayText = displayText;
     }
 
-    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) {
-        super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);
+    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) {
+        //super(name, displayText, provisioningType, false, tags, recreatable, useLocalStorage, systemUse, true);

Review comment:
       +1

##########
File path: server/src/main/java/com/cloud/server/ConfigurationServerImpl.java
##########
@@ -926,16 +926,21 @@ private DiskOfferingVO createDefaultDiskOffering(String name, String description
         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);
-        newDiskOffering = _diskOfferingDao.persistDeafultDiskOffering(newDiskOffering);
+        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.setUniqueName("Cloud.Com-" + name);

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




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685812202



##########
File path: server/src/main/java/com/cloud/server/ConfigurationServerImpl.java
##########
@@ -926,16 +926,21 @@ private DiskOfferingVO createDefaultDiskOffering(String name, String description
         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);
-        newDiskOffering = _diskOfferingDao.persistDeafultDiskOffering(newDiskOffering);
+        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.setUniqueName("Cloud.Com-" + name);

Review comment:
       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?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r684895525



##########
File path: server/src/main/java/com/cloud/server/ConfigurationServerImpl.java
##########
@@ -926,16 +926,21 @@ private DiskOfferingVO createDefaultDiskOffering(String name, String description
         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);
-        newDiskOffering = _diskOfferingDao.persistDeafultDiskOffering(newDiskOffering);
+        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.setUniqueName("Cloud.Com-" + name);

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

##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -3851,8 +3851,9 @@ public void checkIfCanUpgrade(final VirtualMachine vmInstance, final ServiceOffe
 
         final ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId());
         final DiskOfferingVO currentDiskOffering = _diskOfferingDao.findByIdIncludingRemoved(currentServiceOffering.getDiskOfferingId());
+        final DiskOfferingVO newDiskOffering = _diskOfferingDao.findByIdIncludingRemoved(newServiceOffering.getDiskOfferingId());
 
-        checkIfNewOfferingStorageScopeMatchesStoragePool(vmInstance, newServiceOffering);
+        checkIfNewOfferingStorageScopeMatchesStoragePool(vmInstance, newDiskOffering);

Review comment:
       No, this is a copy/paste mistake of the previous line. Fixed it, it should not be a deleted one. Thanks Daan




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1020802011






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rohityadavcloud commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
rohityadavcloud commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1023018154


   @harikrishna-patnala let's merge this after next smoketests round
   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-979031170


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-978869141


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala closed pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala closed pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685789250



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java
##########
@@ -200,48 +204,50 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String
             }
         }
 
-        if (vm.getDiskOfferingId() != null) {
-            DiskOfferingVO diskOffering = _diskOfferingDao.findById(vm.getDiskOfferingId());
+        if (diskOfferingId != null) {
+            DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
             if (diskOffering == null) {
-                throw new InvalidParameterValueException("Unable to find disk offering " + vm.getDiskOfferingId());
+                throw new InvalidParameterValueException("Unable to find disk offering " + diskOfferingId);

Review comment:
       ```suggestion
                   throw new InvalidParameterValueException("Unable to find data disk offering " + dataDiskOfferingId);
   ```
   
   Update to 'data' disk here if relevant.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685680757



##########
File path: api/src/main/java/com/cloud/server/ManagementService.java
##########
@@ -400,7 +400,9 @@
      * @return Pair<List<? extends StoragePool>, List<? extends StoragePool>> List of storage pools in cluster and list
      *         of pools with enough capacity.
      */
-    Pair<List<? extends StoragePool>, List<? extends StoragePool>> listStoragePoolsForMigrationOfVolume(Long volumeId);
+    Pair<List<? extends StoragePool>, List<? extends StoragePool>> listStoragePoolsForMigrationOfVolumeForListing(Long volumeId);

Review comment:
       ```suggestion
       Pair<List<? extends StoragePool>, List<? extends StoragePool>> listStoragePoolsForMigrationOfVolume(Long volumeId);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893329211


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 761


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897069299


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r671018242



##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -2403,7 +2427,7 @@ public Volume migrateVolume(MigrateVolumeCmd cmd) {
         if (diskOffering == null) {
             throw new CloudRuntimeException("volume '" + vol.getUuid() + "', has no diskoffering. Migration target cannot be checked.");
         }
-        if (!doesTargetStorageSupportDiskOffering(destPool, diskOffering)) {
+        if (VolumeTagsStoragePoolStrictness.valueIn(destPool.getDataCenterId()) && !doesTargetStorageSupportDiskOffering(destPool, diskOffering)) {

Review comment:
       I'm referring to the above change in the PR https://github.com/apache/cloudstack/pull/4257




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907138198


   @rhtyd a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699022488



##########
File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -1448,10 +1452,15 @@ public int compare(Volume v1, Volume v2) {
                                 else
                                     requestVolumes = new ArrayList<Volume>();
                                 requestVolumes.add(vol);
-
+                                List<Pair<Volume, DiskProfile>> volumeDiskProfilePair = new ArrayList<>();
+                                for (Volume volume: requestVolumes) {
+                                    DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+                                    DiskProfile diskProfile = new DiskProfile(volume, diskOffering, _volsDao.getHypervisorType(volume.getId()));
+                                    volumeDiskProfilePair.add(new Pair<>(volume, diskProfile));

Review comment:
       possible to move creation of volume disk profile pair (from the volumes), to a common method and use it across?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864469468






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685784668



##########
File path: api/src/main/java/org/apache/cloudstack/api/response/ServiceOfferingResponse.java
##########
@@ -208,6 +208,22 @@
     @Param(description = "true if virtual machine needs to be dynamically scalable of cpu or memory", since = "4.16")
     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")
+    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;
+

Review comment:
       check if _since_ attribute is relevant for the below params




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895403117


   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864594959


   @blueorangutan test matrix
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864607251


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-911069194


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-911184336


   <b>Trillian test result (tid-1898)</b>
   Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 62312 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1898-vmware-65u2.zip
   Smoke tests completed. 89 look OK, 4 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_deploy_vm_start_failure | `Error` | 91.02 | test_deploy_vm.py
   test_deploy_vm_volume_creation_failure | `Error` | 87.83 | test_deploy_vm.py
   test_vm_ha | `Error` | 92.05 | test_vm_ha.py
   test_vm_sync | `Error` | 195.26 | test_vm_sync.py
   test_02_list_snapshots_with_removed_data_store | `Error` | 57.18 | test_snapshots.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r698999668



##########
File path: ui/public/locales/en.json
##########
@@ -1414,6 +1419,7 @@
 "label.migrate.to.host": "Migrate to host",
 "label.migrate.to.storage": "Migrate to storage",
 "label.migrate.volume": "Migrate Volume",
+"message.migrate.volume.tooltip": "Volume can be migrated to any suitable storagepool. Admin has to choose the appropriate disk offering to replace, that supports the new storage pool",

Review comment:
       ```suggestion
   "message.migrate.volume.tooltip": "Volume can be migrated to any suitable storage pool. Admin has to choose the appropriate disk offering to replace, that supports the new storage pool",
   ```

##########
File path: ui/public/locales/en.json
##########
@@ -844,6 +846,9 @@
 "label.duration.in.sec": "Duration (in sec)",
 "label.dynamicscalingenabled": "Dynamic Scaling Enabled",
 "label.dynamicscalingenabled.tooltip": "VM can dynamically scale only when dynamic scaling is enabled on template, service offering and global setting",
+"label.diskofferingstrictness": "Disk Offering Strictness",
+"label.disksizestrictness": "Disk Size Strictness",
+"label.iscomputeonly.offering": "Compute only Disk Offering",

Review comment:
       ```suggestion
   "label.computeonly.offering": "Compute only Disk Offering",
   ```

##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java
##########
@@ -74,6 +75,15 @@ public boolean isLiveMigrate() {
         return (liveMigrate != null) ? liveMigrate : false;
     }
 
+    public MigrateVolumeCmd() {
+
+    }

Review comment:
       ```suggestion
       }
       
   ```

##########
File path: api/src/main/java/org/apache/cloudstack/api/response/ServiceOfferingResponse.java
##########
@@ -486,4 +504,35 @@ public Boolean getDynamicScalingEnabled() {
     public void setDynamicScalingEnabled(Boolean dynamicScalingEnabled) {
         this.dynamicScalingEnabled = dynamicScalingEnabled;
     }
+
+    public Boolean getDiskOfferingStrictness() {
+        return diskOfferingStrictness;
+    }
+
+    public void setDiskOfferingStrictness(Boolean diskOfferingStrictness) {
+        this.diskOfferingStrictness = diskOfferingStrictness;
+    }

Review comment:
       ```suggestion
       }
       
   ```

##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java
##########
@@ -453,8 +453,14 @@ private Long getImportingVMGuestOs(VirtualMachineConfigSummary configSummary) {
      */
     private ServiceOfferingVO createServiceOfferingForVMImporting(Integer cpus, Integer memory, Integer maxCpuUsage) {
         String name = "Imported-" + cpus + "-" + memory;
-        ServiceOfferingVO vo = new ServiceOfferingVO(name, cpus, memory, maxCpuUsage, null, null, false, name, Storage.ProvisioningType.THIN, false, false, null, false, Type.User,
+
+        DiskOfferingVO diskOfferingVO = new DiskOfferingVO(name, name, Storage.ProvisioningType.THIN, false, null, false, false, true);
+        diskOfferingVO = diskOfferingDao.persistDefaultDiskOffering(diskOfferingVO);
+

Review comment:
       double white spaces

##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2501,14 +2501,23 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
             }
         }
 
+        // Check that the the disk offering is specified

Review comment:
       ```suggestion
           // Check that the disk offering is specified
   ```

##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2501,14 +2501,23 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
             }
         }
 
+        // Check that the the disk offering is specified

Review comment:
       ```suggestion
           // Check that the disk offering is specified
   ```
   
   can remove this comment, as it is evident from code ?

##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2501,14 +2501,23 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
             }
         }
 
+        // Check that the the disk offering is specified
+        final Long diskOfferingId = cmd.getDiskOfferingId();
+        if (diskOfferingId != null) {
+            DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
+            if ((diskOffering == null) || diskOffering.getRemoved() != null || diskOffering.isComputeOnly()) {

Review comment:
       `diskOffering.getRemoved()` is null all time, may not be required in the cond.

##########
File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -1448,10 +1452,15 @@ public int compare(Volume v1, Volume v2) {
                                 else
                                     requestVolumes = new ArrayList<Volume>();
                                 requestVolumes.add(vol);
-
+                                List<Pair<Volume, DiskProfile>> volumeDiskProfilePair = new ArrayList<>();
+                                for (Volume volume: requestVolumes) {
+                                    DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+                                    DiskProfile diskProfile = new DiskProfile(volume, diskOffering, _volsDao.getHypervisorType(volume.getId()));
+                                    volumeDiskProfilePair.add(new Pair<>(volume, diskProfile));

Review comment:
       possible to move creation of volume disk profile pair (from the volumes), to a common method and use it across?

##########
File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
##########
@@ -3453,6 +3491,7 @@ public long getMemoryOrCpuCapacityByHost(final Long hostId, final short capacity
         cmdList.add(IssueOutOfBandManagementPowerActionCmd.class);
         cmdList.add(ChangeOutOfBandManagementPasswordCmd.class);
         cmdList.add(GetUserKeysCmd.class);
+        cmdList.add(ChangeOfferingForVolumeCmd.class);

Review comment:
       Better to move this to the volume cmds added above.
   
   https://github.com/apache/cloudstack/blob/3ddcf858767ff5f79986457cbbac4c856b73e0bd/server/src/main/java/com/cloud/server/ManagementServerImpl.java#L3260-L3271
   
   

##########
File path: server/src/main/java/com/cloud/storage/StorageManagerImpl.java
##########
@@ -2317,13 +2322,13 @@ public boolean storagePoolHasEnoughIops(List<Volume> requestedVolumes, StoragePo
     }
 
     @Override
-    public boolean storagePoolHasEnoughSpace(List<Volume> volumes, StoragePool pool) {
-        return storagePoolHasEnoughSpace(volumes, pool, null);
+    public boolean storagePoolHasEnoughSpace(List<Pair<Volume, DiskProfile>> volumeDiskProfilePairs, StoragePool pool) {
+        return storagePoolHasEnoughSpace(volumeDiskProfilePairs, pool, null);
     }
 
     @Override
-    public boolean storagePoolHasEnoughSpace(List<Volume> volumes, StoragePool pool, Long clusterId) {
-        if (volumes == null || volumes.isEmpty()) {
+    public boolean storagePoolHasEnoughSpace(List<Pair<Volume, DiskProfile>> volumeDiskProfilesList, StoragePool pool, Long clusterId) {
+        if (volumeDiskProfilesList == null || volumeDiskProfilesList.isEmpty()) {

Review comment:
       ```suggestion
           if (CollectionUtils.isEmpty(volumeDiskProfilesList)) {
   ```

##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -1596,6 +1622,341 @@ public Volume recoverVolume(long volumeId) {
         return volume;
     }
 
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_VOLUME_CHANGE_DISK_OFFERING, eventDescription = "Changing disk offering of a volume")
+    public Volume changeDiskOfferingForVolume(ChangeOfferingForVolumeCmd cmd) throws ResourceAllocationException {
+        Long newSize = cmd.getSize();
+        Long newMinIops = cmd.getMinIops();
+        Long newMaxIops = cmd.getMaxIops();
+        Integer newHypervisorSnapshotReserve = null;
+        boolean autoMigrateVolume = cmd.getAutoMigrate();
+
+        boolean volumeMigrateRequired = false;
+        boolean volumeResizeRequired = false;
+
+        VolumeVO volume = _volsDao.findById(cmd.getId());
+        if (volume == null) {
+            throw new InvalidParameterValueException("No such volume");
+        }
+        long currentSize = volume.getSize();
+
+        DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+        DiskOfferingVO newDiskOffering = _diskOfferingDao.findById(cmd.getNewDiskOfferingId());
+
+        /* Does the caller have authority to act on this volume? */
+        _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume);
+
+        // VALIDATIONS
+
+        if (newDiskOffering.getId() == diskOffering.getId()) {
+            throw new InvalidParameterValueException(String.format("Volume %s already have the new disk offering %s provided", volume.getUuid(), diskOffering.getUuid()));
+        }
+
+        Long updateNewSize[] = {newSize};
+        Long updateNewMinIops[] = {newMinIops};
+        Long updateNewMaxIops[] = {newMaxIops};
+        Integer updateNewHypervisorSnapshotReserve[] = {newHypervisorSnapshotReserve};
+        validateVolumeResizeWithNewDiskOfferingAndLoad(volume, diskOffering, newDiskOffering, updateNewSize, updateNewMinIops, updateNewMaxIops, updateNewHypervisorSnapshotReserve);
+        newSize = updateNewSize[0];
+        newMinIops = updateNewMinIops[0];
+        newMaxIops = updateNewMaxIops[0];
+        newHypervisorSnapshotReserve = updateNewHypervisorSnapshotReserve[0];
+        validateVolumeResizeWithSize(volume, currentSize, newSize, true);
+
+        /* If this volume has never been beyond allocated state, short circuit everything and simply update the database. */
+        // We need to publish this event to usage_volume table
+        if (volume.getState() == Volume.State.Allocated) {
+            s_logger.debug("Volume is in the allocated state, but has never been created. Simply updating database with new size and IOPS.");

Review comment:
       Better to keep volume id / name in the log here 

##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -1596,6 +1622,341 @@ public Volume recoverVolume(long volumeId) {
         return volume;
     }
 
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_VOLUME_CHANGE_DISK_OFFERING, eventDescription = "Changing disk offering of a volume")
+    public Volume changeDiskOfferingForVolume(ChangeOfferingForVolumeCmd cmd) throws ResourceAllocationException {
+        Long newSize = cmd.getSize();
+        Long newMinIops = cmd.getMinIops();
+        Long newMaxIops = cmd.getMaxIops();
+        Integer newHypervisorSnapshotReserve = null;
+        boolean autoMigrateVolume = cmd.getAutoMigrate();
+
+        boolean volumeMigrateRequired = false;
+        boolean volumeResizeRequired = false;
+
+        VolumeVO volume = _volsDao.findById(cmd.getId());
+        if (volume == null) {
+            throw new InvalidParameterValueException("No such volume");
+        }
+        long currentSize = volume.getSize();
+
+        DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+        DiskOfferingVO newDiskOffering = _diskOfferingDao.findById(cmd.getNewDiskOfferingId());
+
+        /* Does the caller have authority to act on this volume? */
+        _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume);
+
+        // VALIDATIONS
+
+        if (newDiskOffering.getId() == diskOffering.getId()) {
+            throw new InvalidParameterValueException(String.format("Volume %s already have the new disk offering %s provided", volume.getUuid(), diskOffering.getUuid()));
+        }
+
+        Long updateNewSize[] = {newSize};
+        Long updateNewMinIops[] = {newMinIops};
+        Long updateNewMaxIops[] = {newMaxIops};
+        Integer updateNewHypervisorSnapshotReserve[] = {newHypervisorSnapshotReserve};
+        validateVolumeResizeWithNewDiskOfferingAndLoad(volume, diskOffering, newDiskOffering, updateNewSize, updateNewMinIops, updateNewMaxIops, updateNewHypervisorSnapshotReserve);
+        newSize = updateNewSize[0];
+        newMinIops = updateNewMinIops[0];
+        newMaxIops = updateNewMaxIops[0];
+        newHypervisorSnapshotReserve = updateNewHypervisorSnapshotReserve[0];
+        validateVolumeResizeWithSize(volume, currentSize, newSize, true);
+
+        /* If this volume has never been beyond allocated state, short circuit everything and simply update the database. */
+        // We need to publish this event to usage_volume table
+        if (volume.getState() == Volume.State.Allocated) {
+            s_logger.debug("Volume is in the allocated state, but has never been created. Simply updating database with new size and IOPS.");
+
+            volume.setSize(newSize);
+            volume.setMinIops(newMinIops);
+            volume.setMaxIops(newMaxIops);
+            volume.setHypervisorSnapshotReserve(newHypervisorSnapshotReserve);
+
+            if (newDiskOffering != null) {
+                volume.setDiskOfferingId(cmd.getNewDiskOfferingId());
+            }
+
+            _volsDao.update(volume.getId(), volume);
+            if (currentSize != newSize) {
+                UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_RESIZE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(),
+                        volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize(), Volume.class.getName(), volume.getUuid());
+            }
+            return volume;
+        }
+
+        if (MatchStoragePoolTagsWithDiskOffering.valueIn(volume.getDataCenterId())) {
+            if (!doesNewDiskOfferingHasTagsAsOldDiskOffering(diskOffering, newDiskOffering)) {
+                throw new InvalidParameterValueException(String.format("Selected disk offering %s does not have tags as in existing disk offering of volume", diskOffering.getUuid(), volume.getUuid()));

Review comment:
       ```suggestion
                   throw new InvalidParameterValueException(String.format("Selected disk offering %s does not have tags as in existing disk offering of volume %s", diskOffering.getUuid(), volume.getUuid()));
   ```

##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -1596,6 +1622,341 @@ public Volume recoverVolume(long volumeId) {
         return volume;
     }
 
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_VOLUME_CHANGE_DISK_OFFERING, eventDescription = "Changing disk offering of a volume")
+    public Volume changeDiskOfferingForVolume(ChangeOfferingForVolumeCmd cmd) throws ResourceAllocationException {
+        Long newSize = cmd.getSize();
+        Long newMinIops = cmd.getMinIops();
+        Long newMaxIops = cmd.getMaxIops();
+        Integer newHypervisorSnapshotReserve = null;
+        boolean autoMigrateVolume = cmd.getAutoMigrate();
+
+        boolean volumeMigrateRequired = false;
+        boolean volumeResizeRequired = false;
+
+        VolumeVO volume = _volsDao.findById(cmd.getId());
+        if (volume == null) {
+            throw new InvalidParameterValueException("No such volume");
+        }
+        long currentSize = volume.getSize();
+
+        DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+        DiskOfferingVO newDiskOffering = _diskOfferingDao.findById(cmd.getNewDiskOfferingId());
+
+        /* Does the caller have authority to act on this volume? */
+        _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume);
+
+        // VALIDATIONS
+
+        if (newDiskOffering.getId() == diskOffering.getId()) {
+            throw new InvalidParameterValueException(String.format("Volume %s already have the new disk offering %s provided", volume.getUuid(), diskOffering.getUuid()));
+        }
+
+        Long updateNewSize[] = {newSize};
+        Long updateNewMinIops[] = {newMinIops};
+        Long updateNewMaxIops[] = {newMaxIops};
+        Integer updateNewHypervisorSnapshotReserve[] = {newHypervisorSnapshotReserve};
+        validateVolumeResizeWithNewDiskOfferingAndLoad(volume, diskOffering, newDiskOffering, updateNewSize, updateNewMinIops, updateNewMaxIops, updateNewHypervisorSnapshotReserve);
+        newSize = updateNewSize[0];
+        newMinIops = updateNewMinIops[0];
+        newMaxIops = updateNewMaxIops[0];
+        newHypervisorSnapshotReserve = updateNewHypervisorSnapshotReserve[0];
+        validateVolumeResizeWithSize(volume, currentSize, newSize, true);
+
+        /* If this volume has never been beyond allocated state, short circuit everything and simply update the database. */
+        // We need to publish this event to usage_volume table
+        if (volume.getState() == Volume.State.Allocated) {
+            s_logger.debug("Volume is in the allocated state, but has never been created. Simply updating database with new size and IOPS.");
+
+            volume.setSize(newSize);
+            volume.setMinIops(newMinIops);
+            volume.setMaxIops(newMaxIops);
+            volume.setHypervisorSnapshotReserve(newHypervisorSnapshotReserve);
+
+            if (newDiskOffering != null) {
+                volume.setDiskOfferingId(cmd.getNewDiskOfferingId());
+            }
+
+            _volsDao.update(volume.getId(), volume);
+            if (currentSize != newSize) {
+                UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_RESIZE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(),
+                        volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize(), Volume.class.getName(), volume.getUuid());
+            }
+            return volume;
+        }
+
+        if (MatchStoragePoolTagsWithDiskOffering.valueIn(volume.getDataCenterId())) {
+            if (!doesNewDiskOfferingHasTagsAsOldDiskOffering(diskOffering, newDiskOffering)) {
+                throw new InvalidParameterValueException(String.format("Selected disk offering %s does not have tags as in existing disk offering of volume", diskOffering.getUuid(), volume.getUuid()));
+            }
+        }
+
+        if (currentSize != newSize || newMaxIops != volume.getMaxIops() || newMinIops != volume.getMinIops()) {
+            volumeResizeRequired = true;
+            validateVolumeResizeChecks(volume, currentSize, newSize);
+        }
+
+        StoragePoolVO existingStoragePool = _storagePoolDao.findById(volume.getPoolId());
+
+        Pair<List<? extends StoragePool>, List<? extends StoragePool>> poolsPair = managementService.listStoragePoolsForMigrationOfVolumeInternal(volume.getId(), newDiskOffering.getId(), newSize, newMinIops, newMaxIops, true);
+        List<? extends StoragePool> suitableStoragePools = poolsPair.second();
+
+        if (!suitableStoragePools.stream().anyMatch(p -> (p.getId() == existingStoragePool.getId()))) {
+            volumeMigrateRequired = true;
+            if (!autoMigrateVolume) {
+                throw new InvalidParameterValueException("Failed to change offering for volume since automigrate is set to false but volume needs to migrated");

Review comment:
       Keep volume id / name in the log here

##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -5367,12 +5414,17 @@ public UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityE
         }
 
         Long serviceOfferingId = cmd.getServiceOfferingId();
+        Long overrideDiskOfferingId = cmd.getOverrideDiskOfferingId();
 
         ServiceOffering serviceOffering = _entityMgr.findById(ServiceOffering.class, serviceOfferingId);
         if (serviceOffering == null) {
             throw new InvalidParameterValueException("Unable to find service offering: " + serviceOfferingId);
         }
 
+        if (serviceOffering.getDiskOfferingStrictness() && overrideDiskOfferingId != null) {
+            throw new InvalidParameterValueException(String.format("Cannot user override disk offering id %d since provided service offering is strictly mapped to its disk offering", overrideDiskOfferingId));

Review comment:
       ```suggestion
               throw new InvalidParameterValueException(String.format("Cannot override disk offering id %d since provided service offering is strictly mapped to its disk offering", overrideDiskOfferingId));
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-911062934


   <b>Trillian test result (tid-1897)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 53032 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1897-kvm-centos7.zip
   Smoke tests completed. 90 look OK, 3 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_deploy_vm_start_failure | `Error` | 59.20 | test_deploy_vm.py
   test_deploy_vm_volume_creation_failure | `Error` | 61.24 | test_deploy_vm.py
   test_vm_ha | `Error` | 69.53 | test_vm_ha.py
   test_vm_sync | `Error` | 130.04 | test_vm_sync.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893316824


   here all, I'm working on the PR description with test results and screenshots to explain more about the changes. Sorry for the delayed response. Thanks for all you watching on the PR. Meanwhile I'll address the already existing review comments.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897079844


   <b>Trillian Build Failed (tid-1610)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-906358549


   <b>Trillian test result (tid-1777)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 37588 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1777-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Smoke tests completed. 88 look OK, 1 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_07_resize_fail | `Failure` | 122.25 | test_volumes.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907113268


   @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-904512540


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 996


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-912280177


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r698970157



##########
File path: server/src/main/java/com/cloud/server/ConfigurationServerImpl.java
##########
@@ -926,16 +926,21 @@ private DiskOfferingVO createDefaultDiskOffering(String name, String description
         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);
-        newDiskOffering = _diskOfferingDao.persistDeafultDiskOffering(newDiskOffering);
+        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.setUniqueName("Cloud.Com-" + name);

Review comment:
       Yes @rhtyd 

##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/volume/ChangeOfferingForVolumeCmd.java
##########
@@ -0,0 +1,141 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.volume;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.offering.DiskOffering;
+import com.cloud.storage.Volume;
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+@APICommand(name = ChangeOfferingForVolumeCmd.APINAME,
+        description = "Change disk offering of the volume and also an option to auto migrate if required to apply the new disk offering",
+        responseObject = VolumeResponse.class,
+        requestHasSensitiveInfo = false,
+        responseHasSensitiveInfo = false,
+        authorized = { RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User},
+        since = "4.16")
+public class ChangeOfferingForVolumeCmd extends BaseAsyncCmd implements UserCmd {
+
+    public static final String APINAME = "changeOfferingForVolume";
+    public static final Logger s_logger = Logger.getLogger(ChangeOfferingForVolumeCmd.class.getName());
+    private static final String s_name = "changeofferingforvolumeresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name = ApiConstants.ID, entityType = VolumeResponse.class, required = true, type = CommandType.UUID, description = "the ID of the volume")
+    private Long id;
+
+    @Parameter(name = ApiConstants.DISK_OFFERING_ID,
+            entityType = DiskOfferingResponse.class,
+            type = CommandType.UUID,
+            required = true,
+            description = "new disk offering id")
+    private Long newDiskOfferingId;
+
+    @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 for the custom disk offering")
+    private Long minIops;
+
+    @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 " +
+            "with new disk offering whenever migration is required to apply the offering")
+    private Boolean autoMigrate;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public Long getNewDiskOfferingId() {
+        return newDiskOfferingId;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public Long getMinIops() {
+        return minIops;
+    }
+
+    public Long getMaxIops() {
+        return maxIops;
+    }
+
+    public boolean getAutoMigrate() {
+        return autoMigrate == null ? true : autoMigrate;

Review comment:
       The new API changeOfferingForVolume is supposed to keep the volume in the proper state as per the provided disk offering. So if migration of volume is required (as per the new disk offering) it has to be migrated, otherwise, API will fail. There is an option in UI also to tick/untick the flag. I think default true is fine. Let me know your comments too.

##########
File path: engine/api/src/main/java/org/apache/cloudstack/engine/service/api/OrchestrationService.java
##########
@@ -67,14 +67,15 @@ VirtualMachineEntity createVirtualMachine(@QueryParam("id") String id, @QueryPar
         @QueryParam("compute-tags") List<String> computeTags, @QueryParam("root-disk-tags") List<String> rootDiskTags,
         @QueryParam("network-nic-map") Map<String, List<NicProfile>> networkNicMap, @QueryParam("deploymentplan") DeploymentPlan plan,
         @QueryParam("root-disk-size") Long rootDiskSize, @QueryParam("extra-dhcp-option-map") Map<String, Map<Integer, String>> extraDhcpOptionMap,
-        @QueryParam("datadisktemplate-diskoffering-map") Map<Long, DiskOffering> datadiskTemplateToDiskOfferingMap) throws InsufficientCapacityException;
+        @QueryParam("datadisktemplate-diskoffering-map") Map<Long, DiskOffering> datadiskTemplateToDiskOfferingMap, @QueryParam("disk-offering-id") Long diskOfferingId, @QueryParam("root-disk-offering-id") Long rootDiskOfferingId) throws InsufficientCapacityException;

Review comment:
       there are usages these methods @rhtyd, so I changed it accordingly
   https://github.com/apache/cloudstack/blob/6d4a74b27b7c35cfe170cbac621874d2a6b6e537/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java#L4270

##########
File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -1655,19 +1660,6 @@ protected boolean hostCanAccessSPool(Host host, StoragePool pool) {
                 }
             } else {
                 useLocalStorage = diskOffering.isUseLocalStorage();
-
-                // TODO: this is a hacking fix for the problem of deploy
-                // ISO-based VM on local storage
-                // when deploying VM based on ISO, we have a service offering
-                // and an additional disk offering, use-local storage flag is
-                // actually
-                // saved in service offering, override the flag from service
-                // offering when it is a ROOT disk
-                if (!useLocalStorage && vmProfile.getServiceOffering().isUseLocalStorage()) {

Review comment:
       Since Compute and disk offerings are decoupled, the uselocalstorage flag is persisted/accessed in disk offering only. 
   Previously uselocalstorage flag is considered in the following way.
   1. If useLocalStorage Flag of the disk offering is true, then use local storage only.
   2. If useLocalStorage Flag of the disk offering is false, then check useLocalStorage Flag in service offering.
   
   To my understanding this is not correct, if useLocalStorage Flag of the disk offering is true, then useLocalStorage Flag in service offering is ignored completely. The preference is neither given to disk offering nor compute offering.
   
   The useLocalStorage flag is supposed to be a property of disk offering, so we have to consider only the value defined in the volume's disk offering.
   Now, also we are introducing a way to override the disk offering for root volume, so volume has the proper source of truth.
   
   This will not effect the existing VMs since volume is already created.

##########
File path: test/integration/smoke/test_service_offerings.py
##########
@@ -614,6 +615,204 @@ def test_04_change_offering_small(self):
         )
         return
 
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_05_disk_offering_strictness_true(self):
+        """Test to see change service offering is not possible when disk offering strictness is set to true
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is true
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering
+        # 4. Try change service offering for VM and it will fail since disk offering strictness is true (not allowed to change the disk offering)
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue',
+            'cpuspeed': 512,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue)
+
+        self.virtual_machine_with_diskoffering_strictness_true = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.serviceOfferingWithDiskOfferingStrictnessTrue.id,
+            mode=self.services["mode"]
+        )
+
+        try:
+            self.virtual_machine_with_diskoffering_strictness_true.stop(self.apiclient)
+
+            timeout = self.services["timeout"]
+
+            while True:
+                time.sleep(self.services["sleep"])
+
+                # Ensure that VM is in stopped state
+                list_vm_response = list_virtual_machines(
+                    self.apiclient,
+                    id=self.virtual_machine_with_diskoffering_strictness_true.id
+                )
+
+                if isinstance(list_vm_response, list):
+                    vm = list_vm_response[0]
+                    if vm.state == 'Stopped':
+                        self.debug("VM state: %s" % vm.state)
+                        break
+
+                if timeout == 0:
+                    raise Exception(
+                        "Failed to stop VM (ID: %s) in change service offering" % vm.id)
+
+                timeout = timeout - 1
+        except Exception as e:
+            self.fail("Failed to stop VM: %s" % e)
+
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessTrue2',
+            'cpuspeed': 1000,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessTrue2',
+            'memory': 1024,
+            'diskofferingstrictness': True
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessTrue2 = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessTrue2)
+        cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd()
+        cmd.id = self.virtual_machine_with_diskoffering_strictness_true.id
+        cmd.serviceofferingid = self.serviceOfferingWithDiskOfferingStrictnessTrue2.id
+
+        with self.assertRaises(Exception) as e:
+            self.apiclient.changeServiceForVirtualMachine(cmd)
+            self.debug("Upgrade VM with new service offering having different disk offering operation failed as expected with exception: %s" %
+                       e.exception)
+        return
+
+    @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
+    def test_06_disk_offering_strictness_false(self):
+        """Test to see change service offering is possible when disk offering strictness is set to false
+        """
+        # Validate the following
+        # 1. Create service offering linked a disk offering and disk offering strictness is false
+        # 2. Create a VM with that service offering
+        # 3. Create another service offering with a different disk offering and disk offering strictness is false
+        # 4. Try change service offering for VM should succeed
+
+        if self.hypervisor.lower() == "lxc":
+            self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
+
+        offering_data = {
+            'displaytext': 'TestDiskOfferingStrictnessFalse',
+            'cpuspeed': 512,
+            'cpunumber': 2,
+            'name': 'TestDiskOfferingStrictnessFalse',
+            'memory': 1024,
+            'diskofferingstrictness': False
+        }
+
+        self.serviceOfferingWithDiskOfferingStrictnessFalse = ServiceOffering.create(
+            self.apiclient,
+            offering_data,
+        )
+        self._cleanup.append(self.serviceOfferingWithDiskOfferingStrictnessFalse)
+
+        self.virtual_machine_with_diskoffering_strictness_false = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.serviceOfferingWithDiskOfferingStrictnessFalse.id,
+            mode=self.services["mode"]
+        )
+
+        try:
+            self.virtual_machine_with_diskoffering_strictness_false.stop(self.apiclient)
+
+            timeout = self.services["timeout"]
+
+            while True:
+                time.sleep(self.services["sleep"])
+
+                # Ensure that VM is in stopped state
+                list_vm_response = list_virtual_machines(
+                    self.apiclient,
+                    id=self.virtual_machine_with_diskoffering_strictness_false.id
+                )
+
+                if isinstance(list_vm_response, list):
+                    vm = list_vm_response[0]
+                    if vm.state == 'Stopped':
+                        self.debug("VM state: %s" % vm.state)
+                        break
+
+                if timeout == 0:
+                    raise Exception(
+                        "Failed to stop VM (ID: %s) in change service offering" % vm.id)
+
+                timeout = timeout - 1
+        except Exception as e:
+            self.fail("Failed to stop VM: %s" % e)
+
+        self.disk_offering2 = DiskOffering.create(
+                                    self.apiclient,
+                                    self.services["disk_offering"],
+                                    )
+        self._cleanup.append(self.disk_offering2)
+        offering_data = {

Review comment:
       Yes, it is test case specific. Resolving the previous comments too.

##########
File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -1448,10 +1452,15 @@ public int compare(Volume v1, Volume v2) {
                                 else
                                     requestVolumes = new ArrayList<Volume>();
                                 requestVolumes.add(vol);
-
+                                List<Pair<Volume, DiskProfile>> volumeDiskProfilePair = new ArrayList<>();
+                                for (Volume volume: requestVolumes) {
+                                    DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+                                    DiskProfile diskProfile = new DiskProfile(volume, diskOffering, _volsDao.getHypervisorType(volume.getId()));
+                                    volumeDiskProfilePair.add(new Pair<>(volume, diskProfile));

Review comment:
       moved to a new method getVolumeDiskProfilePairs()




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-914925574


   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-914930945


   @rhtyd a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864607150


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: centos8 :heavy_check_mark: debian. SL-JID 305


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-897383337


   <b>Trillian test result (tid-1609)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 39588 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1609-xenserver-71.zip
   Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
   Smoke tests completed. 87 look OK, 2 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_07_resize_fail | `Failure` | 15.75 | test_volumes.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Error` | 82.36 | test_vpc_redundant.py
   test_02_redundant_VPC_default_routes | `Error` | 81.35 | test_vpc_redundant.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-908571211


   @blueorangutan test centos7 vmware-65u2


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r698974611



##########
File path: engine/api/src/main/java/org/apache/cloudstack/engine/service/api/OrchestrationService.java
##########
@@ -67,14 +67,15 @@ VirtualMachineEntity createVirtualMachine(@QueryParam("id") String id, @QueryPar
         @QueryParam("compute-tags") List<String> computeTags, @QueryParam("root-disk-tags") List<String> rootDiskTags,
         @QueryParam("network-nic-map") Map<String, List<NicProfile>> networkNicMap, @QueryParam("deploymentplan") DeploymentPlan plan,
         @QueryParam("root-disk-size") Long rootDiskSize, @QueryParam("extra-dhcp-option-map") Map<String, Map<Integer, String>> extraDhcpOptionMap,
-        @QueryParam("datadisktemplate-diskoffering-map") Map<Long, DiskOffering> datadiskTemplateToDiskOfferingMap) throws InsufficientCapacityException;
+        @QueryParam("datadisktemplate-diskoffering-map") Map<Long, DiskOffering> datadiskTemplateToDiskOfferingMap, @QueryParam("disk-offering-id") Long diskOfferingId, @QueryParam("root-disk-offering-id") Long rootDiskOfferingId) throws InsufficientCapacityException;

Review comment:
       there are usages these methods @rhtyd, so I changed it accordingly
   https://github.com/apache/cloudstack/blob/6d4a74b27b7c35cfe170cbac621874d2a6b6e537/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java#L4270




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-912280326






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-922816598


   Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_multiplication_x: debian :heavy_check_mark: suse15. SL-JID 1326


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864604287


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699031576



##########
File path: server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
##########
@@ -1596,6 +1622,341 @@ public Volume recoverVolume(long volumeId) {
         return volume;
     }
 
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_VOLUME_CHANGE_DISK_OFFERING, eventDescription = "Changing disk offering of a volume")
+    public Volume changeDiskOfferingForVolume(ChangeOfferingForVolumeCmd cmd) throws ResourceAllocationException {
+        Long newSize = cmd.getSize();
+        Long newMinIops = cmd.getMinIops();
+        Long newMaxIops = cmd.getMaxIops();
+        Integer newHypervisorSnapshotReserve = null;
+        boolean autoMigrateVolume = cmd.getAutoMigrate();
+
+        boolean volumeMigrateRequired = false;
+        boolean volumeResizeRequired = false;
+
+        VolumeVO volume = _volsDao.findById(cmd.getId());
+        if (volume == null) {
+            throw new InvalidParameterValueException("No such volume");
+        }
+        long currentSize = volume.getSize();
+
+        DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId());
+        DiskOfferingVO newDiskOffering = _diskOfferingDao.findById(cmd.getNewDiskOfferingId());
+
+        /* Does the caller have authority to act on this volume? */
+        _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume);
+
+        // VALIDATIONS
+
+        if (newDiskOffering.getId() == diskOffering.getId()) {
+            throw new InvalidParameterValueException(String.format("Volume %s already have the new disk offering %s provided", volume.getUuid(), diskOffering.getUuid()));
+        }
+
+        Long updateNewSize[] = {newSize};
+        Long updateNewMinIops[] = {newMinIops};
+        Long updateNewMaxIops[] = {newMaxIops};
+        Integer updateNewHypervisorSnapshotReserve[] = {newHypervisorSnapshotReserve};
+        validateVolumeResizeWithNewDiskOfferingAndLoad(volume, diskOffering, newDiskOffering, updateNewSize, updateNewMinIops, updateNewMaxIops, updateNewHypervisorSnapshotReserve);
+        newSize = updateNewSize[0];
+        newMinIops = updateNewMinIops[0];
+        newMaxIops = updateNewMaxIops[0];
+        newHypervisorSnapshotReserve = updateNewHypervisorSnapshotReserve[0];
+        validateVolumeResizeWithSize(volume, currentSize, newSize, true);
+
+        /* If this volume has never been beyond allocated state, short circuit everything and simply update the database. */
+        // We need to publish this event to usage_volume table
+        if (volume.getState() == Volume.State.Allocated) {
+            s_logger.debug("Volume is in the allocated state, but has never been created. Simply updating database with new size and IOPS.");
+
+            volume.setSize(newSize);
+            volume.setMinIops(newMinIops);
+            volume.setMaxIops(newMaxIops);
+            volume.setHypervisorSnapshotReserve(newHypervisorSnapshotReserve);
+
+            if (newDiskOffering != null) {
+                volume.setDiskOfferingId(cmd.getNewDiskOfferingId());
+            }
+
+            _volsDao.update(volume.getId(), volume);
+            if (currentSize != newSize) {
+                UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_RESIZE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(),
+                        volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize(), Volume.class.getName(), volume.getUuid());
+            }
+            return volume;
+        }
+
+        if (MatchStoragePoolTagsWithDiskOffering.valueIn(volume.getDataCenterId())) {
+            if (!doesNewDiskOfferingHasTagsAsOldDiskOffering(diskOffering, newDiskOffering)) {
+                throw new InvalidParameterValueException(String.format("Selected disk offering %s does not have tags as in existing disk offering of volume", diskOffering.getUuid(), volume.getUuid()));

Review comment:
       ```suggestion
                   throw new InvalidParameterValueException(String.format("Selected disk offering %s does not have tags as in existing disk offering of volume %s", diskOffering.getUuid(), volume.getUuid()));
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-911077669


   <b>Trillian test result (tid-1896)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 55343 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1896-xenserver-71.zip
   Smoke tests completed. 89 look OK, 4 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_deploy_vm_start_failure | `Error` | 101.04 | test_deploy_vm.py
   test_deploy_vm_volume_creation_failure | `Error` | 74.55 | test_deploy_vm.py
   test_vm_ha | `Error` | 85.98 | test_vm_ha.py
   test_vm_sync | `Error` | 174.87 | test_vm_sync.py
   test_01_cancel_host_maintenace_with_no_migration_jobs | `Error` | 308.61 | test_host_maintenance.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895402528


   @blueorangutan test centos7 vmware-67u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-893366897


   <b>Trillian Build Failed (tid-1490)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-907140670


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-905982233


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala removed a comment on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala removed a comment on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895576403


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864926232






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala closed pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala closed pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-895576403


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r658831002



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41510to41600.sql
##########
@@ -19,21 +19,293 @@
 -- Schema upgrade from 4.15.1.0 to 4.16.0.0
 --;
 
--- Adding dynamic scalable flag for service offering table
-ALTER TABLE `cloud`.`service_offering` ADD COLUMN `dynamic_scaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 1  COMMENT 'true(1) if VM needs to be dynamically scalable of cpu or memory';
-DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
-CREATE VIEW `cloud`.`service_offering_view` AS
+
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE;
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `name` varchar(255);
+ALTER TABLE `cloud`.`service_offering` ADD COLUMN `display_text` varchar(4096);

Review comment:
       DEFAULT NULL for display text (keep consistent with _disk_offering_ table details)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-979063878


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1786


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r756603078



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -2086,6 +2006,38 @@ private boolean upgradeRunningVirtualMachine(Long vmId, Long newServiceOfferingI
         return success;
     }
 
+    private void changeDiskOfferingForRootVolume(Long vmId, DiskOfferingVO newDiskOffering, Map<String, String> customParameters) throws ResourceAllocationException {
+
+        List<VolumeVO> vols = _volsDao.findReadyAndAllocatedRootVolumesByInstance(vmId);
+
+        for (final VolumeVO rootVolumeOfVm : vols) {
+            DiskOfferingVO currentRootDiskOffering = _diskOfferingDao.findById(rootVolumeOfVm.getDiskOfferingId());
+            HypervisorType hypervisorType = _volsDao.getHypervisorType(rootVolumeOfVm.getId());
+            if (HypervisorType.Simulator != hypervisorType) {
+                Long minIopsInNewDiskOffering = null;
+                Long maxIopsInNewDiskOffering = null;
+                boolean autoMigrate = false;
+                if (customParameters.containsKey(ApiConstants.MIN_IOPS)) {

Review comment:
       > 
   
   So, only the min and max iops values passed through the API cmd are supported, right?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-979717869


   @sureshanaparti a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r754994744



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -2086,6 +2006,38 @@ private boolean upgradeRunningVirtualMachine(Long vmId, Long newServiceOfferingI
         return success;
     }
 
+    private void changeDiskOfferingForRootVolume(Long vmId, DiskOfferingVO newDiskOffering, Map<String, String> customParameters) throws ResourceAllocationException {
+
+        List<VolumeVO> vols = _volsDao.findReadyAndAllocatedRootVolumesByInstance(vmId);
+
+        for (final VolumeVO rootVolumeOfVm : vols) {
+            DiskOfferingVO currentRootDiskOffering = _diskOfferingDao.findById(rootVolumeOfVm.getDiskOfferingId());
+            HypervisorType hypervisorType = _volsDao.getHypervisorType(rootVolumeOfVm.getId());
+            if (HypervisorType.Simulator != hypervisorType) {
+                Long minIopsInNewDiskOffering = null;
+                Long maxIopsInNewDiskOffering = null;
+                boolean autoMigrate = false;
+                if (customParameters.containsKey(ApiConstants.MIN_IOPS)) {

Review comment:
       what if the new disk offering has min/max iops, and not specified through custom parameters?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-1022772111


   <b>Trillian test result (tid-3016)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 33163 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t3016-kvm-centos7.zip
   Smoke tests completed. 92 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864604332


   @harikrishna-patnala a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-864594959


   @blueorangutan test matrix
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-863759873


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r685695455



##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/volume/ChangeOfferingForVolume.java
##########
@@ -0,0 +1,139 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.volume;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.offering.DiskOffering;
+import com.cloud.storage.Volume;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
+
+@APICommand(name = ChangeOfferingForVolume.APINAME,
+        description = "Change disk offering of the volume and also an option to auto migrate if required to apply the new disk offering",
+        responseObject = VolumeResponse.class,
+        requestHasSensitiveInfo = false,
+        responseHasSensitiveInfo = false,
+        since = "4.16")
+public class ChangeOfferingForVolume extends BaseAsyncCmd implements UserCmd {

Review comment:
       ```suggestion
   public class ChangeOfferingForVolumeCmd extends BaseAsyncCmd implements UserCmd {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5008: Decouple service offering disk offering

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-837015622


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-865183023


   <b>Trillian test result (tid-1021)</b>
   Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 70477 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5008-t1021-vmware-65u2.zip
   Intermittent failure detected: /marvin/tests/smoke/test_accounts.py
   Intermittent failure detected: /marvin/tests/smoke/test_domain_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_nic.py
   Intermittent failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
   Intermittent failure detected: /marvin/tests/smoke/test_resource_accounting.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dhcphosts.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dnsservice.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_iptables_default_policy.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers.py
   Intermittent failure detected: /marvin/tests/smoke/test_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_snapshots.py
   Intermittent failure detected: /marvin/tests/smoke/test_storage_policy.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_deployment_planner.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Smoke tests completed. 75 look OK, 13 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_service_offering_hierarchy | `Failure` | 0.02 | test_accounts.py
   test_01_service_offering_siblings | `Failure` | 0.02 | test_accounts.py
   test_01_create_domain_service_offering | `Error` | 0.07 | test_domain_service_offerings.py
   test_02_edit_domain_service_offering | `Error` | 0.05 | test_domain_service_offerings.py
   ContextSuite context=TestResetVmOnReboot>:setup | `Error` | 0.00 | test_reset_vm_on_reboot.py
   ContextSuite context=TestRAMCPUResourceAccounting>:setup | `Error` | 0.00 | test_resource_accounting.py
   ContextSuite context=TestRouterDHCPHosts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDHCPOpts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDnsService>:setup | `Error` | 0.00 | test_router_dnsservice.py
   ContextSuite context=TestRouterIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestVPCIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestIsolatedNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRedundantIsolateNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRouterServices>:setup | `Error` | 0.00 | test_routers.py
   ContextSuite context=TestServiceOfferings>:setup | `Error` | 1518.34 | test_service_offerings.py
   ContextSuite context=TestSnapshotRootDisk>:setup | `Error` | 0.00 | test_snapshots.py
   test_01_migrate_VM_and_root_volume | `Error` | 124.27 | test_vm_life_cycle.py
   test_02_migrate_VM_with_two_data_disks | `Error` | 109.40 | test_vm_life_cycle.py
   test_01_vapps_vm_cycle | `Error` | 0.21 | test_vm_life_cycle.py
   test_02_attach_volume | `Failure` | 1624.56 | test_volumes.py
   test_02_attach_volume | `Error` | 1624.58 | test_volumes.py
   test_03_download_attached_volume | `Error` | 1.06 | test_volumes.py
   test_04_delete_attached_volume | `Error` | 0.04 | test_volumes.py
   test_05_detach_volume | `Error` | 0.05 | test_volumes.py
   test_06_download_detached_volume | `Error` | 1.06 | test_volumes.py
   test_07_resize_fail | `Error` | 2.17 | test_volumes.py
   test_08_resize_volume | `Error` | 1.06 | test_volumes.py
   test_11_attach_volume_with_unstarted_vm | `Error` | 2.54 | test_volumes.py
   ContextSuite context=TestVolumes>:teardown | `Error` | 19.66 | test_volumes.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5008: Decouple service (compute) offering and disk offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#issuecomment-910171533


   @harikrishna-patnala a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org