You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by "OlegChuev (via GitHub)" <gi...@apache.org> on 2024/05/31 07:08:55 UTC

[D] API: listVirtualMachines endpoint doesn't return VMs in Expunged state [cloudstack]

GitHub user OlegChuev created a discussion: API: listVirtualMachines endpoint doesn't return VMs in Expunged state

<!--
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release and main branch are affected too.
Always add information AFTER of these HTML comments, but no need to delete the comments.
-->

##### ISSUE TYPE
<!-- Pick one below and delete the rest -->
 * Bug Report

##### COMPONENT NAME
<!--
Categorize the issue, e.g. API, VR, VPN, UI, etc.
-->
~~~
API
~~~

##### CLOUDSTACK VERSION
<!--
New line separated list of affected versions, commit ID for issues on main branch.
-->

~~~
4.15.2, 4.18.1
~~~

##### CONFIGURATION
<!--
Information about the configuration if relevant, e.g. basic network, advanced networking, etc.  N/A otherwise
-->


##### OS / ENVIRONMENT
<!--
Information about the environment if relevant, N/A otherwise
-->


##### SUMMARY
<!-- Explain the problem/feature briefly -->

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](https://cloudstack.apache.org/api/apidocs-4.19/apis/listVirtualMachines.html):
`Possible values are: Running, Stopped, Present, Destroyed, Expunged. Present is used for the state equal not destroyed.`

##### STEPS TO REPRODUCE
<!--
For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.

For new features, show how the feature would be used.
-->

<!-- Paste example playbooks or commands between quotes below -->
~~~
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
~~~

<!-- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!-- What did you expect to happen when running the steps above? -->

~~~
Either docs are updated or VMs are returned
~~~

##### ACTUAL RESULTS
<!-- What actually happened? -->

<!-- Paste verbatim command output between quotes below -->
~~~
VMs in the `Expunged` state aren't returned
~~~


GitHub link: https://github.com/apache/cloudstack/discussions/9153

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] API: listVirtualMachines endpoint doesn't return VMs in Expunged state [cloudstack]

Posted by "OlegChuev (via GitHub)" <gi...@apache.org>.
GitHub user OlegChuev added a comment to the discussion: API: listVirtualMachines endpoint doesn't return VMs in Expunged state

@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

GitHub link: https://github.com/apache/cloudstack/discussions/9153#discussioncomment-9614619

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] API: listVirtualMachines endpoint doesn't return VMs in Expunged state [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
GitHub user DaanHoogland added a comment to the discussion: API: listVirtualMachines endpoint doesn't return VMs in Expunged state

@OlegChuev , I hope your queries were answered. I moved this issue to the Q&A section. Feel free to continue discussing it or create a new issue, thanks.

GitHub link: https://github.com/apache/cloudstack/discussions/9153#discussioncomment-9614659

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] API: listVirtualMachines endpoint doesn't return VMs in Expunged state [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
GitHub user DaanHoogland added a comment to the discussion: API: listVirtualMachines endpoint doesn't return VMs in Expunged state

@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?

GitHub link: https://github.com/apache/cloudstack/discussions/9153#discussioncomment-9614618

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] API: listVirtualMachines endpoint doesn't return VMs in Expunged state [cloudstack]

Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
GitHub user rohityadavcloud added a comment to the discussion: API: listVirtualMachines endpoint doesn't return VMs in Expunged state

@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

GitHub link: https://github.com/apache/cloudstack/discussions/9153#discussioncomment-9614620

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] API: listVirtualMachines endpoint doesn't return VMs in Expunged state [cloudstack]

Posted by "OlegChuev (via GitHub)" <gi...@apache.org>.
GitHub user OlegChuev added a comment to the discussion: API: listVirtualMachines endpoint doesn't return VMs in Expunged state

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

GitHub link: https://github.com/apache/cloudstack/discussions/9153#discussioncomment-9614617

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org