开始安装kvm
1,图形安装
# virt-manager --和xen一样的命令,打开虚拟机管理器
安装名:kvm1 --名字随意
安装方式: --我这里选择第一个,使用iso直接安装
安装路径:/share/soft/rhel-server-6.5-x86_64-dvd.iso --写上iso的路径
OS type: linux
red hat enterprise linux 6
内存大小: 1024M -- 内存如果较小,安装时无法使用图形安装方式,只能使用文本安装方式
cpu个数:2 --不能大于宿主机器的cpu核数
硬盘大小: 12 G --我这里定义12G大小,不马上分配;它的默认路径会在/var/lib/libvirt/images/kvm1.img;也可以自定义路径
2,命令行交互式安装
[root@li ~]# virt-install --prompt
What is the name of your virtual machine?
kvm2
How much RAM should be allocated (in megabytes)?
800
What would you like to use as the disk (file path)?
/var/lib/libvirt/images/kvm2.img
How large would you like the disk (/var/lib/libvirt/images/kvm2.img) to be (in gigabytes)?
12
What is the install CD-ROM/ISO or URL?
/share/soft/rhel-server-6.5-x86_64-dvd.iso
主要的管理命令:
virsh help
virsh help domain
virsh help network
virsh help monitor --因为参数很多,可以用象domain,network,monitor这种关键字,只查看与关键字有关的参数帮助
......
# virsh list
Id Name State
----------------------------------------------------
1 kvm1 running
# virsh list --all
Id Name State
----------------------------------------------------
1 kvm1 running
- kvm2 shut off
3,保存后,使用virsh list --all查看不到的,需要define一下
# virsh define /etc/libvirt/qemu/kvm3.xml
# virsh list --all --再查就可以查看到kvm3
Id Name State
----------------------------------------------------
- kvm1 shut off
- kvm1-clone shut off
- kvm2 shut off
- kvm3 shut off
# virsh snapshot-list kvm1
Name Creation Time State
------------------------------------------------------------
snap1 2013-12-07 17:52:42 +0800 running