Incus 6.11 - mount order/priority

Hey,

I’m trying to setup opencloud-v2.0.0 on incus-compose I modified incus-compose a lot but now I’m stuck at the mount order/priority.

This is the yaml of devices:

devices:
  0000-opencloud01-opencloud-config:
    path: /etc/opencloud
    pool: default
    source: opencloud01-opencloud-config
    type: disk
  0001-opencloud01-opencloud-data:
    path: /var/lib/opencloud
    pool: default
    source: opencloud01-opencloud-data
    type: disk
  8000-39871ecfb66fcf8e2457fbc3876bbbb1:
    path: /etc/opencloud/app-registry.yaml
    readonly: "true"
    source: /home/jochumdev/Projekte/go/octocompose/charts/apps/opencloud-monolith/files/opencloud/app-registry.yaml
    type: disk
  8001-fc6505d0d4d476a71e8d044d8730d8ec:
    path: /etc/opencloud/csp.yaml
    readonly: "true"
    source: /home/jochumdev/.cache/octocompose/opencloud01/template/bc66831f47489461abd1cd759e9c49b7.yaml
    type: disk
  8002-181ce7f36f522d042f3f80e342f71246:
    path: /etc/opencloud/banned-password-list.txt
    readonly: "true"
    source: /home/jochumdev/Projekte/go/octocompose/charts/apps/opencloud-monolith/files/opencloud/banned-password-list.txt
    type: disk
  8003-87c683982dcb1bf99faf00f497fb0b62:
    path: /etc/opencloud/apps.yaml
    readonly: "true"
    source: /home/jochumdev/.cache/octocompose/opencloud01/template/62af890e42e12634e1d31376837b5049.yaml
    type: disk
  eth0:
    name: eth0
    network: opencloud-net
    type: nic

As you can see I tried to fake the priority with prepending it, doesn’t work it seems. I tried different orderings of those numbers.

Any other way?

Thanks,
René :slight_smile:

P.s.: I love what’s possible with incus and OCI.

Can you look at /run/incus/NAME/lxc.conf for the actual order for the lxc.mount.entry lines, then see if that changes somewhat randomly with every startup or if it’s constant?

Basically Go dicts/maps are randomly sorted but we do have some sorting in some places. I’m wondering if this is an unsorted case or a badly sorted case :wink:

Thanks !

looks not bad, not optimal but not bad.

lxc.mount.entry = /var/lib/incus/devices/opencloud01_opencloud/disk.0000--opencloud01--opencloud--config.etc-opencloud etc/opencloud none bind,create=dir,idmap=container 0 0
lxc.mount.entry = /var/lib/incus/devices/opencloud01_opencloud/disk.8000--39871ecfb66fcf8e2457fbc3876bbbb1.etc-opencloud-app--registry.yaml etc/opencloud/app-registry.yaml none ro,bind,create=file 0 0
lxc.mount.entry = /var/lib/incus/devices/opencloud01_opencloud/disk.8003--87c683982dcb1bf99faf00f497fb0b62.etc-opencloud-apps.yaml etc/opencloud/apps.yaml none ro,bind,create=file 0 0
lxc.mount.entry = /var/lib/incus/devices/opencloud01_opencloud/disk.8002--181ce7f36f522d042f3f80e342f71246.etc-opencloud-banned--password--list.txt etc/opencloud/banned-password-list.txt none ro,bind,create=file 0 0
lxc.mount.entry = /var/lib/incus/devices/opencloud01_opencloud/disk.8001--fc6505d0d4d476a71e8d044d8730d8ec.etc-opencloud-csp.yaml etc/opencloud/csp.yaml none ro,bind,create=file 0 0
lxc.mount.entry = /var/lib/incus/devices/opencloud01_opencloud/disk.0001--opencloud01--opencloud--data.var-lib-opencloud var/lib/opencloud none bind,create=dir,idmap=container 0 0
lxc.sysctl.net.ipv4.ping_group_range = 0 999999999

So you and others know the problems, files don’t show up that are mounted into /etc/opencloud/ - /etc/opencloud is also mounted.

P.s.: Never tried without the /etc/opencloud mount, will test now.

Now i’m overasked, I removed the parent mount.

