Start collecting logs from virt-install

This commit is contained in:
Alexander Todorov 2023-07-17 11:07:52 +03:00 committed by Ondřej Budai
parent ee0c7b53dc
commit 38ed9a39be
4 changed files with 39 additions and 8 deletions

View file

@ -355,6 +355,10 @@ sudo qemu-img create -f qcow2 "${LIBVIRT_IMAGE_PATH}" 20G
#########################
# Install image via anaconda.
VIRT_LOG="$ARTIFACTS/installers-sh-virt-install-console.log"
touch "$VIRT_LOG"
sudo chown qemu:qemu "$VIRT_LOG"
greenprint "💿 Install image via installer(ISO) on VM"
sudo virt-install --name="${IMAGE_KEY}"\
--disk path="${LIBVIRT_IMAGE_PATH}",format=qcow2 \
@ -367,7 +371,8 @@ sudo virt-install --name="${IMAGE_KEY}"\
--nographics \
--noautoconsole \
--wait=-1 \
--noreboot
--noreboot \
--console pipe,source.path="$VIRT_LOG"
# Start VM.

View file

@ -283,6 +283,14 @@ sudo composer-cli blueprints delete minimal-raw > /dev/null
greenprint "👿 Running restorecon on image directory"
sudo restorecon -Rv /var/lib/libvirt/images/
# create artifacts folder
ARTIFACTS="${ARTIFACTS:=/tmp/artifacts}"
mkdir -p "${ARTIFACTS}"
VIRT_LOG="$ARTIFACTS/minimal-raw-virt-install-console.log"
touch "$VIRT_LOG"
sudo chown qemu:qemu "$VIRT_LOG"
##################################################################
##
## Install and test minimal-raw image (UEFI)
@ -300,7 +308,9 @@ sudo virt-install --name="${IMAGE_KEY}-uefi"\
--noautoconsole \
--wait=-1 \
--import \
--noreboot
--noreboot \
--console pipe,source.path="$VIRT_LOG"
# Start VM.
greenprint "💻 Start UEFI VM"

View file

@ -59,7 +59,8 @@ EOF
TEST_UUID=$(uuidgen)
IMAGE_KEY="oscap-${TEST_UUID}"
HTTP_GUEST_ADDRESS=192.168.100.50
ARTIFACTS="ci-artifacts"
# create artifacts folder
ARTIFACTS="${ARTIFACTS:=/tmp/artifacts}"
mkdir -p "${ARTIFACTS}"
# Set up temporary files.
@ -303,6 +304,10 @@ sudo restorecon -Rv /var/lib/libvirt/images/
greenprint "💿 Creating a cloud-init ISO"
gen_iso
VIRT_LOG="$ARTIFACTS/oscap-sh-virt-install-console.log"
touch "$VIRT_LOG"
sudo chown qemu:qemu "$VIRT_LOG"
greenprint "📋 Install baseline image"
VIRSH_DOMAIN="${IMAGE_KEY}-baseline"
sudo virt-install --name="${VIRSH_DOMAIN}"\
@ -317,7 +322,8 @@ sudo virt-install --name="${VIRSH_DOMAIN}"\
--noautoconsole \
--nographics \
--wait=15 \
--noreboot
--noreboot \
--console pipe,source.path="$VIRT_LOG"
# Installation can get stuck, destroying VM helps
# See https://github.com/osbuild/osbuild-composer/issues/2413