shwstppr opened a new pull request #4946:
URL: https://github.com/apache/cloudstack/pull/4946


   ### Description
   
   Volume can either have an associated disk offering (for DATA disks & ROOT 
disks for VMs created from ISO) or a compute/service offering (for ROOT disks 
of VMs created from templates).
   This fix simplifies and fixes check to return the appropriate response keys 
in these cases.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] 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. -->
   
   Using cmk and API,
   
   ```
   (sblab) 🐱 > list virtualmachines id=872edff3-802a-46d1-9981-6b2804b47e1a 
filter=id,name,templateid,templatedisplaytext,
   {
     "count": 1,
     "virtualmachine": [
       {
         "id": "872edff3-802a-46d1-9981-6b2804b47e1a",
         "name": "isot2",
         "templatedisplaytext": "tinycore",
         "templateid": "7f7c5dd5-0bc6-4615-998e-6eb55d646cf4"
       }
     ]
   }
   (sblab) 🐱 > list isos id=7f7c5dd5-0bc6-4615-998e-6eb55d646cf4 
   {
     "count": 1,
     "iso": [
       {
         "account": "admin",
         "bits": 64,
         "bootable": true,
         "checksum": 
"18a24183958339cb0508a9e27abd81494514469529bf1a4dd0cbc8a3c4d502a94400e6c58b6d54d5043eb2100946f6e85dd7032bc12642e4ab2e8907ed88dbcb",
         "created": "2021-04-23T12:00:10+0000",
         "crossZones": true,
         "directdownload": false,
         "displaytext": "tinycore",
         "domain": "ROOT",
         "domainid": "8a9b356d-a335-11eb-a63c-1e00d8000249",
         "id": "7f7c5dd5-0bc6-4615-998e-6eb55d646cf4",
         "isdynamicallyscalable": false,
         "isextractable": false,
         "isfeatured": true,
         "ispublic": true,
         "isready": true,
         "name": "tinycore",
         "ostypeid": "8aafe64e-a335-11eb-a63c-1e00d8000249",
         "ostypename": "Other Linux (64-bit)",
         "passwordenabled": false,
         "size": 16777216,
         "status": "Successfully Installed",
         "tags": [],
         "url": "http://10.0.3.122/openvm/cloudstack/iso/TinyCore-8.0.iso";,
         "zoneid": "b1946616-c87d-491e-929a-0f0fe6abe75e",
         "zonename": "pr4907-t502-vmware-67u3"
       }
     ]
   }
   ```
   
   **Before change**
   ```
   (sblab) 🐱 > list volumes id=d9a768ec-6f84-4da6-a806-d5c754eda933
   {
     "count": 1,
     "volume": [
       {
         "account": "admin",
         "chaininfo": 
"{\"diskDeviceBusName\":\"ide0:1\",\"diskChain\":[\"[9d7241b74c23379794e2c15cfea67295]
 i-2-9-VM/44282e650eca450bbab25a068f8b7db8.vmdk\"]}",
         "clusterid": "ae4e0495-dab9-4e0b-862b-a56934bb6d32",
         "clustername": "p1-c1",
         "created": "2021-04-23T12:52:53+0000",
         "destroyed": false,
         "deviceid": 0,
         "diskioread": 0,
         "diskiowrite": 0,
         "diskkbsread": 0,
         "diskkbswrite": 0,
         "displayvolume": true,
         "domain": "ROOT",
         "domainid": "8a9b356d-a335-11eb-a63c-1e00d8000249",
         "hypervisor": "VMware",
         "id": "d9a768ec-6f84-4da6-a806-d5c754eda933",
         "isextractable": true,
         "isodisplaytext": "tinycore",
         "isoid": "7f7c5dd5-0bc6-4615-998e-6eb55d646cf4",
         "isoname": "tinycore",
         "name": "ROOT-9",
         "path": "44282e650eca450bbab25a068f8b7db8",
         "podid": "36a2bf5c-4923-4418-a4c8-52f2efa4a52c",
         "podname": "Pod1",
         "provisioningtype": "thin",
         "quiescevm": false,
         "serviceofferingdisplaytext": "Small Disk, 5 GB",
         "serviceofferingid": "9b2de6fa-4a3f-4d46-b9c6-8e3f3c2c0fbc",
         "serviceofferingname": "Small",
         "size": 5368709120,
         "state": "Ready",
         "storage": "pr4907-t502-vmware-67u3-esxi-pri1",
         "storageid": "9d7241b7-4c23-3797-94e2-c15cfea67295",
         "storagetype": "shared",
         "tags": [],
         "type": "ROOT",
         "virtualmachineid": "872edff3-802a-46d1-9981-6b2804b47e1a",
         "vmdisplayname": "isot2",
         "vmname": "isot2",
         "vmstate": "Running",
         "zoneid": "b1946616-c87d-491e-929a-0f0fe6abe75e",
         "zonename": "pr4907-t502-vmware-67u3"
       }
     ]
   }
   ```
   
   **After change**
   ```
   (sblab) 🐱 > list volumes id=d9a768ec-6f84-4da6-a806-d5c754eda933 
   {
     "count": 1,
     "volume": [
       {
         "account": "admin",
         "chaininfo": 
"{\"diskDeviceBusName\":\"ide0:1\",\"diskChain\":[\"[9d7241b74c23379794e2c15cfea67295]
 i-2-9-VM/44282e650eca450bbab25a068f8b7db8.vmdk\"]}",
         "clusterid": "ae4e0495-dab9-4e0b-862b-a56934bb6d32",
         "clustername": "p1-c1",
         "created": "2021-04-23T12:52:53+0000",
         "destroyed": false,
         "deviceid": 0,
         "diskioread": 0,
         "diskiowrite": 0,
         "diskkbsread": 0,
         "diskkbswrite": 0,
         "diskofferingdisplaytext": "Small Disk, 5 GB",
         "diskofferingid": "9b2de6fa-4a3f-4d46-b9c6-8e3f3c2c0fbc",
         "diskofferingname": "Small",
         "displayvolume": true,
         "domain": "ROOT",
         "domainid": "8a9b356d-a335-11eb-a63c-1e00d8000249",
         "hypervisor": "VMware",
         "id": "d9a768ec-6f84-4da6-a806-d5c754eda933",
         "isextractable": true,
         "isodisplaytext": "tinycore",
         "isoid": "7f7c5dd5-0bc6-4615-998e-6eb55d646cf4",
         "isoname": "tinycore",
         "name": "ROOT-9",
         "path": "44282e650eca450bbab25a068f8b7db8",
         "physicalsize": 0,
         "podid": "36a2bf5c-4923-4418-a4c8-52f2efa4a52c",
         "podname": "Pod1",
         "provisioningtype": "thin",
         "quiescevm": false,
         "size": 5368709120,
         "state": "Ready",
         "storage": "pr4907-t502-vmware-67u3-esxi-pri1",
         "storageid": "9d7241b7-4c23-3797-94e2-c15cfea67295",
         "storagetype": "shared",
         "tags": [],
         "type": "ROOT",
         "utilization": "0.0%",
         "virtualmachineid": "872edff3-802a-46d1-9981-6b2804b47e1a",
         "virtualsize": 5368709120,
         "vmdisplayname": "isot2",
         "vmname": "isot2",
         "vmstate": "Running",
         "zoneid": "b1946616-c87d-491e-929a-0f0fe6abe75e",
         "zonename": "pr4907-t502-vmware-67u3"
       }
     ]
   }
   ```
   
   With correct response key, UI shows correct detail in info card,
   ![Screenshot from 2021-04-23 
18-59-43](https://user-images.githubusercontent.com/153340/115878377-1c19bb80-a466-11eb-8ccd-26a0979604c8.png)
   
   
   
   <!-- 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.

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


Reply via email to