[FIX] script qemu: no cloud-init package install (Fedora hang) + bigger disk
Fedora install stalled: the log stopped right after boot with no exit marker. Cause: cloud-init was running "dnf -y install qemu-guest-agent openssh-server" at first boot; on this host's slow VM network that dnf took many minutes (metadata refresh + download), so cloud-init stayed "running" and the install (which waits for cloud-init) never proceeded. Fix: do NOT install any package via cloud-init. sshd is already present in every cloud image (verified Ubuntu/Debian/Fedora/Arch) and is just enabled via runcmd; the tools (curl/git/make…) are installed by the ERPLibre bootstrap with optimised mirrors. cloud-init now finishes in seconds (Fedora: "status: done" at 10s instead of blocking 5+ min). --package still adds a cloud-init packages block on demand. Also: when ERPLibre is installed via the infra menu, add ERPLIBRE_EXTRA_DISK_GB (5G) to each VM's disk, because the image minimum left only ~97 MB free after installation. Drop the now-useless "--package git" (the bootstrap installs git). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
137f4245ec
commit
deddaeb6a9
2 changed files with 23 additions and 13 deletions
|
|
@ -803,18 +803,19 @@ def build_cloud_config(
|
|||
lines.append(f"package_update: {'true' if do_update else 'false'}")
|
||||
lines.append(f"package_upgrade: {'true' if do_upgrade else 'false'}")
|
||||
|
||||
# Serveur SSH : garantit sa présence sur toutes les distros (les images
|
||||
# Debian genericcloud notamment ne l'activent pas toujours). Le nom du
|
||||
# paquet diffère : « openssh » sur Arch, « openssh-server » ailleurs —
|
||||
# sans quoi cloud-init échoue (paquet introuvable -> status: error).
|
||||
ssh_pkg = "openssh" if args.distro == "arch" else "openssh-server"
|
||||
packages = ["qemu-guest-agent", ssh_pkg, *args.package]
|
||||
lines.append("packages:")
|
||||
lines += [
|
||||
f" - {p}" for p in dict.fromkeys(packages)
|
||||
] # dédoublonne, ordre gardé
|
||||
# On n'installe AUCUN paquet via cloud-init : cela exige le réseau au 1er
|
||||
# boot et peut bloquer longtemps (dnf/apt/pacman lents sur réseau lent) —
|
||||
# cloud-init reste alors « running » et tout ce qui suit attend. sshd est
|
||||
# DÉJÀ présent dans toutes les images cloud (Ubuntu/Debian/Fedora/Arch) ;
|
||||
# on l'active seulement (runcmd). Les outils nécessaires (curl/git/make…)
|
||||
# sont installés — avec dépôts optimisés — par le bootstrap d'installation.
|
||||
packages = list(dict.fromkeys(args.package)) # seulement --package
|
||||
if packages:
|
||||
lines.append("packages:")
|
||||
lines += [f" - {p}" for p in packages]
|
||||
# Active et démarre SSH quel que soit le nom du service (ssh sur
|
||||
# Debian/Ubuntu, sshd sur Fedora) — sans quoi la VM peut booter sans SSH.
|
||||
# Debian/Ubuntu, sshd sur Fedora/Arch) — sans quoi la VM peut booter
|
||||
# sans SSH accessible.
|
||||
lines += [
|
||||
"runcmd:",
|
||||
" - systemctl enable --now ssh 2>/dev/null"
|
||||
|
|
|
|||
|
|
@ -1643,6 +1643,9 @@ class TODO:
|
|||
|
||||
# Cible d'installation Odoo exécutée dans la VM (défaut ERPLibre 1.6.0).
|
||||
ERPLIBRE_ODOO_TARGET = "install_odoo_18"
|
||||
# Go ajoutés au disque quand on installe ERPLibre (le minimum d'image ne
|
||||
# laisse que ~97 Mo libres après l'installation).
|
||||
ERPLIBRE_EXTRA_DISK_GB = 5
|
||||
|
||||
@staticmethod
|
||||
def _qemu_wait_ssh(ip, user="erplibre", timeout=180):
|
||||
|
|
@ -1942,7 +1945,7 @@ class TODO:
|
|||
script_path = self._qemu_script_path()
|
||||
deployed = []
|
||||
jobs = [] # (name, parts) des VM à créer
|
||||
for d, v, _ram, _disk in selected:
|
||||
for d, v, _ram, disk in selected:
|
||||
name = self._qemu_infra_name(d, v)
|
||||
if self._qemu_domain_exists(name):
|
||||
print(f"⏭ {name}: {t('already exists, skipped.')}")
|
||||
|
|
@ -1966,7 +1969,13 @@ class TODO:
|
|||
if ssh_key:
|
||||
parts += ["--ssh-key", ssh_key]
|
||||
if install_branch:
|
||||
parts += ["--package", "git"]
|
||||
# ERPLibre dépasse le minimum : +5 Go de disque (sinon il ne
|
||||
# reste que ~97 Mo après l'installation). git/make sont posés
|
||||
# par le bootstrap (pas via cloud-init, trop lent au boot).
|
||||
bigger = (
|
||||
self._parse_disk_gb(disk) + self.ERPLIBRE_EXTRA_DISK_GB
|
||||
)
|
||||
parts += ["--disk-size", f"{bigger}G"]
|
||||
parts.append("-y")
|
||||
jobs.append((name, parts))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue