Support list/query async jobs by resource#12983
Conversation
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12983 +/- ##
==========================================
Coverage 17.60% 17.61%
- Complexity 15674 15691 +17
==========================================
Files 5918 5919 +1
Lines 531727 531986 +259
Branches 65016 65058 +42
==========================================
+ Hits 93595 93692 +97
- Misses 427570 427729 +159
- Partials 10562 10565 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17400 |
|
@blueorangutan test |
|
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15828)
|
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17436 |
|
@nvazquez, did you test this? |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-15851) |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17448 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15856)
|
|
[LL] Trillian Build Failed (tid-7196) |
|
[LL] Trillian Build Failed (tid-7197) |
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM
Tested manually tested with resources VirtualMachine, volume and Domain Router
(localcloud) 🐱 > list asyncjobs resourcetype=VirtualMachine
{
"asyncjobs": [
{
"account": "admin",
"accountid": "ba3b3f8b-34cc-11f1-acb6-1e004900096c",
"cmd": "org.apache.cloudstack.api.command.admin.vm.StopVMCmdByAdmin",
"created": "2026-04-13T09:42:21+0000",
"domainid": "71c5fe3d-34cc-11f1-acb6-1e004900096c",
"domainpath": "ROOT",
"jobid": "f19a2166-a68a-49b0-874f-141680610f14",
"jobinstanceid": "bcdfdc9b-40b1-452e-bb16-d5fc9955d11d",
"jobinstancetype": "VirtualMachine",
"jobprocstatus": 0,
"jobresultcode": 0,
"jobstatus": 0,
"managementserverid": "677c81b1-848c-4e41-b558-268e621b5cb0",
"managementservername": "ref-trl-6206-k-mr9-kiran-chavala-mgmt1.london.shapeblue.com",
"userid": "ba3be37f-34cc-11f1-acb6-1e004900096c"
}
],
"count": 1
}
(localcloud) 🐱 > query asyncjobresult resourcetype=VirtualMachine resourceid=bcdfdc9b-40b1-452e-bb16-d5fc9955d11d
{
"account": "admin",
"accountid": "ba3b3f8b-34cc-11f1-acb6-1e004900096c",
"cmd": "org.apache.cloudstack.api.command.admin.vm.StopVMCmdByAdmin",
"created": "2026-04-13T09:42:21+0000",
"domainid": "71c5fe3d-34cc-11f1-acb6-1e004900096c",
"domainpath": "ROOT",
"jobid": "f19a2166-a68a-49b0-874f-141680610f14",
"jobinstanceid": "bcdfdc9b-40b1-452e-bb16-d5fc9955d11d",
"jobinstancetype": "VirtualMachine",
"jobprocstatus": 0,
"jobresultcode": 0,
"jobstatus": 0,
"managementserverid": "677c81b1-848c-4e41-b558-268e621b5cb0",
"managementservername": "ref-trl-6206-k-mr9-kiran-chavala-mgmt1.london.shapeblue.com",
"userid": "ba3be37f-34cc-11f1-acb6-1e004900096c"
}
(localcloud) 🐱 > query asyncjobresult resourcetype=Volume resourceid=1fb57ca6-1f46-481c-9399-3a7701959824
{
"account": "admin",
"accountid": "ba3b3f8b-34cc-11f1-acb6-1e004900096c",
"cmd": "org.apache.cloudstack.api.command.admin.volume.CreateVolumeCmdByAdmin",
"completed": "2026-04-13T09:43:13+0000",
"created": "2026-04-13T09:43:13+0000",
"domainid": "71c5fe3d-34cc-11f1-acb6-1e004900096c",
"domainpath": "ROOT",
"jobid": "04a88485-6d9a-4d6d-8ee9-0184363695f6",
"jobinstanceid": "1fb57ca6-1f46-481c-9399-3a7701959824",
"jobinstancetype": "Volume",
"jobprocstatus": 0,
"jobresult": {
"volume": {
"account": "admin",
"created": "2026-04-13T09:43:13+0000",
"deleteprotection": false,
"destroyed": false,
"diskofferingdisplaytext": "Small Disk, 5 GB",
"diskofferingid": "d989bd67-bd86-4f3b-b2f2-ebe5adfc0bce",
"diskofferingname": "Small",
"displayvolume": true,
"domain": "ROOT",
"domainid": "71c5fe3d-34cc-11f1-acb6-1e004900096c",
"domainpath": "ROOT",
"hasannotations": false,
"hypervisor": "None",
"id": "1fb57ca6-1f46-481c-9399-3a7701959824",
"isextractable": true,
"jobid": "04a88485-6d9a-4d6d-8ee9-0184363695f6",
"jobstatus": 0,
"name": "test3",
"provisioningtype": "thin",
"quiescevm": false,
"size": 5368709120,
"state": "Allocated",
"storagetype": "shared",
"supportsstoragesnapshot": false,
"tags": [],
"type": "DATADISK",
"zoneid": "3216c980-2f16-497a-be2a-da619f6af683",
"zonename": "ref-trl-6206-k-Mr9-kiran-chavala"
}
},
"jobresultcode": 0,
"jobresulttype": "object",
"jobstatus": 1,
"userid": "ba3be37f-34cc-11f1-acb6-1e004900096c"
(localcloud) 🐱 > list asyncjobs resourcetype=DomainRouter
{
"asyncjobs": [
{
"account": "admin",
"accountid": "ba3b3f8b-34cc-11f1-acb6-1e004900096c",
"cmd": "org.apache.cloudstack.api.command.admin.router.StartRouterCmd",
"created": "2026-04-13T09:46:19+0000",
"domainid": "71c5fe3d-34cc-11f1-acb6-1e004900096c",
"domainpath": "ROOT",
"jobid": "9abbf874-09a1-455d-96d3-c5d99a0b4d1d",
"jobinstanceid": "b8bc1c35-b4d0-4bc5-a1f8-6fcd07e8a31a",
"jobinstancetype": "DomainRouter",
"jobprocstatus": 0,
"jobresultcode": 0,
"jobstatus": 0,
"managementserverid": "677c81b1-848c-4e41-b558-268e621b5cb0",
"managementservername": "ref-trl-6206-k-mr9-kiran-chavala-mgmt1.london.shapeblue.com",
"userid": "ba3be37f-34cc-11f1-acb6-1e004900096c"
}
],
"count": 1
}
(localcloud) 🐱 > query asyncjobresult resourcetype=DomainRouter resourceid=b8bc1c35-b4d0-4bc5-a1f8-6fcd07e8a31a
{
"account": "admin",
"accountid": "ba3b3f8b-34cc-11f1-acb6-1e004900096c",
"cmd": "org.apache.cloudstack.api.command.admin.router.StartRouterCmd",
"created": "2026-04-13T09:46:19+0000",
"domainid": "71c5fe3d-34cc-11f1-acb6-1e004900096c",
"domainpath": "ROOT",
"jobid": "9abbf874-09a1-455d-96d3-c5d99a0b4d1d",
"jobinstanceid": "b8bc1c35-b4d0-4bc5-a1f8-6fcd07e8a31a",
"jobinstancetype": "DomainRouter",
"jobprocstatus": 0,
"jobresultcode": 0,
"jobstatus": 0,
"managementserverid": "677c81b1-848c-4e41-b558-268e621b5cb0",
"managementservername": "ref-trl-6206-k-mr9-kiran-chavala-mgmt1.london.shapeblue.com",
"userid": "ba3be37f-34cc-11f1-acb6-1e004900096c"
}
(localcloud) 🐱 > query asyncjobresult resourcetype=VirtualMachine
🙈 Error: (HTTP 431, error code 4350) Both resourceid and resourcetype required
* Add resource filtering to async job query commands * Fix logical condition in AsyncJobDaoImpl and ResourceIdSupport * resource type case-insensitive validation * fix resource type and id search --------- Co-authored-by: mprokopchuk <mprokopchuk@gmail.com> Co-authored-by: mprokopchuk <mprokopchuk@apple.com>
Description
This PR enhances listAsyncJobs and queryAsyncJobResult API to retrieve asynchronous job for the resources (VM/Volume)
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested the list asyncjobs and query asyncjobresult calls with resourceid and resourcetype params (after performing stop/start vm and migrate volume).
How did you try to break this feature and the system with this change?