Skip to content

Quadlet does not seem to support templated volumes #25902

Open
@cyqsimon

Description

@cyqsimon

Issue Description

Quadlet supports templated containers ([email protected]), 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/[email protected]
[Container]
Image=quay.io/podman/hello
ContainerName=foo-%i
Volume=foo@%i.volume:/data:Z
# ~/.config/containers/systemd/[email protected]
# empty file
  1. Instantiate them by creating symlinks:
cd ~/.config/containers/systemd/
ln -s [email protected] [email protected]
ln -s [email protected] [email protected]
  1. Run /usr/lib/systemd/user-generators/podman-user-generator -dryrun

Describe the results you received

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

Describe the results you expected

Quadlet should generate proper template and instance service files for [email protected], and it should be possible to reference them from [email protected].

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/[email protected], but as far as my imagination has taken me, nothing worked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.quadletstale-issuetriagedIssue has been triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions