![自動サーバーが構成ファイルをインストール - 「ディスクを埋める」構成を自動インストールする方法](https://rvso.com/image/1072194/%E8%87%AA%E5%8B%95%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E3%81%8C%E6%A7%8B%E6%88%90%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%20-%20%E3%80%8C%E3%83%87%E3%82%A3%E3%82%B9%E3%82%AF%E3%82%92%E5%9F%8B%E3%82%81%E3%82%8B%E3%80%8D%E6%A7%8B%E6%88%90%E3%82%92%E8%87%AA%E5%8B%95%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95.png)
クラウド構成ファイル「fill disk」(lvm)を作成しようとしています。 誰かが確認して、何が問題なのか教えてくれませんか?(ubuntu20.4サーバーfoucsのルートボリュームに関するエラーが発生しています)
#cloud-config
autoinstall:
apt:
disable_components: []
geoip: true
preserve_sources_list: false
primary:
- arches:
- amd64
- i386
uri: http://archive.ubuntu.com/ubuntu
- arches:
- default
uri: http://ports.ubuntu.com/ubuntu-ports
identity:
hostname: ubuntu-test
password: $6$XhlhJBcl/bxTQcSDA$BLAJBLAatDUh53b/BOEk1.c38CvU4XdlYjeltLav8EGcjpth/or5N33tLye6Og4TESYHFVr7MQaVGUn1tz2o67/Mm/
realname: scadmin
username: scadmin
kernel:
package: linux-generic
keyboard:
layout: us
toggle: null
variant: ''
locale: en_US.UTF-8
network:
ethernets:
ens160:
dhcp4: true
version: 2
ssh:
allow-pw: true
authorized-keys: []
install-server: true
storage:
config:
- ptable: gpt
path: /dev/sda
wipe: superblock-recursive
preserve: false
name: ''
grub_device: true
type: disk
id: disk-sda
- device: disk-sda
size: 1048576
flag: bios_grub
number: 1
preserve: false
grub_device: false
type: partition
id: partition-0
- device: disk-sda
size: -1
wipe: superblock
flag: ''
number: 2
preserve: false
grub_device: false
type: partition
id: partition-1
- name: vg0
devices:
- partition-1
preserve: false
type: lvm_volgroup
id: lvm_volgroup-0
- name: lv-root
volgroup: lvm_volgroup-0
size: -1
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-0
- name: lv-swap
volgroup: lvm_volgroup-0
size: 4290772992B
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-1
- fstype: ext4
volume: lvm_partition-0
preserve: false
type: format
id: format-2
- path: /
device: format-2
type: mount
id: mount-2
- fstype: swap
volume: lvm_partition-1
preserve: false
type: format
id: format-3
- path: ''
device: format-3
type: mount
id: mount-3
swap:
swap: 0
updates: security
version: 1
答え1
まず、ストレージ構成エントリを再配置して、スワップ論理ボリュームを作成します。
すべてのスペースを使用するルート論理ボリュームを作成します。
- name: lv-root
volgroup: lvm_volgroup-0
size: -1
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-0
それからスワップ論理ボリュームを作成します。
- name: lv-swap
volgroup: lvm_volgroup-0
size: 4290772992B
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-1
インストーラーはこれを好みません。このエラー ログが表示されました (22.04 インストーラーを使用)。
LVM_LogicalVolume(name='lv-root', volgroup=lvm_volgroup-0, size=-1, wipe='superblock', type='lvm_partition', id='lvm_partition-0') has negative size but is not final partition of LVM_VolGroup(name='vg0', devices=[partition-1], type='lvm_volgroup', id='lvm_volgroup-0')
答え2
preserve: false
grub_device: false
type: partition
id: partition-3
- fstype: ext4
volume: partition-3
preserve: false
type: format
id: format-0
- name: lv-swap
volgroup: lvm_volgroup-0
size: 4294967296B
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-0
- name: lv-root
volgroup: lvm_volgroup-0
size: 25765609472B
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-1
- fstype: ext4
volume: lvm_partition-1
preserve: false
type: format
id: format-3
- path: /
device: format-3
type: mount
id: mount-3
- fstype: swap
volume: lvm_partition-0
preserve: false
type: format
id: format-4
- path: ''
device: format-4
type: mount
id: mount-4
- path: /boot
device: format-0
type: mount
id: mount-0