Add kvm/vm71.md

This commit is contained in:
root
2024-05-05 07:48:13 +03:00
parent 33bab38915
commit e8f636c3a1

138
docs/linux/kvm/vm71.md Normal file
View File

@@ -0,0 +1,138 @@
# Example VM virsh config
File `/etc/libvirt/qemu/vm71.xml`
```xml
<?xml version="1.0"?>
<domain type="kvm">
<name>vm71</name>
<uuid>71ee58c8-83ca-4bff-b5d4-d0008b3666c4</uuid>
<description>VM-71</description>
<memory unit="KiB">4096000</memory>
<currentMemory unit="KiB">4096000</currentMemory>
<vcpu placement="static">2</vcpu>
<os>
<type arch="x86_64" machine="pc-i440fx-3.0">hvm</type>
<!-- <boot dev="cdrom"/> -->
<boot dev="hd"/>
<bootmenu enable="no"/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<hyperv mode="custom">
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
</hyperv>
</features>
<cpu mode="host-passthrough" check="none" migratable="on"/>
<clock offset="localtime">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
<timer name="hypervclock" present="yes"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="raw" cache="none"/>
<source file="/mnt/dmp/3/sda.img"/>
<target dev="sda" bus="scsi"/>
<address type="drive" controller="0" bus="0" target="0" unit="0"/>
</disk>
<disk type="block" device="disk">
<driver name="qemu" type="raw" cache="none"/>
<source dev="/dev/sdc"/>
<target dev="sdb" bus="scsi"/>
<address type="drive" controller="0" bus="0" target="1" unit="0"/>
</disk>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<source file="/mnt/data/systemrescue-11.00-amd64.iso"/>
<target dev="sdc" bus="scsi"/>
<readonly/>
<address type="drive" controller="0" bus="0" target="4" unit="0"/>
</disk>
<controller type="usb" index="0" model="ich9-ehci1">
<address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x7"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci2">
<master startport="2"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x1"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci1">
<master startport="0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0" multifunction="on"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci3">
<master startport="4"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x2"/>
</controller>
<controller type="pci" index="0" model="pci-root"/>
<controller type="pci" index="1" model="pci-bridge">
<model name="pci-bridge"/>
<target chassisNr="1"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0"/>
</controller>
<controller type="ide" index="0">
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
</controller>
<controller type="virtio-serial" index="0">
<address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/>
</controller>
<controller type="scsi" index="0" model="virtio-scsi">
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
</controller>
<interface type="bridge">
<mac address="52:54:00:00:09:71"/>
<source bridge="br23"/>
<model type="virtio"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
</interface>
<serial type="pty">
<target type="isa-serial" port="0">
<model name="isa-serial"/>
</target>
</serial>
<console type="pty">
<target type="serial" port="0"/>
</console>
<channel type="unix">
<source mode="bind" path="/tmp/vm71.agent"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
<address type="virtio-serial" controller="0" bus="0" port="1"/>
</channel>
<input type="tablet" bus="virtio">
<address type="pci" domain="0x0000" bus="0x00" slot="0x08" function="0x0"/>
</input>
<input type="keyboard" bus="virtio">
<address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
</input>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
<graphics type="vnc" port="5971" autoport="no" listen="0.0.0.0">
<listen type="address" address="0.0.0.0"/>
</graphics>
<sound model="ich6">
<address type="pci" domain="0x0000" bus="0x00" slot="0x0a" function="0x0"/>
</sound>
<audio id="1" type="none"/>
<video>
<model type="virtio" heads="1" primary="yes"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x0b" function="0x0"/>
</video>
<memballoon model="virtio">
<address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
</memballoon>
</devices>
</domain>
```