Skip to content

Quadlet does not seem to support templated volumes #25902

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

Open
cyqsimon opened this issue Apr 17, 2025 · 2 comments
Open

Quadlet does not seem to support templated volumes #25902

cyqsimon opened this issue Apr 17, 2025 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. quadlet triaged Issue has been triaged

Comments

@cyqsimon
Copy link

Issue Description

Quadlet supports templated containers (name@.container), and it's often the case that each instantiated container would need its own separate volume storage, but Quadlet doesn't seem to have support for that. This heavily limits the usefulness of the templating feature.

Steps to reproduce the issue

  1. Prepare the following two files:
# ~/.config/containers/systemd/foo@.container
[Container]
Image=quay.io/podman/hello
ContainerName=foo-%i
Volume=foo@%i.volume:/data:Z
# ~/.config/containers/systemd/foo@.volume
# empty file
  1. Instantiate them by creating symlinks:
cd ~/.config/containers/systemd/
ln -s foo@.container foo@alpha.container
ln -s foo@.volume foo@alpha.volume
  1. Run /usr/lib/systemd/user-generators/podman-user-generator -dryrun

Describe the results you received

  1. The generated volume template is foo@-volume.service rather than foo-volume@.service, and the generated volume instance is foo@alpha-volume.service rather than foo-volume@alpha.service
  2. Error while generating template and instance for foo@.container:
quadlet-generator[14324]: converting "foo@.container": requested Quadlet source foo@%i.volume was not found
converting "foo@alpha.container": requested Quadlet source foo@%i.volume was not found

Describe the results you expected

Quadlet should generate proper template and instance service files for foo@.volume, and it should be possible to reference them from foo@.container.

podman info output

host:
  arch: amd64
  buildahVersion: 1.39.4
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-1:2.1.13-1
    path: /usr/bin/conmon
    version: 'conmon version 2.1.13, commit: 82de887596ed8ee6d9b2ee85e4f167f307bb569b'
  cpuUtilization:
    idlePercent: 92.89
    systemPercent: 1.97
    userPercent: 5.14
  cpus: 12
  databaseBackend: sqlite
  distribution:
    distribution: endeavouros
    version: unknown
  eventLogger: journald
  freeLocks: 2048
  hostname: p15-cyq
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.12.23-1-lts
  linkmode: dynamic
  logDriver: journald
  memFree: 1639112704
  memTotal: 33479847936
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.14.0-1
      path: /usr/lib/podman/aardvark-dns
      version: aardvark-dns 1.14.0
    package: netavark-1.14.1-1
    path: /usr/lib/podman/netavark
    version: netavark 1.14.1
  ociRuntime:
    name: crun
    package: crun-1.21-1
    path: /usr/bin/crun
    version: |-
      crun version 1.21
      commit: 10269840aa07fb7e6b7e1acff6198692d8ff5c88
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-2025_03_20.32f6212-1
    version: ""
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  rootlessNetworkCmd: pasta
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /etc/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.3.2-1
    version: |-
      slirp4netns version 1.3.2
      commit: 0f13345bcef588d2bb70d662d41e92ee8a816d85
      libslirp: 4.9.0
      SLIRP_CONFIG_VERSION_MAX: 6
      libseccomp: 2.5.6
  swapFree: 36480126976
  swapTotal: 36507217920
  uptime: 1h 43m 40.00s (Approximately 0.04 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/cyq/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/cyq/.local/share/containers/storage
  graphRootAllocated: 985553436672
  graphRootUsed: 777830334464
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 421
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/cyq/.local/share/containers/storage/volumes
version:
  APIVersion: 5.4.2
  Built: 1743626407
  BuiltTime: Thu Apr  3 04:40:07 2025
  GitCommit: be85287fcf4590961614ee37be65eeb315e5d9ff
  GoVersion: go1.24.1
  Os: linux
  OsArch: linux/amd64
  Version: 5.4.2

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

ArchLinux x86_64. Everything is latest.

Additional information

You can play around with trying to set a custom templated volume name in ~/.config/containers/systemd/foo@.volume, but as far as my imagination has taken me, nothing worked.

@cyqsimon cyqsimon added the kind/bug Categorizes issue or PR as related to a bug. label Apr 17, 2025
@Luap99 Luap99 added quadlet triaged Issue has been triaged labels Apr 17, 2025
@Luap99
Copy link
Member

Luap99 commented Apr 17, 2025

I assume that is the same problem as described in #23215 (just for volumes instead of networks)
cc @ygalblum

@ygalblum
Copy link
Contributor

@Luap99 yes it is. The issue is with resolving the connection between different templated Quadlet units of all types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. quadlet triaged Issue has been triaged
Projects
None yet
Development

No branches or pull requests

3 participants