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 size/usage not reported #1530

Open
xorbug opened this issue Dec 18, 2024 · 5 comments
Open

volume size/usage not reported #1530

xorbug opened this issue Dec 18, 2024 · 5 comments
Labels
Bug Confirmed to be a bug
Milestone

Comments

@xorbug
Copy link

xorbug commented Dec 18, 2024

Required information

  • Distribution: Debian
  • Distribution version: 12 (bookworm)
  • The output of "incus info":
config:
auth_user_method: unix
environment:
  addresses: []
  architectures:
  - x86_64
  - i686
driver: lxc | qemu
  driver_version: 6.0.2 | 9.0.4
  firewall: nftables
  kernel: Linux
  kernel_architecture: x86_64
  kernel_features:
    idmapped_mounts: "true"
    netnsid_getifaddrs: "true"
    seccomp_listener: "true"
    seccomp_listener_continue: "true"
    uevent_injection: "true"
    unpriv_binfmt: "false"
    unpriv_fscaps: "true"
  kernel_version: 6.1.0-28-amd64
  lxc_features:
    cgroup2: "true"
    core_scheduling: "true"
    devpts_fd: "true"
    idmapped_mounts_v2: "true"
    mount_injection_file: "true"
    network_gateway_device_route: "true"
    network_ipvlan: "true"
    network_l2proxy: "true"
    network_phys_macvlan_mtu: "true"
    network_veth_router: "true"
    pidfd: "true"
    seccomp_allow_deny_syntax: "true"
    seccomp_notify: "true"
    seccomp_proxy_send_notify_fd: "true"
  os_name: Debian GNU/Linux
  os_version: "12"
  project: default
  server: incus
  server_clustered: false
  server_event_mode: full-mesh
  server_pid: 336507
  server_version: "6.8"
  storage: btrfs
  storage_version: "6.2"
  storage_supported_drivers:
  - name: lvm
    version: 2.03.16(2) (2022-05-18) / 1.02.185 (2022-05-18) / 4.47.0
    remote: false
  - name: lvmcluster
    version: 2.03.16(2) (2022-05-18) / 1.02.185 (2022-05-18) / 4.47.0
    remote: true
  - name: btrfs
    version: "6.2"
    remote: false
  - name: dir
    version: "1"
    remote: false

Issue description

Incus reports no size for some volumes (only the ones in a "secondary" pool I have, whatever that means for incus). No usage is shown by incus storage volume list nor info. Compare for list:

# incus storage volume list poolA -c t,U -f compact
    TYPE       USAGE    
  container  1.73GiB    
  container  7.59MiB    
  container  23.71MiB   
  container  36.43MiB   
  container  69.07MiB   
  container  71.71MiB   
  container  142.42MiB  
  container  612.00KiB  
  container  980.00KiB  
  custom     2.76GiB    
  custom     13.48MiB   
  custom     15.86GiB   
  custom     16.00KiB   
  custom     16.00KiB   
  custom     25.06GiB   
  custom     34.69GiB   
  custom     147.53MiB

# incus storage volume list poolB -c t,U -f compact
    TYPE     USAGE  
  container         
  container         
  custom            

Both pools use btrfs backend.

Let me know if more infos are needed and thanks for your support.

@stgraber
Copy link
Member

Can you show incus storage show poolA and incus storage show poolB?
Also the output you're getting in incus monitor --pretty while running incus storage volume list poolB -ctU?

@stgraber stgraber added the Incomplete Waiting on more information from reporter label Dec 18, 2024
@xorbug
Copy link
Author

xorbug commented Dec 18, 2024

# incus storage show poolA                                                                                                                                                                                                                     
config:                                                                         
  source: /mnt/storage/incus                                                    
  volatile.initial_source: /mnt/storage/incus                                   
description: ""                                                                 
name: poolA                                                                     
driver: btrfs                                                                   
used_by:                                                                        
  <volumes list>                                                                
