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


   ### Description
   
   Fixes #4674 
   
   <!--- 
*********************************************************************************
 -->
   <!--- 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)
   - [ ] 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
   
   - [x] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   
   1. Deploy VM with data disk(s)
   2. Stop VM
   3. Migrate ROOT volume of the VM to another storage pool
   4. Start VM <- VM should successfully start
   
   ```
   (localcloud) SBCM5> > list virtualmachines 
id=88afcb03-b3b8-48f1-913a-f9b8224e16d7 
   {
     "count": 1,
     "virtualmachine": [
       {
         "account": "admin",
         "affinitygroup": [],
         "cpunumber": 1,
         "cpuspeed": 500,
         "cpuused": "0%",
         "created": "2021-03-26T07:12:40+0000",
         "details": {
           "Message.ReservedCapacityFreed.Flag": "false",
           "cpuOvercommitRatio": "2.0",
           "dataDiskController": "osdefault",
           "memoryOvercommitRatio": "1.0",
           "rootDiskController": "lsilogic"
         },
         "diskioread": 0,
         "diskiowrite": 0,
         "diskkbsread": 0,
         "diskkbswrite": 0,
         "displayname": "t1",
         "displayvm": true,
         "domain": "ROOT",
         "domainid": "f4ba1ec0-8dfe-11eb-a621-1e00d1000368",
         "guestosid": "f4ce8b5a-8dfe-11eb-a621-1e00d1000368",
         "haenable": false,
         "hostid": "0ac50654-1bf1-4dce-ae61-3e303b4ca2bc",
         "hostname": "10.0.33.107",
         "hypervisor": "VMware",
         "id": "88afcb03-b3b8-48f1-913a-f9b8224e16d7",
         "instancename": "i-2-3-VM",
         "isdynamicallyscalable": false,
         "memory": 512,
         "memoryintfreekbs": 5120,
         "memorykbs": 524288,
         "memorytargetkbs": 524288,
         "name": "t1",
         "networkkbsread": 0,
         "networkkbswrite": 0,
         "nic": [
           {
             "broadcasturi": "vlan://1638",
             "extradhcpoption": [],
             "gateway": "10.1.1.1",
             "id": "180a8231-142a-4b41-8970-3db230eb9c7f",
             "ipaddress": "10.1.1.54",
             "isdefault": true,
             "isolationuri": "vlan://1638",
             "macaddress": "02:00:78:cd:00:01",
             "netmask": "255.255.255.0",
             "networkid": "1d953710-bdc5-43d6-be18-2b600a5ec9ee",
             "networkname": "net1",
             "secondaryip": [],
             "traffictype": "Guest",
             "type": "Isolated"
           },
           {
             "broadcasturi": "vlan://1631",
             "extradhcpoption": [],
             "gateway": "10.1.1.1",
             "id": "0734faa4-30da-4ebf-b088-0baeac55387e",
             "ipaddress": "10.1.1.94",
             "isdefault": false,
             "isolationuri": "vlan://1631",
             "macaddress": "02:00:1e:cb:00:01",
             "netmask": "255.255.255.0",
             "networkid": "e5c58088-03d9-41b7-9832-04bfe6ff3da0",
             "networkname": "net2",
             "secondaryip": [],
             "traffictype": "Guest",
             "type": "Isolated"
           }
         ],
         "osdisplayname": "Other Linux (64-bit)",
         "ostypeid": "f4ce8b5a-8dfe-11eb-a621-1e00d1000368",
         "passwordenabled": false,
         "rootdeviceid": 0,
         "rootdevicetype": "ROOT",
         "securitygroup": [],
         "serviceofferingid": "2ced6329-96a0-4bad-bdce-9c004501fb03",
         "serviceofferingname": "Small Instance",
         "state": "Running",
         "tags": [],
         "templatedisplaytext": "ma",
         "templateid": "03a2c29f-9d9e-4d74-ad0f-8888ac1db3f7",
         "templatename": "ma",
         "userid": "0c02b74a-8dff-11eb-a621-1e00d1000368",
         "username": "admin",
         "zoneid": "000fb9f9-6d97-4a6e-860f-1875b8270907",
         "zonename": "pr4758-t268-vmware-65u2"
       }
     ]
   }
   (localcloud) SBCM5> > list volumes 
virtualmachineid=88afcb03-b3b8-48f1-913a-f9b8224e16d7 
   {
     "count": 2,
     "volume": [
       {
         "account": "admin",
         "chaininfo": 
"{\"diskDeviceBusName\":\"scsi0:0\",\"diskChain\":[\"[95a458528779364c8d96bd3d35df2392]
 i-2-3-VM/f239c0a2f9c5492bb81dabcd701fc5ce.vmdk\"]}",
         "clusterid": "1fa7097a-204a-4e19-a827-0b4ebd4a14cf",
         "clustername": "p1-c1",
         "created": "2021-03-26T07:17:38+0000",
         "destroyed": false,
         "deviceid": 0,
         "diskioread": 0,
         "diskiowrite": 0,
         "diskkbsread": 0,
         "diskkbswrite": 0,
         "displayvolume": true,
         "domain": "ROOT",
         "domainid": "f4ba1ec0-8dfe-11eb-a621-1e00d1000368",
         "hypervisor": "VMware",
         "id": "3b449766-aee3-49ee-a34b-b91f8561358d",
         "isextractable": false,
         "name": "ROOT-3-0",
         "path": "f239c0a2f9c5492bb81dabcd701fc5ce",
         "physicalsize": 43319296,
         "podid": "94f99c85-3285-4f0e-876d-f5653f97ade4",
         "podname": "Pod1",
         "provisioningtype": "thin",
         "quiescevm": false,
         "serviceofferingdisplaytext": "Small Instance",
         "serviceofferingid": "2ced6329-96a0-4bad-bdce-9c004501fb03",
         "serviceofferingname": "Small Instance",
         "size": 52428800,
         "state": "Ready",
         "storage": "pr4758-t268-vmware-65u2-esxi-pri1",
         "storageid": "95a45852-8779-364c-8d96-bd3d35df2392",
         "storagetype": "shared",
         "tags": [],
         "templatedisplaytext": "ma",
         "templateid": "03a2c29f-9d9e-4d74-ad0f-8888ac1db3f7",
         "templatename": "ma",
         "type": "ROOT",
         "utilization": "82.6%",
         "virtualmachineid": "88afcb03-b3b8-48f1-913a-f9b8224e16d7",
         "virtualsize": 52428800,
         "vmdisplayname": "t1",
         "vmname": "t1",
         "vmstate": "Running",
         "zoneid": "000fb9f9-6d97-4a6e-860f-1875b8270907",
         "zonename": "pr4758-t268-vmware-65u2"
       },
       {
         "account": "admin",
         "attached": "2021-03-26T07:16:54+0000",
         "chaininfo": 
"{\"diskDeviceBusName\":\"scsi0:1\",\"diskChain\":[\"[95a458528779364c8d96bd3d35df2392]
 i-2-3-VM/f2a259f17f644d019ff0f13f2e5db5a0.vmdk\"]}",
         "clusterid": "1fa7097a-204a-4e19-a827-0b4ebd4a14cf",
         "clustername": "p1-c1",
         "created": "2021-03-26T07:16:45+0000",
         "destroyed": false,
         "deviceid": 1,
         "diskioread": 0,
         "diskiowrite": 0,
         "diskkbsread": 0,
         "diskkbswrite": 0,
         "diskofferingdisplaytext": "Small Disk, 5 GB",
         "diskofferingid": "a17dc876-7bf6-4ebb-afa5-205723073343",
         "diskofferingname": "Small",
         "displayvolume": true,
         "domain": "ROOT",
         "domainid": "f4ba1ec0-8dfe-11eb-a621-1e00d1000368",
         "hypervisor": "VMware",
         "id": "548ff64d-5385-41fa-8365-f2593a4551fb",
         "isextractable": true,
         "name": "d1",
         "path": "f2a259f17f644d019ff0f13f2e5db5a0",
         "physicalsize": 0,
         "podid": "94f99c85-3285-4f0e-876d-f5653f97ade4",
         "podname": "Pod1",
         "provisioningtype": "thin",
         "quiescevm": false,
         "size": 5368709120,
         "state": "Ready",
         "storage": "pr4758-t268-vmware-65u2-esxi-pri1",
         "storageid": "95a45852-8779-364c-8d96-bd3d35df2392",
         "storagetype": "shared",
         "tags": [],
         "type": "DATADISK",
         "utilization": "0.0%",
         "virtualmachineid": "88afcb03-b3b8-48f1-913a-f9b8224e16d7",
         "virtualsize": 5368709120,
         "vmdisplayname": "t1",
         "vmname": "t1",
         "vmstate": "Running",
         "zoneid": "000fb9f9-6d97-4a6e-860f-1875b8270907",
         "zonename": "pr4758-t268-vmware-65u2"
       }
     ]
   }
   (localcloud) SBCM5> > stop virtualmachine 
id=88afcb03-b3b8-48f1-913a-f9b8224e16d7 
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "cpunumber": 1,
       "cpuspeed": 500,
       "cpuused": "0%",
       "created": "2021-03-26T07:12:40+0000",
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0",
         "dataDiskController": "osdefault",
         "memoryOvercommitRatio": "1.0",
         "rootDiskController": "lsilogic"
       },
       "diskioread": 0,
       "diskiowrite": 0,
       "diskkbsread": 0,
       "diskkbswrite": 0,
       "displayname": "t1",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "f4ba1ec0-8dfe-11eb-a621-1e00d1000368",
       "guestosid": "f4ce8b5a-8dfe-11eb-a621-1e00d1000368",
       "haenable": false,
       "hypervisor": "VMware",
       "id": "88afcb03-b3b8-48f1-913a-f9b8224e16d7",
       "instancename": "i-2-3-VM",
       "isdynamicallyscalable": false,
       "jobid": "a97c141d-71b8-452e-859a-28868ac11ddc",
       "jobstatus": 0,
       "memory": 512,
       "memoryintfreekbs": 5120,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "t1",
       "networkkbsread": 0,
       "networkkbswrite": 0,
       "nic": [
         {
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "180a8231-142a-4b41-8970-3db230eb9c7f",
           "ipaddress": "10.1.1.54",
           "isdefault": true,
           "macaddress": "02:00:78:cd:00:01",
           "netmask": "255.255.255.0",
           "networkid": "1d953710-bdc5-43d6-be18-2b600a5ec9ee",
           "networkname": "net1",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         },
         {
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "0734faa4-30da-4ebf-b088-0baeac55387e",
           "ipaddress": "10.1.1.94",
           "isdefault": false,
           "macaddress": "02:00:1e:cb:00:01",
           "netmask": "255.255.255.0",
           "networkid": "e5c58088-03d9-41b7-9832-04bfe6ff3da0",
           "networkname": "net2",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "Other Linux (64-bit)",
       "ostypeid": "f4ce8b5a-8dfe-11eb-a621-1e00d1000368",
       "passwordenabled": false,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "serviceofferingid": "2ced6329-96a0-4bad-bdce-9c004501fb03",
       "serviceofferingname": "Small Instance",
       "state": "Stopped",
       "tags": [],
       "templatedisplaytext": "ma",
       "templateid": "03a2c29f-9d9e-4d74-ad0f-8888ac1db3f7",
       "templatename": "ma",
       "userid": "0c02b74a-8dff-11eb-a621-1e00d1000368",
       "username": "admin",
       "zoneid": "000fb9f9-6d97-4a6e-860f-1875b8270907",
       "zonename": "pr4758-t268-vmware-65u2"
     }
   }
   (localcloud) SBCM5> > list storagepools 
filter=id,name,scope,clusterid,clustername,hypervisor
   {
     "count": 2,
     "storagepool": [
       {
         "clusterid": "1fa7097a-204a-4e19-a827-0b4ebd4a14cf",
         "clustername": "p1-c1",
         "id": "4616afa5-447f-3846-bfc9-f7c5108b4c67",
         "name": "pr4758-t268-vmware-65u2-esxi-pri2",
         "scope": "CLUSTER"
       },
       {
         "clusterid": "1fa7097a-204a-4e19-a827-0b4ebd4a14cf",
         "clustername": "p1-c1",
         "id": "95a45852-8779-364c-8d96-bd3d35df2392",
         "name": "pr4758-t268-vmware-65u2-esxi-pri1",
         "scope": "CLUSTER"
       }
     ]
   }
   (localcloud) SBCM5> > migrate volume 
volumeid=3b449766-aee3-49ee-a34b-b91f8561358d 
storageid=4616afa5-447f-3846-bfc9-f7c5108b4c67
   {
     "volume": {
       "account": "admin",
       "clusterid": "1fa7097a-204a-4e19-a827-0b4ebd4a14cf",
       "clustername": "p1-c1",
       "created": "2021-03-26T07:53:57+0000",
       "destroyed": false,
       "deviceid": 0,
       "displayvolume": true,
       "domain": "ROOT",
       "domainid": "f4ba1ec0-8dfe-11eb-a621-1e00d1000368",
       "hypervisor": "VMware",
       "id": "3b449766-aee3-49ee-a34b-b91f8561358d",
       "isextractable": false,
       "name": "ROOT-3-0",
       "path": "fc78a63779bb4ee6bce2f5d47b88ea55",
       "podid": "94f99c85-3285-4f0e-876d-f5653f97ade4",
       "podname": "Pod1",
       "provisioningtype": "thin",
       "quiescevm": false,
       "serviceofferingdisplaytext": "Small Instance",
       "serviceofferingid": "2ced6329-96a0-4bad-bdce-9c004501fb03",
       "serviceofferingname": "Small Instance",
       "size": 52428800,
       "state": "Ready",
       "storage": "pr4758-t268-vmware-65u2-esxi-pri2",
       "storageid": "4616afa5-447f-3846-bfc9-f7c5108b4c67",
       "storagetype": "shared",
       "tags": [],
       "templatedisplaytext": "ma",
       "templateid": "03a2c29f-9d9e-4d74-ad0f-8888ac1db3f7",
       "templatename": "ma",
       "type": "ROOT",
       "virtualmachineid": "88afcb03-b3b8-48f1-913a-f9b8224e16d7",
       "vmdisplayname": "t1",
       "vmname": "t1",
       "vmstate": "Stopped",
       "zoneid": "000fb9f9-6d97-4a6e-860f-1875b8270907",
       "zonename": "pr4758-t268-vmware-65u2"
     }
   }
   (localcloud) SBCM5> > start virtualmachine 
id=88afcb03-b3b8-48f1-913a-f9b8224e16d7 
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "cpunumber": 1,
       "cpuspeed": 500,
       "cpuused": "0%",
       "created": "2021-03-26T07:12:40+0000",
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0",
         "dataDiskController": "osdefault",
         "memoryOvercommitRatio": "1.0",
         "rootDiskController": "lsilogic"
       },
       "diskioread": 0,
       "diskiowrite": 0,
       "diskkbsread": 0,
       "diskkbswrite": 0,
       "displayname": "t1",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "f4ba1ec0-8dfe-11eb-a621-1e00d1000368",
       "guestosid": "f4ce8b5a-8dfe-11eb-a621-1e00d1000368",
       "haenable": false,
       "hostid": "0ac50654-1bf1-4dce-ae61-3e303b4ca2bc",
       "hostname": "10.0.33.107",
       "hypervisor": "VMware",
       "id": "88afcb03-b3b8-48f1-913a-f9b8224e16d7",
       "instancename": "i-2-3-VM",
       "isdynamicallyscalable": false,
       "jobid": "445c10a7-cb0f-4c76-8fe5-96f4f48879ed",
       "jobstatus": 0,
       "memory": 512,
       "memoryintfreekbs": 5120,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "t1",
       "networkkbsread": 0,
       "networkkbswrite": 0,
       "nic": [
         {
           "broadcasturi": "vlan://1638",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "180a8231-142a-4b41-8970-3db230eb9c7f",
           "ipaddress": "10.1.1.54",
           "isdefault": true,
           "isolationuri": "vlan://1638",
           "macaddress": "02:00:78:cd:00:01",
           "netmask": "255.255.255.0",
           "networkid": "1d953710-bdc5-43d6-be18-2b600a5ec9ee",
           "networkname": "net1",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         },
         {
           "broadcasturi": "vlan://1631",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "0734faa4-30da-4ebf-b088-0baeac55387e",
           "ipaddress": "10.1.1.94",
           "isdefault": false,
           "isolationuri": "vlan://1631",
           "macaddress": "02:00:1e:cb:00:01",
           "netmask": "255.255.255.0",
           "networkid": "e5c58088-03d9-41b7-9832-04bfe6ff3da0",
           "networkname": "net2",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "Other Linux (64-bit)",
       "ostypeid": "f4ce8b5a-8dfe-11eb-a621-1e00d1000368",
       "passwordenabled": false,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "serviceofferingid": "2ced6329-96a0-4bad-bdce-9c004501fb03",
       "serviceofferingname": "Small Instance",
       "state": "Running",
       "tags": [],
       "templatedisplaytext": "ma",
       "templateid": "03a2c29f-9d9e-4d74-ad0f-8888ac1db3f7",
       "templatename": "ma",
       "userid": "0c02b74a-8dff-11eb-a621-1e00d1000368",
       "username": "admin",
       "zoneid": "000fb9f9-6d97-4a6e-860f-1875b8270907",
       "zonename": "pr4758-t268-vmware-65u2"
     }
   }
   ```
   
   <!-- 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.

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


Reply via email to