Incus top showing weird disk value for cloud-init instances

I noticed that for instances created with cloud-init, the disk usage value is weird. It does not affect instances created with cloud image but without cloud-init.

+--------------------+-------------+------------+-----------+
|   INSTANCE NAME    | CPU TIME(S) |   MEMORY   |   DISK    |
+--------------------+-------------+------------+-----------+
| caddy              | 3.27        | 9.96MiB    | 24.38MiB  |
+--------------------+-------------+------------+-----------+
| nixos              | 58.49       | 28.61MiB   | 836.62MiB |
+--------------------+-------------+------------+-----------+
| noble-app          | 0.03        | 1000.00KiB | 77.00MiB  |
+--------------------+-------------+------------+-----------+
| noble-os           | 3.85        | 15.07MiB   | 303.62MiB |
+--------------------+-------------+------------+-----------+
| ubuntu             | 188.21      | 134.28MiB  | 50.24TiB  |
+--------------------+-------------+------------+-----------+
| ubuntu-cloud-plain | 3.27        | 30.55MiB   | 301.62MiB |
+--------------------+-------------+------------+-----------+
| ubuntu2            | 96.59       | 146.47MiB  | 75.36TiB  |
+--------------------+-------------+------------+-----------+
Press 'd' + ENTER to change delay
Press 's' + ENTER to change sorting method
Press CTRL-C to exit

Delay: 10s
Sorting Method: Alphabetical

The instances ubuntu and ubuntu2 are with cloud-init, while ubuntu-cloud-plain is with same cloud image without cloud-init.

Very odd indeed, Can you show:

  • incus query /1.0/metrics | grep incus_filesystem | grep ubuntu-cloud-plain
  • incus query /1.0/metrics | grep incus_filesystem | grep ubuntu2
~
$ incus query /1.0/metrics | grep incus_filesystem | grep ubuntu-cloud-plain                    administrator@50029
incus_filesystem_avail_bytes{device="default/containers/ubuntu-cloud-plain",fstype="zfs",mountpoint="/",name="ubuntu-cloud-plain",project="default",type="container"} 4.9615863808e+10
incus_filesystem_free_bytes{device="default/containers/ubuntu-cloud-plain",fstype="zfs",mountpoint="/",name="ubuntu-cloud-plain",project="default",type="container"} 4.9615863808e+10
incus_filesystem_size_bytes{device="default/containers/ubuntu-cloud-plain",fstype="zfs",mountpoint="/",name="ubuntu-cloud-plain",project="default",type="container"} 4.993253376e+10

~
$ incus query /1.0/metrics | grep incus_filesystem | grep ubuntu2                               administrator@50029
incus_filesystem_avail_bytes{device="default/containers/ubuntu2",fstype="zfs",mountpoint="/",name="ubuntu2",project="default",type="container"} 4.9378885632e+10
incus_filesystem_avail_bytes{device="/Users/administrator/dotfiles",fstype="0x65735546",mountpoint="/dotfiles",name="ubuntu2",project="default",type="container"} 3.3874475220992e+13
incus_filesystem_avail_bytes{device="/Users/administrator/Downloads",fstype="0x65735546",mountpoint="/downloads",name="ubuntu2",project="default",type="container"} 3.3874475220992e+13
incus_filesystem_avail_bytes{device="/Users/administrator/.ssh",fstype="0x65735546",mountpoint="/ssh-keys",name="ubuntu2",project="default",type="container"} 3.3874475220992e+13
incus_filesystem_free_bytes{device="default/containers/ubuntu2",fstype="zfs",mountpoint="/",name="ubuntu2",project="default",type="container"} 4.9378885632e+10
incus_filesystem_free_bytes{device="/Users/administrator/dotfiles",fstype="0x65735546",mountpoint="/dotfiles",name="ubuntu2",project="default",type="container"} 3.3874475220992e+13
incus_filesystem_free_bytes{device="/Users/administrator/Downloads",fstype="0x65735546",mountpoint="/downloads",name="ubuntu2",project="default",type="container"} 3.3874475220992e+13
incus_filesystem_free_bytes{device="/Users/administrator/.ssh",fstype="0x65735546",mountpoint="/ssh-keys",name="ubuntu2",project="default",type="container"} 3.3874475220992e+13
incus_filesystem_size_bytes{device="default/containers/ubuntu2",fstype="zfs",mountpoint="/",name="ubuntu2",project="default",type="container"} 5.1263438848e+10
incus_filesystem_size_bytes{device="/Users/administrator/dotfiles",fstype="0x65735546",mountpoint="/dotfiles",name="ubuntu2",project="default",type="container"} 6.2747442151424e+13
incus_filesystem_size_bytes{device="/Users/administrator/Downloads",fstype="0x65735546",mountpoint="/downloads",name="ubuntu2",project="default",type="container"} 6.2747442151424e+13
incus_filesystem_size_bytes{device="/Users/administrator/.ssh",fstype="0x65735546",mountpoint="/ssh-keys",name="ubuntu2",project="default",type="container"} 6.2747442151424e+13

