![Servidor automatizado instala arquivo de configuração - Como instalar automaticamente a configuração “preencher disco”](https://rvso.com/image/1072194/Servidor%20automatizado%20instala%20arquivo%20de%20configura%C3%A7%C3%A3o%20-%20Como%20instalar%20automaticamente%20a%20configura%C3%A7%C3%A3o%20%E2%80%9Cpreencher%20disco%E2%80%9D.png)
Estou tentando criar um arquivo de configuração da nuvem “fill disk” (lvm). Alguém pode verificar e me dizer qual é o problema? (obtendo erro relacionado ao volume raiz no servidor 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
Responder1
Crie primeiro seu volume lógico de troca reorganizando as entradas de configuração de armazenamento.
Você cria um volume lógico raiz que utilizará todo o espaço.
- name: lv-root
volgroup: lvm_volgroup-0
size: -1
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-0
Entãovocê cria o volume lógico de troca.
- name: lv-swap
volgroup: lvm_volgroup-0
size: 4290772992B
wipe: superblock
preserve: false
type: lvm_partition
id: lvm_partition-1
O instalador não gosta disso. Recebi este log de erros (usando o instalador 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')
Responder2
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