/dev/nvme0n1p1 on /etc/opencloud/app-registry.yaml type btrfs (ro,relatime,compress=zstd:1,ssd,discard=async,space_cache=v2,user_subvol_rm_allowed,subvolid=257,subvol=/@home)
/dev/nvme0n1p1 on /etc/opencloud/apps.yaml type btrfs (ro,relatime,compress=zstd:1,ssd,discard=async,space_cache=v2,user_subvol_rm_allowed,subvolid=257,subvol=/@home)
/dev/nvme0n1p1 on /etc/opencloud/banned-password-list.txt type btrfs (ro,relatime,compress=zstd:1,ssd,discard=async,space_cache=v2,user_subvol_rm_allowed,subvolid=257,subvol=/@home)
/dev/nvme0n1p1 on /etc/opencloud/csp.yaml type btrfs (ro,relatime,compress=zstd:1,ssd,discard=async,space_cache=v2,user_subvol_rm_allowed,subvolid=257,subvol=/@home)

The files are still not here?

EDIT: Files show up when I remove the parent mount… I tested with other containers.

EDIT2: Solution seems to be shift: true on the files. Ordering in the config map doesn’t account.

Solution for anyone having the same problem

   47  devices:                                                                                                                                                                     
   46  │ 87c683982dcb1bf99faf00f497fb0b62:                                                                                                                                          
   45  │ │ path: /etc/opencloud/apps.yaml                                                                                                                                           
   44  │ │ readonly: "true"                                                                                                                                                         
   43  │ │ shift: "true"                                                                                                                                                            
   42  │ │ source: /home/jochumdev/.cache/octocompose/opencloud01/template/62af890e42e12634e1d31376837b5049.yaml                                                                    
   41  │ │ type: disk                                                                                                                                                               
   40  │ 181ce7f36f522d042f3f80e342f71246:                                                                                                                                          
   39  │ │ path: /etc/opencloud/banned-password-list.txt                                                                                                                            
   38  │ │ readonly: "true"                                                                                                                                                         
   37  │ │ shift: "true"                                                                                                                                                            
   36  │ │ source: /home/jochumdev/Projekte/go/octocompose/charts/apps/opencloud-monolith/files/opencloud/banned-password-list.txt                                                  
   35  │ │ type: disk                                                                                                                                                               
   34  │ 39871ecfb66fcf8e2457fbc3876bbbb1:                                                                                                                                          
   33  │ │ path: /etc/opencloud/app-registry.yaml                                                                                                                                   
   32  │ │ readonly: "true"                                                                                                                                                         
   31  │ │ shift: "true"                                                                                                                                                            
   30  │ │ source: /home/jochumdev/Projekte/go/octocompose/charts/apps/opencloud-monolith/files/opencloud/app-registry.yaml                                                         
   29  │ │ type: disk                                                                                                                                                               
   28  │ eth0:                                                                                                                                                                      
   27  │ │ name: eth0                                                                                                                                                               
   26  │ │ network: opencloud01                                                                                                                                                     
   25  │ │ type: nic                                                                                                                                                                
   24  │ fc6505d0d4d476a71e8d044d8730d8ec:                                                                                                                                          
   23  │ │ path: /etc/opencloud/csp.yaml                                                                                                                                            
   22  │ │ readonly: "true"                                                                                                                                                         
   21  │ │ shift: "true"                                                                                                                                                            
   20  │ │ source: /home/jochumdev/.cache/octocompose/opencloud01/template/bc66831f47489461abd1cd759e9c49b7.yaml                                                                    
   19  │ │ type: disk                                                                                                                                                               
   18  │ opencloud01-opencloud-config:                                                                                                                                              
   17  │ │ path: /etc/opencloud                                                                                                                                                     
   16  │ │ pool: default                                                                                                                                                            
   15  │ │ source: opencloud01-opencloud-config                                                                                                                                     
   14  │ │ type: disk                                                                                                                                                               
   13  │ opencloud01-opencloud-data:                                                                                                                                                
   12  │ │ path: /var/lib/opencloud                                                                                                                                                 
   11  │ │ pool: default                                                                                                                                                            
   10  │ │ source: opencloud01-opencloud-data                                                                                                                                       
    9  │ │ type: disk   

HA!

incus-compose is soon able to run opencloud v2.0.0 from docker-compose.

I have to prettify my patch, then it’s fully capable of running complex compose loads. Needs heavy testing though.