<domain type='kvm'>
<name>Testguest1</name>
<uuid>ec6fbaa1-3eb4-49da-bf61-bb02fbec4967</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<domain type='kvm'>
<name>Testguest1</name>
<uuid>ec6fbaa1-3eb4-49da-bf61-bb02fbec4967</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 这是名为 Testguest1 的 KVM,分配了 1024 MiB 的 RAM。有关配置常规虚拟机参数的详情,请参考 第 23.1 节 “通用信息和元数据”。 |
<vcpu placement='static'>1</vcpu>
<vcpu placement='static'>1</vcpu>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 客户机虚拟机有 1 个分配的 vCPU。有关 CPU 分配的详情,请参考 第 23.4 节 “CPU 分配”。 |
<os>
<type arch='x86_64' machine='pc-i440fx-2.9'>hvm</type>
<boot dev='hd'/>
</os>
<os>
<type arch='x86_64' machine='pc-i440fx-2.9'>hvm</type>
<boot dev='hd'/>
</os>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 机器构架被设置为 AMD64 和 Intel 64 架构,并使用 Intel 440FX 机器类型来决定功能兼容性。从硬盘引导操作系统。有关修改操作系统参数的详情,请参考 第 23.2 节 “操作系统引导”。 |
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 虚拟机监控程序功能 acpi 和 apic 被禁用,并关闭 VMWare IO 端口。有关修改虚拟机监控程序功能的详情,请参考 -第 23.14 节 “Hypervisor 功能”。 |
<cpu mode='host-passthrough' check='none'/>
<cpu mode='host-passthrough' check='none'/>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 客户机 CPU 功能与主机 CPU 上的功能相同。有关修改 CPU 功能的详情,请参考 -第 23.12 节 “CPU 型号和拓扑”。 |
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 客户机的虚拟硬件时钟使用 UTC 时区。另外,设置了三个不同的计时器以便与 QEMU 管理程序同步。有关修改时间保存设置的详情,请参考 -第 23.15 节 “timekeeping”。 |
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 当虚拟机关闭或操作系统意外终止时,libvirt 会终止客户机并释放其所有分配的资源。重新引导 guest 后,它会使用相同的配置来重新启动。有关配置这些设置的详情请参考 -第 23.13 节 “事件配置”。 |
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 这个客户机虚拟机的 S3 和 S4 ACPI 睡眠状态被禁用。 |
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/Testguest.qcow2'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdb' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/Testguest.qcow2'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdb' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 虚拟机使用 /usr/bin/qemu-kvm 二进制文件模拟。另外,它连接了两个磁盘。第一个磁盘是基于主机上存储的 /var/lib/libvirt/images/Testguest.qcow2 的虚拟硬盘,其逻辑设备名称被设置为 hda 。有关管理磁盘的更多信息,请参阅 -第 23.17.1 节 “硬盘驱动器、软盘和 CD-ROMs”。 |
<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-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-uhci2'>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
</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='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='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-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-uhci2'>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
</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='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>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 虚拟机使用四个控制器来附加 USB 设备,以及用于 PCI-Express(PCIe)设备的 root 控制器。另外,可以使用 virtio-serial 控制器,它可让虚拟机以各种方式与主机交互,如串行控制台。有关配置控制器的更多信息,请参阅 -第 23.17.3 节 “Controller”。 |
<interface type='network'>
<mac address='52:54:00:65:29:21'/>
<source network='default'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:65:29:21'/>
<source network='default'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 在虚拟机中设置了网络接口,它使用 default 虚拟网络和 rtl8139 网络设备模型。有关配置网络接口的详情,请参考 -第 23.17.8 节 “网络接口”。 |
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 在虚拟机上设置了一个 pty 串行控制台,它可启用与主机通信最多的辅助虚拟机。控制台使用泛虚拟化 SPICE 频道。这个设置是自动设置的,我们不推荐修改这些设置。有关字符设备的概述,请参考 -第 23.17.8 节 “网络接口”。有关 串行端口 和 控制台的详情, 请参考 第 23.17.14 节 “客户端虚拟机接口”。有关 频道 的详情,请参考 第 23.17.15 节 “Channel”。 |
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 虚拟机使用虚拟 ps2 端口,该端口设置为接收鼠标和键盘输入。这个设置是自动设置的,我们不推荐修改这些设置。如需更多信息,请参阅 第 23.17.9 节 “输入设备”。 |
<graphics type='spice' autoport='yes'>
<listen type='address'/>
<image compression='off'/>
</graphics>
<graphics type='spice' autoport='yes'>
<listen type='address'/>
<image compression='off'/>
</graphics>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 虚拟机使用 SPICE 协议,通过自动分配的端口号和关闭映像压缩渲染其图形输出。有关配置图形设备的详情,请参考 第 23.17.11 节 “图形帧缓冲”。 |
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 为虚拟机设置了 ICH6 HDA 声音设备,QEMU QXL 半虚拟帧缓冲设备则设置为视频加速器。这个设置是自动设置的,我们不推荐修改这些设置。有关配置 声设备 的详情,请参考 第 23.17.17 节 “声音设备”。有关配置 视频设备 ,请参考 第 23.17.12 节 “视频设备”。 |
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='1'/>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='2'/>
</redirdev>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</memballoon>
</devices>
</domain>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='1'/>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='2'/>
</redirdev>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</memballoon>
</devices>
</domain>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
| 虚拟机有两个重定向程序来远程附加 USB 设备,打开 内存 ballooning。这个设置是自动设置的,我们不推荐修改这些设置。详情请查看 第 23.17.6 节 “重定向的设备” |