Skip to content

destroyVirtualMachine API call with expunge set to true returns null in the response #9946

@OlegChuev

Description

@OlegChuev
ISSUE TYPE
  • Bug Report
COMPONENT NAME
API
CLOUDSTACK VERSION
4.18.1.0
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

When VM is destroyed with expunge = true, unexpected response is returned.

STEPS TO REPRODUCE

1. Create any VM.
2. Click Destroy VM and set expunge equal to true.
3. Wait until the destroy process finishes.
4. Check the response.

Screenshot 2024-11-19 at 12 28 14 PM

Screenshot 2024-11-19 at 12 36 23 PM

Screenshot 2024-11-19 at 12 35 10 PM

EXPECTED RESULTS
`destroyVirtualMachine` returns information about destroyed VM as it does for regular destroy
ACTUAL RESULTS
`destroyVirtualMachine` request with following params:

id: 353a646c-e91e-41c9-b916-ac3982a341bb
expunge: true
command: destroyVirtualMachine
response: json

returns unexpected jobresult:

{
    "queryasyncjobresultresponse": {
        "accountid": "41dcfb95-eda5-11ee-8e71-0242ac110002",
        "userid": "41dd1dfc-eda5-11ee-8e71-0242ac110002",
        "cmd": "org.apache.cloudstack.api.command.admin.vm.DestroyVMCmdByAdmin",
        "jobstatus": 1,
        "jobprocstatus": 0,
        "jobresultcode": 0,
        "jobresulttype": "object",
        "jobresult": {
            "null": {                                  // <- Why null? 
                "securitygroup": [],          // <- Why exactly these empty arrays?
                "nic": [],
                "affinitygroup": [],
                "tags": []
            }
        },
        "jobinstancetype": "VirtualMachine",
        "jobinstanceid": "353a646c-e91e-41c9-b916-ac3982a341bb",
        "created": "2024-11-19T10:29:02+0000",
        "completed": "2024-11-19T10:29:10+0000",
        "jobid": "9f623724-1d2c-4cf7-9cc2-5291e49e64a0"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions