canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.32k stars 926 forks source link

`lxc init|launch` does not pick up `description:` from provided YAML configuration #11436

Closed m-ueberall closed 1 year ago

m-ueberall commented 1 year ago

Required information

Issue description

When specifying the description of a container using a YAML configuration file with lxc init|launch, it gets ignored.

Steps to reproduce

Use a YAML configuration as documented in the lxc init|launch --help examples (it does not matter whether it's a temporary Heredoc or an existing file; moving the description above profiles also has no effect whatsoever, so it's not a case of the last line being ignored):

# lxc init --target nodeNN ubuntu:22.04 c01 << EOF
config:
  boot.autostart: "true"
  boot.autostart.priority: "5"
  raw.idmap: |-
    uid 500 500
    gid 4 4
devices:
  pbuilder:
    optional: "true"
    path: /REDACTED
    source: /REDACTED
    type: disk
profiles:
- default-ovn
description: "Weblate server (Ubuntu 22.04 LTS, amd64/x86_64)"
EOF

Output:

Creating c01
#

Everything but the above description has been picked up:

# lxc config show c01 | grep -E 'boot.autostart|raw.idmap| uid | gid |pbuilder|^description'
  boot.autostart: "true"
  boot.autostart.priority: "5"
  raw.idmap: |-
    uid 500 500
    gid 4 4
  pbuilder:
description: ""
#
Anis-cpu-13 commented 1 year ago

Hello, i would like work on this issue for my first contribution.

tomponline commented 1 year ago

@Anis-cpu-13 thanks!

Anis-cpu-13 commented 1 year ago

@tomponline Hi, I noticed that you created an issue regarding the error "Failed detecting root disk device: No root device could be found" when trying to create an LXD instance with the command "lxc init ubuntu:22.04 c01 << EOF". Could you please provide more details on your setup and any additional steps you may have taken to troubleshoot the issue? Thank you. and this is command : /lxd-test$ lxc init ubuntu:22.04 c01 << EOF config: boot.autostart: "true" boot.autostart.priority: "5" raw.idmap: |- uid 500 500 gid 4 4 devices: pbuilder: optional: "true" path: /REDACTED source: /REDACTED type: disk profiles:

lxd version 5.11

tomponline commented 1 year ago

@Anis-cpu-13 please take a look at https://linuxcontainers.org/lxd/docs/master/howto/initialize/