对于虚拟机来说,它的配置信息被存储在它对应的xml文件中。因此,创建一个虚拟机的第一步就是准备一个与虚拟机对应的 xml 文件。
下面是一个示例 xml 文件,你可以根据需要手动修改它。
- <domain type='kvm'> <name>alice</name>
- <uuid>f5b8c05b-9c7a-3211-49b9-2bd635f7e2aa</uuid> <memory>1048576</memory>
- <currentMemory>1048576</currentMemory> <vcpu>1</vcpu>
- <os> <type>hvm</type>
- <boot dev='cdrom'/> </os>
- <features> <acpi/>
- </features> <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash> <devices>
- <emulator>/usr/bin/kvm</emulator> <disk type="file" device="disk">
- <driver name="qemu" type="raw"/> <source file="/home/dev/images/alice.img"/>
- <target dev="vda" bus="virtio"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
- </disk> <disk type="file" device="cdrom">
- <driver name="qemu" type="raw"/> <source file="/home/dev/iso/CentOS-6.5-x86_64-minimal.iso"/>










