ユーザ用ツール

サイト用ツール


01_linux:08_仮想化:03_kvm_install

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
01_linux:08_仮想化:03_kvm_install [2017/02/09 06:49] – 作成 matsui01_linux:08_仮想化:03_kvm_install [2020/04/10 08:07] (現在) matsui
行 1: 行 1:
 +====== 03 KVM install ======
  
 +==== 環境 ====
 +
 +CentOS 6.8
 +
 +
 +===== 必要なパッケージインストール =====
 +
 +<code>
 +# yum -y install qemu-kvm libvirt python-virtinst bridge-utils 
 +</code>
 +
 +===== ブリッジ作成 =====
 +<code>
 +# virsh iface-bridge eth0 br0
 +</code>
 +
 +
 +=== 4つのブリッジ作成の例 ===
 +<code>
 +# virsh iface-list
 +Name                 State      MAC Address
 +--------------------------------------------
 +bond1                active     f4:ce:46:a6:fc:48
 +br0                  active     b4:99:ba:a8:10:90
 +br1                  active     f4:ce:46:a6:fc:48
 +br2                  active     f4:ce:46:a6:fc:4a
 +br3                  active     f4:ce:46:a6:fc:48
 +lo                   active     00:00:00:00:00:00
 +
 +# brctl show
 +bridge name bridge id STP enabled interfaces
 +br0 8000.b499baa81090 yes bond0
 + vnet0
 +br1 8000.f4ce46a6fc48 yes bond1.302
 + vnet1
 +br2 8000.f4ce46a6fc4a yes eth4
 + vnet2
 +br3 8000.f4ce46a6fc48 yes bond1.998
 + vnet3
 +virbr0 8000.5254006c844c yes virbr0-nic
 +</code>
 +
 +
 +== STP ==
 +
 +STP on のままだと、STP(スパニングツリープロトコル)の通信が出続けるのでoffにしとく
 +<code>
 +# sed -i 's/^STP.*/STP="off"/g' /etc/sysconfig/network-scripts/ifcfg-br*
 +</code>
 +
 +===== VMインストール =====
 +
 +=== LVM作成 ===
 +<code>
 +# lvcreate -L 10G -n VolTEST VolG00
 +</code>
 +
 +=== ISOからインストール ===
 +
 +<code>
 +# virt-install \
 +--name TESTVM \
 +--ram 2048 \
 +--file=/dev/VolG00/VolTEST \
 +--vcpus 4 \
 +--clock offset=localtime \
 +--os-type linux \
 +--os-variant rhel6 \
 +--network bridge=br0 \
 +--graphics none \
 +--location /ISO/CentOS-6.8-x86_64-bin-DVD1.iso \
 +--extra-args "console=tty0 console=ttyS0,115200n8"
 +</code>
 +
 +=== kickstartファイルからインストール ===
 +<code>
 +# virt-install \
 +--name TESTVM \
 +--ram 2048 \
 +--file=/dev/VolG00/VolTEST \
 +--vcpus 4 \
 +--clock offset=localtime \
 +--os-type linux \
 +--os-variant rhel6 \
 +--network bridge=br0 \
 +--graphics none \
 +--location "http://192.168.0.10/centos/6.8/os/x86_64" \
 +--extra-args "console=tty0 console=ttyS0,115200n8 ks=http://192.168.0.10/kickstart.cfg ip=192.168.0.11 netmask=255.255.255.0 gateway=192.168.0.1 ksdevice=eth0"
 +</code>
 +{{tag>kvm}}