shwstppr commented on issue #5412:
URL: https://github.com/apache/cloudstack/issues/5412#issuecomment-914254131


   @kricud this is not a UI issue alone, `listServiceOfferings` when called for 
a running virtualmachine only returns fixed offerings with cpu, memory greater 
than the VM's current offering.
   
   ```
   (localcloud) SBCM5> > list serviceofferings 
filter=id,name,iscustomized,dynamicscalingenabled
   {
     "count": 7,
     "serviceoffering": [
       {
         "dynamicscalingenabled": true,
         "id": "0820dfc7-d843-4120-9df6-ee4e216083f5",
         "iscustomized": false,
         "name": "Small Instance"
       },
       {
         "dynamicscalingenabled": true,
         "id": "b5f4f2a9-8d15-4343-b47b-ca2359a2d9c1",
         "iscustomized": false,
         "name": "Medium Instance"
       },
       {
         "dynamicscalingenabled": true,
         "id": "cd1c9df6-aa02-465c-b967-ddd608f43803",
         "iscustomized": false,
         "name": "ds-offering"
       },
       {
         "dynamicscalingenabled": false,
         "id": "987c045c-ad22-4ccc-b067-7760143952cd",
         "iscustomized": true,
         "name": "CustomConstrained"
       },
       {
         "dynamicscalingenabled": false,
         "id": "86f4ee23-2dbf-4ef5-813a-87275da08374",
         "iscustomized": true,
         "name": "CustomUnconstrained"
       },
       {
         "dynamicscalingenabled": true,
         "id": "2427e097-eee7-4d32-a350-43c613744270",
         "iscustomized": true,
         "name": "CustomConstrained-DS"
       },
       {
         "dynamicscalingenabled": true,
         "id": "03498e66-df42-443f-b8ce-21cf4ebdda2c",
         "iscustomized": true,
         "name": "CustomUnconstrained-DS"
       }
     ]
   }
   (localcloud) SBCM5> > list serviceofferings 
filter=id,name,iscustomized,dynamicscalingenabled 
virtualmachineid=d66b0281-116d-4adc-a854-2616907bed00 
   {
     "count": 1,
     "serviceoffering": [
       {
         "dynamicscalingenabled": true,
         "id": "b5f4f2a9-8d15-4343-b47b-ca2359a2d9c1",
         "iscustomized": false,
         "name": "Medium Instance"
       }
     ]
   }
   (localcloud) SBCM5> > list virtualmachines 
id=d66b0281-116d-4adc-a854-2616907bed00 filter=id,name,state
   {
     "count": 1,
     "virtualmachine": [
       {
         "id": "d66b0281-116d-4adc-a854-2616907bed00",
         "name": "t-ds",
         "state": "Running"
       }
     ]
   }
   (localcloud) SBCM5> > stop virtualmachine 
id=d66b0281-116d-4adc-a854-2616907bed00 
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "cpunumber": 1,
       "cpuspeed": 1000,
       "cpuused": "0%",
       "created": "2021-09-07T12:01:03+0000",
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0",
         "dataDiskController": "osdefault",
         "memoryOvercommitRatio": "1.0",
         "rootDiskController": "osdefault"
       },
       "diskioread": 16,
       "diskiowrite": 0,
       "diskkbsread": 320,
       "diskkbswrite": 5,
       "displayname": "t-ds",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "09046ad8-0bda-11ec-a29c-1e0094000118",
       "guestosid": "0919bbe9-0bda-11ec-a29c-1e0094000118",
       "haenable": false,
       "hypervisor": "VMware",
       "id": "d66b0281-116d-4adc-a854-2616907bed00",
       "instancename": "i-2-6-VM",
       "isdynamicallyscalable": true,
       "jobid": "ab2f3b9a-60e1-44e8-b23a-d82b1df1b3bd",
       "jobstatus": 0,
       "lastupdated": "2021-09-07T12:08:38+0000",
       "memory": 512,
       "memoryintfreekbs": 225280,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "t-ds",
       "networkkbsread": 0,
       "networkkbswrite": 0,
       "nic": [
         {
           "deviceid": "0",
           "extradhcpoption": [],
           "id": "5316ea23-5a8f-4d18-bbe9-fd1d6eba5969",
           "isdefault": true,
           "macaddress": "02:00:04:6c:00:02",
           "networkid": "92345601-9346-4416-b359-1554dd184b9d",
           "networkname": "l2",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "L2"
         }
       ],
       "osdisplayname": "Other Linux (64-bit)",
       "ostypeid": "0919bbe9-0bda-11ec-a29c-1e0094000118",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "cd1c9df6-aa02-465c-b967-ddd608f43803",
       "serviceofferingname": "ds-offering",
       "state": "Stopped",
       "tags": [],
       "templatedisplaytext": "ma-ds",
       "templateid": "4d7add26-6ffd-40b6-bc1f-cd2ba22fea0f",
       "templatename": "ma-ds",
       "userid": "2027b571-0bda-11ec-a29c-1e0094000118",
       "username": "admin",
       "zoneid": "1991b455-cebf-4507-88c4-8c8a467971c3",
       "zonename": "pr4774-t1933-vmware-67u3"
     }
   }
   (localcloud) SBCM5> > list serviceofferings 
filter=id,name,iscustomized,dynamicscalingenabled 
virtualmachineid=d66b0281-116d-4adc-a854-2616907bed00 
   {
     "count": 6,
     "serviceoffering": [
       {
         "dynamicscalingenabled": true,
         "id": "0820dfc7-d843-4120-9df6-ee4e216083f5",
         "iscustomized": false,
         "name": "Small Instance"
       },
       {
         "dynamicscalingenabled": true,
         "id": "b5f4f2a9-8d15-4343-b47b-ca2359a2d9c1",
         "iscustomized": false,
         "name": "Medium Instance"
       },
       {
         "dynamicscalingenabled": false,
         "id": "987c045c-ad22-4ccc-b067-7760143952cd",
         "iscustomized": true,
         "name": "CustomConstrained"
       },
       {
         "dynamicscalingenabled": false,
         "id": "86f4ee23-2dbf-4ef5-813a-87275da08374",
         "iscustomized": true,
         "name": "CustomUnconstrained"
       },
       {
         "dynamicscalingenabled": true,
         "id": "2427e097-eee7-4d32-a350-43c613744270",
         "iscustomized": true,
         "name": "CustomConstrained-DS"
       },
       {
         "dynamicscalingenabled": true,
         "id": "03498e66-df42-443f-b8ce-21cf4ebdda2c",
         "iscustomized": true,
         "name": "CustomUnconstrained-DS"
       }
     ]
   }
   ```
   
   However, you may still scale a running VM to a custom offering using 
