サーバーの自動インストールとパーティション

サーバーの自動インストールとパーティション

私はクラウド構成風の自動インストールツールについて学んでいます従属自動インストールは機能するが、セクションの設定に従わないという問題が発生し続けますstorage:

自動インストール設定は次のとおりです (ユーザー名、ホスト名、パスワード ハッシュ、SSH キーを除く)。

#cloud-config
autoinstall:
  version: 1
  locale: en_US.UTF-8
  refresh-installer: { update: yes } # Check for updated installer
  storage:
    # ESP + boot + swap + zil placeholder + root
    layout: { name: direct }
    config:
      - type: disk
        match:      # select largest ssd...
          size: largest
          ssd: true
        id: ssd0    # ...and call it ssd0
        ptable: gpt # use gpt partitions on ssd0
        wipe: superblock
      - type: partition # create partitions on ssd0
        number: 1
        id: efi-partition
        device: ssd0
        size: 256M
        flag: boot        # uefi partition needs boot flag
        grub_device: true # and must be the grub device?
      - type: partition
        number: 2
        id: boot-partition
        device: ssd0
        size: 768M
      - type: partition
        number: 3
        id: swap-partition
        device: ssd0
        size: 128G
        flag: swap
      - type: partition
        number: 4
        id: zil-partition
        device: ssd0
        size: 128G
      - type: partition
        number: 5
        id: root-partition
        device: ssd0
        size: 256G
      - type: format # format partitions on ssd0
        id: efi-format
        volume: efi-partition
        fstype: fat32 # ESP gets FAT32
        label: ESP
      - type: format
        id: boot-format
        volume: boot-partition
        fstype: ext4
        label: BOOT
      - type: format
        id: swap-format
        volume: swap-partition
        fstype: swap # swap
        label: SWAP
        flag: swap
      - type: format
        id: root-format
        volume: root-partition
        fstype: xfs # / (root) gets ext4, xfs, btrfs
        label: ROOT
      - type: mount # mount formatted partitions on ssd0
        id: root-mount # / (root) gets mounted first
        device: root-format
        path: /
      - type: mount
        id: boot-mount # /boot gets mounted next
        device: boot-format
        path: /boot
      - type: mount
        id: efi-mount # /boot/efi gets mounted next
        device: efi-format
        path: /boot/efi
  identity:
    hostname: foo
    username: bar
    password: $6$<snip>
  ssh:
    install-server: true
    allow-pw: false
    authorized-keys:
      - ssh-rsa AAAA<snip>
  packages:
    - build-essential
    - git
    - python3-pip
    - tasksel
    - zfsutils-linux

セクションからわかるようにstorage:、いくつかのパーティションを作成しています (このビルドではすべて GPT で、MBR はありません)。

  • FAT32 UEFIシステムパーティション/boot/efi
  • ext2/bootパーティション
  • スワップパーティション
  • ZFS インテント ログ用のプレースホルダー パーティション (自動インストール後に後で追加されます)
  • XFSルートパーティション

Ubuntu の自動インストーラーは検証に合格したようです。proceed-with-autoinstall の yes/no が表示され、インストーラーが実行され、最後に ZFS がインストールされた起動可能なシステムなどがすべて揃います。しかし、パーティションスキームは無視されます代わりに、FAT32 EFIパーティションとExt4ルートパーティションを作成します。ここで何が間違っているのか、またはどのように追跡すればよいのか教えてください。なぜ検証はしていますが、storage:設定は無視されていますか?

答え1

自動インストールファイルのドキュメントがあまり良くない

どちらか:

layout: direct を使用すると、パーティション分割方法を自動的に判断できます。または、config: セクションで希望する設定を行います。

ストレージセクションでレイアウトと構成の両方を実行すると、レイアウトのみが使用され、構成セクションは無視されます。

関連情報