From 320fcb57fa88ff9c0b6bdad24b4c1cd395123624 Mon Sep 17 00:00:00 2001 From: Yedidyah Bar David Date: Wed, 18 Jan 2023 17:22:48 +0200 Subject: [PATCH] Debug appliance virt install failure (#664) * roles: hosted_engine_setup: Log the Local VM console Signed-off-by: Yedidyah Bar David * WIP: Help debug bootstrap VM boot issues - --graphics none: Will prevent creating a vnc console. I think that's ok, at this stage. This should not affect the eventual engine VM conf. So, use the serial console as the main one. - --autoconsole text: Causes virt-install to automatically connect to the VM's console and show it. This should make the console output be included in the ansible log. - --boot hd,bootmenu.enable=on,bios.useserial=on: Allow getting the boot menu, useful for debugging/investigation. Also adds a few seconds to the boot process. Signed-off-by: Yedidyah Bar David Signed-off-by: Yedidyah Bar David --- changelogs/fragments/664-debug-virt-install.yml | 3 +++ changelogs/fragments/664-log-local-vm-console.yml | 3 +++ .../tasks/bootstrap_local_vm/02_create_local_vm.yml | 5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/664-debug-virt-install.yml create mode 100644 changelogs/fragments/664-log-local-vm-console.yml diff --git a/changelogs/fragments/664-debug-virt-install.yml b/changelogs/fragments/664-debug-virt-install.yml new file mode 100644 index 00000000..1413b7b9 --- /dev/null +++ b/changelogs/fragments/664-debug-virt-install.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - he-setup - Run virt-install with options more suitable for debugging (https://github.com/oVirt/ovirt-ansible-collection/pull/664). diff --git a/changelogs/fragments/664-log-local-vm-console.yml b/changelogs/fragments/664-log-local-vm-console.yml new file mode 100644 index 00000000..5d3bb775 --- /dev/null +++ b/changelogs/fragments/664-log-local-vm-console.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - he-setup - Log the output sent to the serial console of the HostedEngineLocal VM to a file on the host, to allow diagnosing failures in that stage (https://github.com/oVirt/ovirt-ansible-collection/pull/664). diff --git a/roles/hosted_engine_setup/tasks/bootstrap_local_vm/02_create_local_vm.yml b/roles/hosted_engine_setup/tasks/bootstrap_local_vm/02_create_local_vm.yml index e02728bb..3a3e94e1 100644 --- a/roles/hosted_engine_setup/tasks/bootstrap_local_vm/02_create_local_vm.yml +++ b/roles/hosted_engine_setup/tasks/bootstrap_local_vm/02_create_local_vm.yml @@ -106,8 +106,9 @@ virt-install -n {{ he_vm_name }}Local --os-variant rhel8.0 --virt-type kvm --memory {{ he_mem_size_MB }} --vcpus {{ he_vcpus }} --network network=default,mac={{ he_vm_mac_addr }},model=virtio --disk {{ local_vm_disk_path }} --import --disk path={{ he_local_vm_dir }}/seed.iso,device=cdrom - --noautoconsole --rng /dev/random --graphics vnc --video vga --sound none --controller usb,model=none - --memballoon none --boot hd,menu=off --clock kvmclock_present=yes + --autoconsole text --rng /dev/random --graphics none --sound none --controller usb,model=none + --memballoon none --boot hd,bootmenu.enable=on,bios.useserial=on --clock kvmclock_present=yes + --serial=pty,log.file=/var/log/libvirt/qemu/HostedEngineLocal-console.log environment: "{{ he_cmd_lang }}" register: create_local_vm changed_when: true