kvm创建虚拟机实例

网络引导创建虚拟机

cat bin/install-rhel6

#!/bin/bash
/usr/sbin/virt-install \
--vnc \
--noautoconsole \
--name=rhel6test \
--ram=1024 \
--arch=x86_64 \
--vcpus=1 \
--os-type=linux \
--os-variant=rhel6 \
--hvm \
--accelerate \
--disk=/dev/vgtest/lvtest \
-m 52:54:00:00:01:00 \ //指定虚拟机的网卡
-w bridge=br0 \
--location=ftp://192.168.3.1/rhel6 \ //指定安装系统所需包的位置
--extra-args="ks=ftp://192.168.3.1/ks.cfg" //指定ks.cfg文件

通过ISO镜像创建虚拟机

virt-install --name centos-666 \

--ram 1024 \

--cdrom=CentOS-6.5-x86_64-bin-DVD1.iso \

--disk centos-6.5.qcow2,format=qcow2 \

--graphics vnc,listen=0.0.0.0 \

--network bridge=br0,model=virtio \

--force \

--noautoconsole \

--os-type=linux \

--os-variant=rhel6

posted @ 2018-01-09 10:44  393199901  阅读(92)  评论(0)    收藏  举报