Skip to content

API: listVirtualMachines endpoint doesn't return VMs in Expunged state #8856

Closed

Description

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

VMs in the Expunged state are not returned using the listVirtualMachines endpoint. Even usage of listall and specifying of the state doesn't help. According to docs:
Possible values are: Running, Stopped, Present, Destroyed, Expunged. Present is used for the state equal not destroyed.

STEPS TO REPRODUCE
1) Navigate to https://qa.cloudstack.cloud/simulator/#/vm
2) Create VM
3) Destroy VM
4) Expunge VM
4) Try to retrieve this VM using the API request and admin API and Secret Keys
EXPECTED RESULTS
Either docs are updated or VMs are returned
ACTUAL RESULTS
VMs in the `Expunged` state aren't returned

Activity

  1. OlegChuev commented on Apr 1, 2024

    @OlegChuev
    ContributorAuthor

    BTW I also found out that after the deletion of the VM with a custom Service Offering, ACS cleans up information from the user_vm_details table. Therefore, it's impossible to retrieve information related to the VM instance, such as the amount of RAM, CPU cores, and CPU speed, since it's deleted - Not sure if I should create a separate issue for this one

  2. DaanHoogland commented on Apr 2, 2024

    @DaanHoogland
    Contributor

    @OlegChuev not sure if this is actually desirable. An expunged VM is unrecoverable, so why would we want the user to allow to retrieve information about it?

  3. OlegChuev commented on Apr 2, 2024

    @OlegChuev
    ContributorAuthor

    @DaanHoogland, a list of expunged VMs could be useful for retrieving historical data. For example, users could have the ability to list information about all VMs that have been expunged, allowing them to perform filtering and other actions based on information stored on their side

    In my case, I have a separate tab that displays only Deleted/Expunged VMs. Currently, I retrieve this data by directly accessing the cloud table (as I mentioned in the comment, VMs with custom SO don't work well with this approach). However, it would be really helpful if we could access it via an API

  4. yadvr commented on Apr 30, 2024

    @yadvr
    Member

    @OlegChuev this is possible via tuning these global settings:

    • Allow user expunge recover vm (allow.user.expunge.recover.vm) Determines whether users can expunge or recover their vm
    • Allow user expunge recover volume (allow.user.expunge.recover.volume) Determines whether users can expunge or recover their volume
    • Allow user view destroyed vm (allow.user.view.destroyed.vm) Determines whether users can view their destroyed or expunging vm
  5. locked and limited conversation to collaborators on May 31, 2024
  6. converted this issue into a discussion #9153 on May 31, 2024
  7. added this to the unplanned milestone on Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions