June 2017
Intermediate to advanced
340 pages
8h 22m
English
Let's add some simple error checking to the preceding Python code and write all of it to a new file. We are going to be adding to this file in the subsequent recipes:
(kvm_python) root@kvm:~/kvm_python# cat kvm.pyimport libvirtxmlconfig = """<domain type='kvm' id='1'> <name>kvm_python</name> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> ...
Read now
Unlock full access