Skip to content
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

Cannot delete volumes if its dir is not present #3227

Closed
StyXman opened this issue Dec 11, 2019 · 1 comment
Closed

Cannot delete volumes if its dir is not present #3227

StyXman opened this issue Dec 11, 2019 · 1 comment

Comments

@StyXman
Copy link

StyXman commented Dec 11, 2019

  • Distribution: Ubuntu
  • Distribution version: 16.04 LTS Xenial Xerus
  • The output of
    • lxc-start --version: 3.0.3

Issue description

I had several Volumes in a Dir backed Pool. For some reason the Directory for the Pool (and hence the Volumes) went away (I only rebooted the host; maybe it was deleted long ago by a coworker, but lxc hold to the Dir?). Then I tried to destroy the Volumes both via terraform and lxc storage volume delete command. Both reported the Volumes were deleted, but listing them with lxc storage volume list still showed them.

I started looking around and found the Pool Dir was missing. I created the Pool and Volume Dirs with sudo mkdir -pv /var/snap/lxd/common/lxd/storage-pools/local/custom/CWDC-CLDN-0{1,2,3,4,5,6}-cloudian00{1,2,3,4} and run again lxc storage volume delete on them and it worked.

Steps to reproduce

  1. Create some empty Volumes on a Dir backed Pool
  2. Remove the Pool Dir.
  3. Delete the Volume
  4. List Volumes.
@stgraber
Copy link
Member

We've replaced that logic in recent LXD releases so things should error more consistently now.
For those that do have volumes that are missing on disk, manually re-creating them is indeed the way to make LXD happy with deleting them for good.

I would expect lxc storage volume delete to fail now as our error handling logic is much more comprehensive and tested.

Closing as this should have been sorted now. Also because this issue was filed against the wrong repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants