Incus-compose storage volume not found

I’m playing with an incus cluster, validating what I’m hoping to do with incus in the future. What I’m hoping is to be able to use incus-compose as lightweight configuration as code and define the services, volumes, and networks that’ll be in my cluster through compose.

I have a 3 node cluster with identical hardware, each one with a btrfs storage pool.

I’ve got this compose:

services:
  server:
    image: codeberg.org/forgejo/forgejo:16
    container_name: forgejo
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    volumes:
      - forgejo-data:/data
    ports:
      - '3000:3000'
      - '222:22'

volumes:
  forgejo-data:
    x-incus-compose:
      pool: default

networks:
  default:
    x-incus-compose:
      network: incusbr0

and what i’m getting running incus-compose from my laptop:

22:09 ERR Ensuring resources project=forgejo error="in an operation: instance(forgejo): Failed creating instance record: Failed initializing instance: Failed add validation for device \"vol-forgejo-data\": Failed loading custom volume: Storage volume not found"
ensure   image              codeberg.org/forgejo/forgejo:16        [done]
ensure   image              ghcr.io/lxc/incus-compose/ic-healthd:~ [done]
ensure   network            default                                [done]
ensure   storage-volume     ic-healthd                             [done]
ensure   storage-volume     forgejo-data                           [done]
ensure   instance           forgejo-ic-healthd                     [done]
ensure   instance           forgejo                                [warn: in an operation: Failed creating instance record: Failed initializing instance: ~

Based on the amount of documentation I’m finding, this seems like an unusual configuration?

Hey!

Thanks for the first standalone incus-compose related Forum support Post! Ohh and welcome in the forums!

services:
  server:
    image: codeberg.org/forgejo/forgejo:16
    container_name: forgejo
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    volumes:
      - forgejo-data:/data
    ports:
      - "3000:3000"
      - "222:22"

volumes:
  forgejo-data:

networks:
  default:
    external: true
    x-incus-compose:
      network: incusbr0

Note the exterrnal: true for external networks is important else you get weired results.

r3j0@server01 ~/forgejo> incus remote add --protocol oci codeberg.org https://codeberg.org
r3j0@server01 ~/forgejo> incus-compose up
ensure   image              codeberg.org/forgejo/forgejo:16        [done]
ensure   image              ghcr.io/lxc/incus-compose/ic-healthd:~ [done]
ensure   network            default                                [done]
ensure   storage-volume     forgejo-data                           [done]
ensure   storage-volume     ic-healthd                             [done]
ensure   instance           forgejo-ic-healthd                     [done]
ensure   instance           forgejo                                [done]
start    instance           forgejo-ic-healthd                     [done]
start    instance           forgejo                                [done]

I removed the pool: default as it is not needed here. Having it in doesn’t change my result.

Please give the output of incus storage list

r3j0@server01 ~/forgejo> incus storage list
+---------+--------+-------------+---------+---------+
|  NAME   | DRIVER | DESCRIPTION | USED BY |  STATE  |
+---------+--------+-------------+---------+---------+
| default | btrfs  |             | 129     | CREATED |
+---------+--------+-------------+---------+---------+
| ext1    | btrfs  |             | 4       | CREATED |
+---------+--------+-------------+---------+---------+

As a workaround you could try to create the volume on your own in advance.

incus-compose incus storage volume create default vol-forgejo-data shifted=true