yum groupinstall Virtualization "Virtualization Client"
yum install libvirt libguestfs-tools
1、下载一个最小的CentOS 6.5的iso文件:
wget -P /tmp/p_w_picpaths http://mirrors.163.com/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso
2、创建一个空的镜像文件:
cd /tmp/p_w_picpaths
qemu-img create -f qcow2 centos-6.5.qcow2 5G
3、创建命令: virt-install --name centos-6.5 --ram 1024 --cdrom=CentOS-6.5-x86_64-minimal.iso --disk centos-6.5.qcow2,format=qcow2 --grap hics vnc,listen=0.0.0.0 —noautoconsole --os-type=linux --os-variant=rhel6
4. 上传镜像
glance p_w_picpath-create --name "centos-6.5-x86_64" --file /tmp/p_w_picpaths/centos-6.5.qcow2 --disk-format qcow2 --container-format bare --visibility public --progress
5.查看镜像
glance p_w_picpath-list
6.在dashboard里创建实例,以centos6.5镜像启动,如果系统启动eth0网卡起不来,就删除/etc/udev/
rules.d/70-persistent.rules,再service重启网络服务