`scaleVirtualMachine` API,
   ```
   (localcloud) SBCM5> > scale virtualmachine 
id=d66b0281-116d-4adc-a854-2616907bed00 
serviceofferingid=2427e097-eee7-4d32-a350-43c613744270 details[0].cpuNumber=1 
details[0].memory=640
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "cpunumber": 1,
       "cpuspeed": 1000,
       "cpuused": "0%",
       "created": "2021-09-07T12:01:03+0000",
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuNumber": "1",
         "cpuOvercommitRatio": "2.0",
         "cpuSpeed": "1000",
         "dataDiskController": "osdefault",
         "memory": "640",
         "memoryOvercommitRatio": "1.0",
         "rootDiskController": "osdefault"
       },
       "diskioread": 16,
       "diskiowrite": 0,
       "diskkbsread": 320,
       "diskkbswrite": 5,
       "displayname": "t-ds",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "09046ad8-0bda-11ec-a29c-1e0094000118",
       "guestosid": "0919bbe9-0bda-11ec-a29c-1e0094000118",
       "haenable": false,
       "hypervisor": "VMware",
       "id": "d66b0281-116d-4adc-a854-2616907bed00",
       "instancename": "i-2-6-VM",
       "isdynamicallyscalable": true,
       "lastupdated": "2021-09-07T12:08:38+0000",
       "memory": 640,
       "memoryintfreekbs": 225280,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "t-ds",
       "networkkbsread": 0,
       "networkkbswrite": 0,
       "nic": [
         {
           "deviceid": "0",
           "extradhcpoption": [],
           "id": "5316ea23-5a8f-4d18-bbe9-fd1d6eba5969",
           "isdefault": true,
           "macaddress": "02:00:04:6c:00:02",
           "networkid": "92345601-9346-4416-b359-1554dd184b9d",
           "networkname": "l2",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "L2"
         }
       ],
       "osdisplayname": "Other Linux (64-bit)",
       "ostypeid": "0919bbe9-0bda-11ec-a29c-1e0094000118",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "2427e097-eee7-4d32-a350-43c613744270",
       "serviceofferingname": "CustomConstrained-DS",
       "state": "Stopped",
       "tags": [],
       "templatedisplaytext": "ma-ds",
       "templateid": "4d7add26-6ffd-40b6-bc1f-cd2ba22fea0f",
       "templatename": "ma-ds",
       "userid": "2027b571-0bda-11ec-a29c-1e0094000118",
       "username": "admin",
       "zoneid": "1991b455-cebf-4507-88c4-8c8a467971c3",
       "zonename": "pr4774-t1933-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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to