Something like this for 4.2... for 4.1 it would be pretty much the
same, just that in 4.1 the code was in StorageManagerImpl.java

iff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java
b/server/src/com/cloud/storage/VolumeManagerImpl.java
index 1d6b44f..4ef57ed 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -1110,17 +1110,12 @@ public class VolumeManagerImpl extends
ManagerBase implements VolumeManager {
                     "Volume should be in ready state before
attempting a resize");
         }

-        if (!volume.getVolumeType().equals(Volume.Type.DATADISK)) {
-            throw new InvalidParameterValueException(
-                    "Can only resize DATA volumes");
-        }
-
         /*
          * figure out whether or not a new disk offering or size parameter is
          * required, get the correct size value
          */
         if (newDiskOffering == null) {
-            if (diskOffering.isCustomized()) {
+            if (diskOffering.isCustomized() ||
volume.getVolumeType().equals(Volume.Type.ROOT)) {
                 newSize = cmd.getSize();

                 if (newSize == null) {
@@ -1135,6 +1130,10 @@ public class VolumeManagerImpl extends
ManagerBase implements VolumeManager {
                         + " cannot be resized, need to specify a disk
offering");
             }
         } else {
+            if (!volume.getVolumeType().equals(Volume.Type.DATADISK)) {
+                throw new InvalidParameterValueException(
+                    "Can only resize DATA volumes via new disk offering");
+            }

             if (newDiskOffering.getRemoved() != null
                     || !DiskOfferingVO.Type.Disk.equals(newDiskOffering

On Tue, Sep 17, 2013 at 11:02 AM, Marcus Sorensen <shadow...@gmail.com> wrote:
> Yes
>
> On Sep 17, 2013 11:01 AM, "Mike Tutkowski" <mike.tutkow...@solidfire.com>
> wrote:
>>
>> Just checking on something.
>>
>> If you spin up a VM based on an ISO, the ROOT disk size is based on the
>> selected disk offering, right?
>>
>>
>> On Tue, Sep 17, 2013 at 6:33 AM, Antonio Petrocelli <
>> a.petroce...@netsons.com> wrote:
>>
>> > Thanks a lot for reply.
>> >
>> > Do you know how change the code?
>> >
>> > Il 17/09/2013 14:22, Marcus Sorensen ha scritto:
>> >
>> >  You'd need to make minor code changes to remove the check in the code
>> > and
>> >> recompile. It should otherwise work, its just that traditionally root
>> >> disk
>> >> size is based on template size, while data disks are based on disk
>> >> offerings. Not everyone wants root resize, e.g. if they are billing
>> >> based
>> >> on disk offering rather than checking actual vol size.
>> >>
>> >> You could request an enhancement where root resize can be enabled via
>> >> config parameter.
>> >> On Sep 17, 2013 4:28 AM, "Antonio Petrocelli"
>> >> <a.petroce...@netsons.com>
>> >> wrote:
>> >>
>> >>    Hello,
>> >>>
>> >>> is there a way to resize the ROOT disk of a vm?
>> >>>
>> >>> API reply is: *Can only resize DATA volumes*
>> >>>
>> >>> Does anyone know a method to bypass that control?
>> >>>
>> >>> Thanks a lot.
>> >>>
>> >>> Regards.
>> >>>
>> >>>
>> >
>>
>>
>> --
>> *Mike Tutkowski*
>> *Senior CloudStack Developer, SolidFire Inc.*
>> e: mike.tutkow...@solidfire.com
>> o: 303.746.7302
>> Advancing the way the world uses the
>> cloud<http://solidfire.com/solution/overview/?video=play>
>> *™*

Reply via email to