<domain type='kvm'>
<name>test_Ubuntu</name> //虚拟机名称
<memory unit='KiB'>2097152</memory> //最大内存,单位Kib
<currentMemory unit='KiB'>2097152</currentMemory> //可用内存,单位Kib
<vcpu>8</vcpu> //虚拟cpu个数
<os>
<type arch='x86_64' machine='rhel6.2.0'>hvm</type>
<boot dev='cdrom'/> // 光盘启动为首选启动项
<boot dev='hd'/> // 硬盘启动为次要启动项
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/test.qcow2'/> //目的镜像路径
<target dev='hda' bus='ide'/> //bus值还可以设置为virtio
</disk>
<disk type='file' device='cdrom'>
<source file='/var/lib/libvirt/images/ubuntu.iso'/> //光盘镜像路径
<target dev='hdb' bus='ide'/>
</disk>
<interface type='bridge'> //虚拟机网络连接方式
<source bridge='kvmbr0'/> //当前主机网桥的名称
<mac address="00:16:3e:5d:aa:a8"/> //为虚拟机分配mac地址,务必唯一
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen = '0.0.0.0' keymap='en-us'/>//vnc方式登录,端口号自动分配,自动加1,可以通过virsh vncdisplay来查询
</devices>
</domain>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。