配置文件和 LVM 配置的 LXC preseed.yaml 不断出错

配置文件和 LVM 配置的 LXC preseed.yaml 不断出错

我正在尝试为我们的 LXD 环境创建一个 preseed.yaml,在该环境中,我可以使用配置文件设置具有 80GB 磁盘的虚拟机,并使用 LVM 对分区进行预配置。我已准备好 preseed.yaml 文件,但尝试导入时一直出现错误。

LXD 版本是 5.21

错误:无法解析预置:yaml:解组错误:第 37 行:无法将 !!map 解组为字符串

config: {}
networks:
  - config:
      ipv4.address: 10.146.116.1/24
      ipv4.nat: "true"
      ipv6.address: none
    description: ""
    name: lxdbr0
    type: bridge
    project: default
storage_pools:
  - config:
      source: /var/lib/lxd/disks
    description: ""
    name: default
    driver: dir
profiles:
  - name: lma-vm
    config:
      limits.cpu: "2"
      limits.memory: 16GB
      security.secureboot: "false"
    description: "LVM Configuration for LMA Platform"
    devices:
      root:
        path: /
        pool: default
        size: 80GB
        type: disk
      eth0:
        name: eth0
        nictype: bridged
        parent: lxdbr0
        type: nic
      storage:
        config:
          ptable: gpt
          path: /dev/sda
          wipe: superblock-recursive
          preserve: false
          grub_device: true
          type: disk
          id: disk-sda
          partitions:
            - number: 1
              device: disk-sda
              flag: bios_grub
              size: 1M
              id: bios-grub
              type: partition
            - number: 2
              device: disk-sda
              flag: boot
              size: 1G
              id: sda-boot
              type: partition
            - number: 3
              device: disk-sda
              size: -1
              id: sda-lvm
              type: lvm_volgroup
              name: vg00
              devices: [sda-lvm]
              partitions:
                - id: lvroot
                  name: lvroot
                  size: 20G
                  type: lvm_partition
                  volgroup: vg00
                - id: lvswap
                  name: lvswap
                  size: 4G
                  type: lvm_partition
                  volgroup: vg00
                - id: lvhome
                  name: lvhome
                  size: 5G
                  type: lvm_partition
                  volgroup: vg00
                - id: lvtmp
                  name: lvtmp
                  size: 2G
                  type: lvm_partition
                  volgroup: vg00
                - id: lvdocker
                  name: lvdocker
                  size: 25G
                  type: lvm_partition
                  volgroup: vg00
                - id: lvvar
                  name: lvvar
                  size: 10G
                  type: format
                  fstype: ext4
                  volume: sda-boot
                - id: lv-root-fs
                  type: format
                  fstype: ext4
                  volume: lvroot
                - id: lv-swap-fs
                  type: format
                  fstype: swap
                  volume: lvswap
                - id: lv-home-fs
                  type: format
                  fstype: ext4
                  volume: lvhome
                - id: lv-tmp-fs
                  type: format
                  fstype: ext4

相关内容