winterhazel commented on PR #12884:
URL: https://github.com/apache/cloudstack/pull/12884#issuecomment-4134645403

   As @abh1sar already tested most of the affected workflows 
(https://github.com/apache/cloudstack/pull/12884#issuecomment-4126358073), I 
focused on testing the remaining one (import of VMs belonging to remote hosts). 
My tests consisted of attempting to import an instance from a remote host using 
both fixed and custom offerings, validating that the process works as intended 
while ensuring that it is not possible to exceed the configured limits.
   
   <details>
   
   <summary>Evidence</summary>
   
   ### Import using a custom offering
   
   ```
   fabricio@fabricio-XPS-13-9310 ~/g/s/d/debbuild (fix-regression-vm-import)> 
cmk -p admin import vm name=test-1 
clusterid=c3e550b6-8ba7-4a83-a9b4-a8b8c237c962 displayname=aaaaaa 
zoneid=5624e7c9-f374-468a-9379-6237fa56ccc7 importsource=external 
hypervisor=kvm host=192.168.32.11 username=root password=password diskpath= 
temppath= serviceofferingid=77204376-3820-45a7-9229-26968c4a7750 
details[0].cpuNumber=1 details[0].cpuSpeed=1000 details[0].memory=512 
domainid=530517b5-1ef5-4c1d-8e61-93c740cd72e9 account=d1 
nicnetworklist[0].nic=0 
nicnetworklist[0].network=ecf4cb79-2d74-4fdb-be24-519fa67e6630
   {
     "account": "admin",
     "accountid": "f3405c8c-17c4-11f1-9235-32e0826870ba",
     "cmd": "org.apache.cloudstack.api.command.admin.vm.ImportVmCmd",
     "completed": "2026-03-26T08:58:41-0300",
     "created": "2026-03-26T08:58:40-0300",
     "domainid": "d1dca945-17c4-11f1-9235-32e0826870ba",
     "domainpath": "ROOT",
     "jobid": "9125a0fb-d775-4cdd-b0db-a56e19dcec3b",
     "jobprocstatus": 0,
     "jobresult": {
       "errorcode": 530,
       "errortext": "VM resource allocation error for account: 
f3887e64-5dd4-46ca-9cd5-bad68f245b2b. Maximum amount of resources of Type = 
'cpu', tag = 'null' for Account Name = d1 in Domain Id = 2 is exceeded: Account 
Resource Limit = 1, Current Account Resource Amount = 1, Current Account 
Resource Reservation = 0, Requested Resource Amount = 1."
     },
     "jobresultcode": 530,
     "jobresulttype": "object",
     "jobstatus": 2,
     "userid": "f340dd7f-17c4-11f1-9235-32e0826870ba"
   }
   🙈 Error: async API failed for job 9125a0fb-d775-4cdd-b0db-a56e19dcec3b
   fabricio@fabricio-XPS-13-9310 ~/g/s/d/debbuild (fix-regression-vm-import) 
[1]> cmk -p admin import vm name=test-1 
clusterid=c3e550b6-8ba7-4a83-a9b4-a8b8c237c962 displayname=aaaaaa 
zoneid=5624e7c9-f374-468a-9379-6237fa56ccc7 importsource=external 
hypervisor=kvm host=192.168.32.11 username=root password=password diskpath= 
temppath= serviceofferingid=77204376-3820-45a7-9229-26968c4a7750 
details[0].cpuNumber=1 details[0].cpuSpeed=1000 details[0].memory=512 
domainid=530517b5-1ef5-4c1d-8e61-93c740cd72e9 account=d1 
nicnetworklist[0].nic=0 
nicnetworklist[0].network=ecf4cb79-2d74-4fdb-be24-519fa67e6630
   {
     "account": "admin",
     "accountid": "f3405c8c-17c4-11f1-9235-32e0826870ba",
     "cmd": "org.apache.cloudstack.api.command.admin.vm.ImportVmCmd",
     "completed": "2026-03-26T08:58:56-0300",
     "created": "2026-03-26T08:58:55-0300",
     "domainid": "d1dca945-17c4-11f1-9235-32e0826870ba",
     "domainpath": "ROOT",
     "jobid": "575eca23-fcca-45fd-89d7-1095b06dec94",
     "jobprocstatus": 0,
     "jobresult": {
       "errorcode": 530,
       "errortext": "VM resource allocation error for account: 
f3887e64-5dd4-46ca-9cd5-bad68f245b2b. Maximum amount of resources of Type = 
'memory', tag = 'null' for Account Name = d1 in Domain Id = 2 is exceeded: 
Account Resource Limit = 600, Current Account Resource Amount = 600, Current 
Account Resource Reservation = 0, Requested Resource Amount = 512."
     },
     "jobresultcode": 530,
     "jobresulttype": "object",
     "jobstatus": 2,
     "userid": "f340dd7f-17c4-11f1-9235-32e0826870ba"
   }
   🙈 Error: async API failed for job 575eca23-fcca-45fd-89d7-1095b06dec94
   fabricio@fabricio-XPS-13-9310 ~/g/s/d/debbuild (fix-regression-vm-import) 
[1]> cmk -p admin import vm name=test-1 
clusterid=c3e550b6-8ba7-4a83-a9b4-a8b8c237c962 displayname=aaaaaa 
zoneid=5624e7c9-f374-468a-9379-6237fa56ccc7 importsource=external 
hypervisor=kvm host=192.168.32.11 username=root password=password diskpath= 
temppath= serviceofferingid=77204376-3820-45a7-9229-26968c4a7750 
details[0].cpuNumber=1 details[0].cpuSpeed=1000 details[0].memory=512 
domainid=530517b5-1ef5-4c1d-8e61-93c740cd72e9 account=d1 
nicnetworklist[0].nic=0 
nicnetworklist[0].network=ecf4cb79-2d74-4fdb-be24-519fa67e6630
   {
     "virtualmachine": {
       "account": "d1",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 1000,
       "created": "2026-03-26T08:59:10-0300",
       "deleteprotection": false,
       "details": {
         "cpuNumber": "1",
         "cpuSpeed": "1000",
         "deployvm": "true",
         "memory": "512",
         "nicAdapter": "virtio",
         "rootDiskController": "virtio"
       },
       "displayname": "aaaaaa",
       "displayvm": true,
       "domain": "d1",
       "domainid": "530517b5-1ef5-4c1d-8e61-93c740cd72e9",
       "domainpath": "/d1/",
       "guestosid": "d1e13ee9-17c4-11f1-9235-32e0826870ba",
       "haenable": false,
       "hasannotations": false,
       "hypervisor": "KVM",
       "id": "8fefeb4a-098c-43a8-abeb-11e370af2e9a",
       "instancename": "i-4-25-VM",
       "isdynamicallyscalable": false,
       "memory": 512,
       "name": "test-1",
       "nic": [
         {
           "broadcasturi": "vlan://125",
           "deviceid": "0",
           "extradhcpoption": [],
           "id": "f383aa48-ac50-4871-b183-7c94456ac240",
           "isdefault": true,
           "isolationuri": "vlan://125",
           "macaddress": "52:54:00:5d:1d:00",
           "networkid": "ecf4cb79-2d74-4fdb-be24-519fa67e6630",
           "networkname": "q",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "L2"
         }
       ],
       "osdisplayname": "CentOS 4.5 (32-bit)",
       "ostypeid": "d1e13ee9-17c4-11f1-9235-32e0826870ba",
       "passwordenabled": false,
       "pooltype": "Filesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "77204376-3820-45a7-9229-26968c4a7750",
       "serviceofferingname": "custom constrained",
       "state": "Stopped",
       "tags": [],
       "templatedisplaytext": "VM Import Default Template",
       "templateformat": "ISO",
       "templateid": "3e2084ff-9a45-4a64-b9bb-5f56b49ba249",
       "templatename": "kvm-default-vm-import-dummy-template",
       "templatetype": "SYSTEM",
       "userid": "28b1c54f-0636-4352-ad04-ee9117135aac",
       "username": "d1",
       "zoneid": "5624e7c9-f374-468a-9379-6237fa56ccc7",
       "zonename": "zn"
     }
   }
   ```
   
   ### Import using a fixed offering
   
   ```
   fabricio@fabricio-XPS-13-9310 ~/g/s/d/debbuild (fix-regression-vm-import) 
[1]> cmk -p admin import vm name=test-1 
clusterid=c3e550b6-8ba7-4a83-a9b4-a8b8c237c962 displayname=aaaaaa 
zoneid=5624e7c9-f374-468a-9379-6237fa56ccc7 importsource=external 
hypervisor=kvm host=192.168.32.11 username=root password=password diskpath= 
temppath= serviceofferingid=de951628-d8b4-41c3-a4f4-0b19b7f1b447 
domainid=530517b5-1ef5-4c1d-8e61-93c740cd72e9 account=d1 
nicnetworklist[0].nic=0 
nicnetworklist[0].network=ecf4cb79-2d74-4fdb-be24-519fa67e6630
   {
     "account": "admin",
     "accountid": "f3405c8c-17c4-11f1-9235-32e0826870ba",
     "cmd": "org.apache.cloudstack.api.command.admin.vm.ImportVmCmd",
     "completed": "2026-03-26T09:01:57-0300",
     "created": "2026-03-26T09:01:57-0300",
     "domainid": "d1dca945-17c4-11f1-9235-32e0826870ba",
     "domainpath": "ROOT",
     "jobid": "6d7f1277-8877-4f19-8cca-0ac5e4c2cb9c",
     "jobprocstatus": 0,
     "jobresult": {
       "errorcode": 530,
       "errortext": "VM resource allocation error for account: 
f3887e64-5dd4-46ca-9cd5-bad68f245b2b. Maximum amount of resources of Type = 
'cpu', tag = 'null' for Account Name = d1 in Domain Id = 2 is exceeded: Account 
Resource Limit = 1, Current Account Resource Amount = 1, Current Account 
Resource Reservation = 0, Requested Resource Amount = 1."
     },
     "jobresultcode": 530,
     "jobresulttype": "object",
     "jobstatus": 2,
     "userid": "f340dd7f-17c4-11f1-9235-32e0826870ba"
   }
   🙈 Error: async API failed for job 6d7f1277-8877-4f19-8cca-0ac5e4c2cb9c
   fabricio@fabricio-XPS-13-9310 ~/g/s/d/debbuild (fix-regression-vm-import) 
[1]> cmk -p admin import vm name=test-3 
clusterid=c3e550b6-8ba7-4a83-a9b4-a8b8c237c962 displayname=aaaaaa 
zoneid=5624e7c9-f374-468a-9379-6237fa56ccc7 importsource=external 
hypervisor=kvm host=192.168.32.11 username=root password=password diskpath= 
temppath= serviceofferingid=de951628-d8b4-41c3-a4f4-0b19b7f1b447 
domainid=530517b5-1ef5-4c1d-8e61-93c740cd72e9 account=d1 
nicnetworklist[0].nic=0 
nicnetworklist[0].network=ecf4cb79-2d74-4fdb-be24-519fa67e6630
   {
     "account": "admin",
     "accountid": "f3405c8c-17c4-11f1-9235-32e0826870ba",
     "cmd": "org.apache.cloudstack.api.command.admin.vm.ImportVmCmd",
     "completed": "2026-03-26T09:03:44-0300",
     "created": "2026-03-26T09:03:44-0300",
     "domainid": "d1dca945-17c4-11f1-9235-32e0826870ba",
     "domainpath": "ROOT",
     "jobid": "35447424-533b-4654-bf29-b7a63d01c4c7",
     "jobprocstatus": 0,
     "jobresult": {
       "errorcode": 530,
       "errortext": "VM resource allocation error for account: 
f3887e64-5dd4-46ca-9cd5-bad68f245b2b. Maximum amount of resources of Type = 
'memory', tag = 'null' for Account Name = d1 in Domain Id = 2 is exceeded: 
Account Resource Limit = 1600, Current Account Resource Amount = 1536, Current 
Account Resource Reservation = 0, Requested Resource Amount = 512."
     },
     "jobresultcode": 530,
     "jobresulttype": "object",
     "jobstatus": 2,
     "userid": "f340dd7f-17c4-11f1-9235-32e0826870ba"
   }
   🙈 Error: async API failed for job 35447424-533b-4654-bf29-b7a63d01c4c7
   fabricio@fabricio-XPS-13-9310 ~/g/s/d/debbuild (fix-regression-vm-import) 
[1]> cmk -p admin import vm name=test-1 
clusterid=c3e550b6-8ba7-4a83-a9b4-a8b8c237c962 displayname=aaaaaa 
zoneid=5624e7c9-f374-468a-9379-6237fa56ccc7 importsource=external 
hypervisor=kvm host=192.168.32.11 username=root password=password diskpath= 
temppath= serviceofferingid=de951628-d8b4-41c3-a4f4-0b19b7f1b447 
domainid=530517b5-1ef5-4c1d-8e61-93c740cd72e9 account=d1 
nicnetworklist[0].nic=0 
nicnetworklist[0].network=ecf4cb79-2d74-4fdb-be24-519fa67e6630
   {
     "virtualmachine": {
       "account": "d1",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "created": "2026-03-26T09:02:16-0300",
       "deleteprotection": false,
       "details": {
         "deployvm": "true",
         "nicAdapter": "virtio",
         "rootDiskController": "virtio"
       },
       "displayname": "aaaaaa",
       "displayvm": true,
       "domain": "d1",
       "domainid": "530517b5-1ef5-4c1d-8e61-93c740cd72e9",
       "domainpath": "/d1/",
       "guestosid": "d1e13ee9-17c4-11f1-9235-32e0826870ba",
       "haenable": false,
       "hasannotations": false,
       "hypervisor": "KVM",
       "id": "7e005112-014f-4cbe-86cb-21380e0a13b9",
       "instancename": "i-4-27-VM",
       "isdynamicallyscalable": false,
       "memory": 512,
       "name": "test-1",
       "nic": [
         {
           "broadcasturi": "vlan://125",
           "deviceid": "0",
           "extradhcpoption": [],
           "id": "d3978211-380d-4293-a899-3cb4186757ac",
           "isdefault": true,
           "isolationuri": "vlan://125",
           "macaddress": "02:01:00:ce:00:08",
           "networkid": "ecf4cb79-2d74-4fdb-be24-519fa67e6630",
           "networkname": "q",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "L2"
         }
       ],
       "osdisplayname": "CentOS 4.5 (32-bit)",
       "ostypeid": "d1e13ee9-17c4-11f1-9235-32e0826870ba",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "de951628-d8b4-41c3-a4f4-0b19b7f1b447",
       "serviceofferingname": "Small Instance",
       "state": "Stopped",
       "tags": [],
       "templatedisplaytext": "VM Import Default Template",
       "templateformat": "ISO",
       "templateid": "3e2084ff-9a45-4a64-b9bb-5f56b49ba249",
       "templatename": "kvm-default-vm-import-dummy-template",
       "templatetype": "SYSTEM",
       "userid": "28b1c54f-0636-4352-ad04-ee9117135aac",
       "username": "d1",
       "zoneid": "5624e7c9-f374-468a-9379-6237fa56ccc7",
       "zonename": "zn"
     }
   }
   ```
   
   </details>
   
   Only the unit tests suggested at 
https://github.com/apache/cloudstack/pull/12884#discussion_r2985297747 are 
pending 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: [email protected]

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

Reply via email to