Store console output to logfile on kvm guests

This commit is contained in:
Timo Makinen 2020-08-26 20:12:12 +03:00
parent 40963ea620
commit 6bf4815503

View file

@ -5,6 +5,7 @@
vars:
letters: "{{ 'bcdefghijklmnopqrstuvwxyz'|list }}"
console_log: "/var/log/libvirt/qemu/{{ inventory_hostname }}.console.log"
vmhost_uri: "qemu+ssh://root@{{ vmhost }}/system"
root_pubkey: "{{ lookup('file', '/srv/ansible-private/ssh/id_rsa.pub') }}"
extra_disks: >-
@ -62,7 +63,8 @@
command: >
virt-install --connect {{ vmhost_uri }} \
--name {{ inventory_hostname }} \
--graphics none --boot useserial=on --serial pty --noautoconsole \
--graphics none --boot useserial=on --noautoconsole \
--serial pty,log.file={{ console_log }} \
--controller usb,model=none --sound none --memory {{ mem_size }} \
--vcpus {{ num_cpus }} --cpu host-passthrough \
--disk /srv/libvirt/ssd/{{ inventory_hostname }}.a.img,cache=none,format=raw,bus=virtio,size={{ dsk_size }} \