status: Created                                                                 
locations:                                                                      
- none

# incus storage show poolB                                                      
config:                                                                         
  source: 19c152a1-6d86-4d32-b841-1d7c3fda6599                                  
  volatile.initial_source: /dev/vg/data.incus_pool                              
description: ""                                                                 
name: poolB                                                                     
driver: btrfs                                                                   
used_by:                                                                        
  <volumes list>                                                                
status: Created                                                                 
locations:                                                                      
- none

# incus monitor --pretty
Handling API request                          ip=@ method=GET protocol=unix url=/1.0 username=root
Handling API request                          ip=@ method=GET protocol=unix url=/1.0/storage-pools username=root
Handling API request                          ip=@ method=GET protocol=unix url=/1.0 username=root
Handling API request                          ip=@ method=GET protocol=unix url="/1.0/storage-pools/poolB/volumes?filter=&recursion=1" username=root
Handling API request                          ip=@ method=GET protocol=unix url=/1.0/storage-pools/poolB/volumes/container/c1/state username=root
GetInstanceUsage started                      driver=btrfs instance=c1 pool=poolB project=default
GetInstanceUsage finished                     driver=btrfs instance=c1 pool=poolB project=default
Handling API request                          ip=@ method=GET protocol=unix url=/1.0/storage-pools/poolB/volumes/container/c2/state username=root
GetInstanceUsage started                      driver=btrfs instance=c2 pool=poolB project=default
GetInstanceUsage finished                     driver=btrfs instance=c2 pool=poolB project=default                                                                                                                                      
Handling API request                          ip=@ method=GET protocol=unix url=/1.0/storage-pools/poolB/volumes/custom/asdf/state username=root

# incus storage volume list poolB -ctU
+-----------+-------+
|   TYPE    | USAGE |
+-----------+-------+
| container |       |
+-----------+-------+
| container |       |
+-----------+-------+
| custom    |       |
+-----------+-------+
| image     |       |
+-----------+-------+

@stgraber stgraber added Bug Confirmed to be a bug and removed Incomplete Waiting on more information from reporter labels Dec 18, 2024
@stgraber stgraber added this to the incus-6.9 milestone Dec 18, 2024
@thetredev
Copy link

This made me look into my setup as well, and it's the same:

root@incus:~# incus version
Client version: 6.8
Server version: 6.8
root@incus:~# incus storage show default
config:
  source: /mnt/nvme-btrfs/incus/default
description: ""
name: default
driver: dir
used_by:
- /1.0/instances/test
- /1.0/profiles/default
status: Created
locations:
- none
root@incus:~# incus storage volume list default -ctU
+----------------------------+-------+
|            TYPE            | USAGE |
+----------------------------+-------+
| container                  |       |
+----------------------------+-------+
| container (snapshot)       |       |
+----------------------------+-------+

@winiciusallan
Copy link
Contributor

I'm investigating the issue and found this:

# Default storage. Default pool is a LVM driver
$ curl --unix-socket /var/lib/incus/unix.socket incus/1.0/storage-pools/default/volumes/container/u1/state | jq .
{
...,
  "metadata": {
    "usage": {
      "used": 613330944,
      "total": 0
    }
  }
}

# "Secondary" storage. PoolB is a dir driver
$ curl --unix-socket /var/lib/incus/unix.socket incus/1.0/storage-pools/poolB/volumes/container/u2/state | jq .
{
 ...
  "metadata": {
    "usage": null
  }
}

maybe a problem when fetching the usage from the database or when saving the state?

@stgraber
Copy link
Member

stgraber commented Jan 7, 2025

For a container on a dir storage backend, that's normal, unless you've configured your filesystem to use project quotas (filesystem feature supported by xfs and ext4 but needing offline configuration).

We need the underlying filesystem to be able to give us usage data for a full tree which isn't normally possible for the dir backend.

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
Development

No branches or pull requests

4 participants