I just realised it is not related to cloud-init and has more to do with the profile.

When I edited the additional profile to remove the cloud-init section, it still shows the weird value. Even though the profile is just bunch of disk mounts, nothing special.

$ incus profile show cli2                                                                       administrator@50029
config:
  security.nesting: "true"
description: Ubuntu personal image
devices:
  dotfiles:
    path: /dotfiles
    readonly: "true"
    source: /Users/administrator/dotfiles
    type: disk
  downloads:
    path: /downloads
    source: /Users/administrator/Downloads
    type: disk
  ssh:
    path: /ssh-keys
    readonly: "true"
    source: /Users/administrator/.ssh
    type: disk
name: cli2
used_by:
- /1.0/instances/ubuntu-cloud-plain2
project: default

Launched with

incus launch images:ubuntu/noble/cloud ubuntu-cloud-plain2 -p default -p cli2 

And these are the details about the host filesystem.

 df -h
Filesystem                              Size  Used Avail Use% Mounted on
/dev/root                                58G   11G   47G  18% /
tmpfs                                   2.0G     0  2.0G   0% /dev/shm
tmpfs                                   781M  1.2M  780M   1% /run
tmpfs                                   5.0M     0  5.0M   0% /run/lock
efivarfs                                256K   17K  240K   7% /sys/firmware/efi/efivars
/dev/vda16                              891M   32M  797M   4% /boot
/dev/vda15                               98M  6.4M   92M   7% /boot/efi
tmpfs                                   391M  4.0K  391M   1% /run/user/501
tmpfs                                   100K     0  100K   0% /var/lib/incus/shmounts
tmpfs                                   100K     0  100K   0% /var/lib/incus/guestapi
default/containers/caddy                 46G   25M   46G   1% /var/lib/incus/storage-pools/default/containers/caddy
default/containers/caddy2                46G   25M   46G   1% /var/lib/incus/storage-pools/default/containers/caddy2
default/containers/nixos                 47G  837M   46G   2% /var/lib/incus/storage-pools/default/containers/nixos
default/containers/noble-app             46G   77M   46G   1% /var/lib/incus/storage-pools/default/containers/noble-app
default/containers/noble-app2            46G   77M   46G   1% /var/lib/incus/storage-pools/default/containers/noble-app2
/dev/sr0                                 38M   38M     0 100% /mnt/lima-cidata
default/containers/noble-app3            46G   77M   46G   1% /var/lib/incus/storage-pools/default/containers/noble-app3
default/containers/noble-os              47G  304M   46G   1% /var/lib/incus/storage-pools/default/containers/noble-os
default/containers/noble-os2             47G  305M   46G   1% /var/lib/incus/storage-pools/default/containers/noble-os2
:/Users/administrator                   229G  106G  124G  47% /Users/administrator
:/tmp/colima                            229G  106G  124G  47% /tmp/colima
default/containers/ubuntu                49G  2.7G   46G   6% /var/lib/incus/storage-pools/default/containers/ubuntu
default/containers/ubuntu-cloud-plain    47G  302M   46G   1% /var/lib/incus/storage-pools/default/containers/ubuntu-cloud-plain
default/containers/ubuntu2               48G  1.8G   46G   4% /var/lib/incus/storage-pools/default/containers/ubuntu2
default/containers/ubuntu-cloud-plain2   47G  302M   46G   1% /var/lib/incus/storage-pools/default/containers/ubuntu-cloud-plain2

Okay, so most likely bad filtering on the mountpoint in incus top, that should be an easy fix.

I can confirm that this has been fixed in Incus 6.4.

1 Like