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

Volume sub-paths are not counted by Incus #1103

Closed
p-revo opened this issue Aug 11, 2024 · 0 comments · Fixed by #1107
Closed

Volume sub-paths are not counted by Incus #1103

p-revo opened this issue Aug 11, 2024 · 0 comments · Fixed by #1107
Assignees
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Milestone

Comments

@p-revo
Copy link

p-revo commented Aug 11, 2024

Required information

  • Distribution: Debian Bookworm
  • Distribution version: 12
  • The output of "incus info": incus-info.txt
    • Kernel version: 6.1.0-23-amd64
    • LXC version: 6.0.1
    • Incus version: 6.4
    • Storage backend in use: btrfs

Issue description

The incus storage volume list <pool> command outputs wrong numbers in the volume USED-BY column, if any sub-paths of a volume are attached to a container.
As a consequence, inucs also allows to delete a storage volume, while it is still in use by a container
The issue is also mentioned here

Steps to reproduce

$ incus launch images:debian/bookworm deb1
$ incus launch images:debian/bookworm deb2
$ incus storage volume create default demovol
$ incus config device add deb1 demovol disk pool=default source=demovol path=/mnt/demovol
$ incus shell deb1
root@deb1:~# cd /mnt/demovol
root@deb1:/mnt/demovol# mkdir testdir
root@deb1:/mnt/demovol# echo "test" > testdir/testfile
root@deb1:/mnt/demovol# exit
$ incus config device add deb2 demovol disk pool=default source=demovol/testdir path=/mnt/demovolsub
$ incus storage volume list default

The list command now indicates, that the volume tempvol is used by 1 container, while its is actually used by 2 containers (deb1 and deb2). If deb1 now gets removed, the storage volume tempvol can be deleted, even if it is still used by deb2.

@stgraber stgraber self-assigned this Aug 11, 2024
@stgraber stgraber added Bug Confirmed to be a bug Easy Good for new contributors labels Aug 11, 2024
@stgraber stgraber added this to the incus-6.5 milestone Aug 11, 2024
stgraber added a commit to stgraber/incus that referenced this issue Aug 11, 2024
@hallyn hallyn closed this as completed in 1b6d5d9 Aug 12, 2024
decentral1se pushed a commit to decentral1se/incus that referenced this issue Aug 12, 2024
stgraber added a commit that referenced this issue Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Development

Successfully merging a pull request may close this issue.

2 participants