Skip to content

server: allow destroy/recover volumes which are attached to removed vms #5364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 28, 2021

Conversation

weizhouapache
Copy link
Member

Description

This PR fixes #5347

Steps to reproduce the issue on KVM
(1) create a vm, and stop it
(2) stop all cloudstack-agent
(3) expunge the vm. vm is removed, but root volume is in 'Destroy' state.
(4) destroy/expunge the volume, fails.
(5) recover the volume, the volume is restored to ROOT disk and attached the removed vm, therefore we cannot attach to any other vms.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

@weizhouapache weizhouapache changed the title 4.15 volumes attached to removed vms server: allow destroy/recover volumes which are attached to removed vms Aug 24, 2021
@weizhouapache weizhouapache marked this pull request as ready for review August 24, 2021 11:42
@nvazquez nvazquez linked an issue Aug 24, 2021 that may be closed by this pull request
@nvazquez nvazquez added this to the 4.15.2.0 milestone Aug 24, 2021
Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - did not test it

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 999

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian Build Failed (tid-1765)

@nvazquez
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-1769)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 31886 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5364-t1769-kvm-centos7.zip
Smoke tests completed. 87 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@davidjumani davidjumani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After following the steps and destroying a VM, the Volume is in the destroy state
It then can be recovered to a DATADISK or deleted once the agents are brought up

A suggestion - If a root volume is recovered and converted to datadisk, does it make sense to change the name if it contains ROOT ?

@weizhouapache
Copy link
Member Author

After following the steps and destroying a VM, the Volume is in the destroy state
It then can be recovered to a DATADISK or deleted once the agents are brought up

A suggestion - If a root volume is recovered and converted to datadisk, does it make sense to change the name if it contains ROOT ?

thanks for testing @davidjumani

I agree with changing the volume name which sometimes make users confused. Do you have suggestion on the new volume name ?

@davidjumani
Copy link
Contributor

davidjumani commented Aug 27, 2021

@weizhouapache Perhaps just 'DISK' or the VM-NAME-DISK if possible

@weizhouapache
Copy link
Member Author

@weizhouapache Perhaps just 'DISK' or the VM-NAME-DISK if possible

if vm has datadisk as well, it will be a bit confused (VM-NAME-DISK vs VM-NAME-DATADISK).

we can discuss in another thread, this is not what this pr need to fix I think.

@nvazquez nvazquez merged commit 41f6f0e into apache:4.15 Aug 28, 2021
@weizhouapache weizhouapache deleted the 4.15-volumes-attached-to-removed-vms branch December 9, 2022 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot delete volume in Destroy state not attached to Instance
4 participants