[가상화] Xen을 이용한 가상화 시스템 구축하기

Xen을 이용한 가상화 시스템 구축하기

작성일 : 2008년 12월 2일
작성자 : 서진우 (alang@syszone.co.kr)

–  설치

Redhat ES5 설치 ..

* 필요 패키지

bridge-utils-1.1-2.x86_64.rpm
dnsmasq-2.39-2.el5.x86_64.rpm
gnome-python2-gnomekeyring-2.16.0-2.el5.x86_64.rpm
gtk-vnc-0.3.2-3.el5.x86_64.rpm
gtk-vnc-devel-0.3.2-3.el5.x86_64.rpm
gtk-vnc-python-0.3.2-3.el5.x86_64.rpm
kernel-xen-2.6.18-92.el5.x86_64.rpm
kernel-xen-devel-2.6.18-92.el5.x86_64.rpm
libvirt-0.3.3-7.el5.x86_64.rpm
libvirt-devel-0.3.3-7.el5.x86_64.rpm
libvirt-python-0.3.3-7.el5.x86_64.rpm
python-virtinst-0.300.2-8.el5.noarch.rpm
virt-manager-0.5.3-8.el5.x86_64.rpm
Virtualization-en-US-5.2-9.noarch.rpm
Virtualization-ko-KR-5.2-9.noarch.rpm
virt-viewer-0.0.2-2.el5.x86_64.rpm
xen-3.0.3-64.el5.x86_64.rpm
xen-devel-3.0.3-64.el5.x86_64.rpm
xen-libs-3.0.3-64.el5.x86_64.rpm

* VT RPM 설치

rpm -Uvh bridge-utils-1.1-2.x86_64.rpm
rpm -Uvh dnsmasq-2.39-2.el5.x86_64.rpm
rpm -ivh kernel-xen-*
rpm -Uvh Virtualization-*
rpm -Uvh xen-libs-3.0.3-64.el5.x86_64.rpm
rpm -Uvh libvirt-0.3.3-7.el5.x86_64.rpm
rpm -Uvh libvirt-devel-0.3.3-7.el5.x86_64.rpm libvirt-python-0.3.3-7.el5.x86_64.rpm
rpm -Uvh gtk-vnc-*
rpm -Uvh virt-viewer-0.0.2-2.el5.x86_64.rpm
rpm -Uvh gnome-python2-gnomekeyring-2.16.0-2.el5.x86_64.rpm python-virtinst-0.300.2-8.el5.noarch.rpm
rpm -Uvh virt-manager-0.5.3-8.el5.x86_64.rpm
rpm -Uvh xen-3.0.3-64.el5.x86_64.rpm xen-devel-3.0.3-64.el5.x86_64.rpm

* rebooting

# virt-install -h : 도움말

;; network os install 환경 사전 구축되어야 함.
;; –file 에 대한 값을 디바이스(/dev/sdb)로 바로 지정할 경우 domain0 의 / 에 guest / 가 덮어 써 버릴 수 있다.
;; guest os 가 설치되는 장치를 볼륨이 아닌 파티션 내에 설치 되도록 한다.

# virt-install –paravirt –ram=2000 –vcpus=2 –name=vtst01 –bridge=xenbr0 –location=nfs:192.168.123.80:/home/os/rhes5/x64_up2 –file=/dev/sda7 –extra-args=”ks=nfs:192.168.123.80:/home/os/rhes5/x64_up2/ks_v.cfg ksip=192.168.123.165 ksnm=vtst01″ –vnc

# virt-install –paravirt –ram=1500 –vcpus=2 –name=vtst02 –bridge=xenbr1 –location=nfs:192.168.123.80:/home/os/rhes5/x64_up2 –file=/dev/sda8 –extra-args=”ks=nfs:192.168.123.80:/home/os/rhes5/x64_up2/ks_v.cfg ksip=192.168.123.166 ksnm=vtst02″ –vnc

# virt-install –paravirt –ram=4000 –vcpus=2 –name=alang03 –bridge=xenbr1 –location=nfs:192.168.123.80:/home/os/rhes5/x64_up2 –file=/dev/sdb1 –extra-args=”ks=nfs:192.168.123.80:/home/os/rhes5/x64_up2/ks_v.cfg ksip=192.168.123.91 ksnm=alang04″ –nographic

# virt-install –paravirt –ram=4000 –vcpus=2 –name=alang03 –bridge=xenbr1 –location=nfs:192.168.123.80:/home/os/rhes5/x64_up2 –file=/data/xen/alang04.img –file-size=200 –extra-args=”ks=nfs:192.168.123.80:/home/os/rhes5/x64_up2/ks_v.cfg ksip=192.168.123.91 ksnm=alang04″ –nographic

– Multi NIC

# vi /etc/xen/xend-config.sxp
(network-script network-bridge) -> 삭제
(network-script network-multi-bridge) -> 추가

# vi /etc/xen/scripts/network-multi-bridge
—————————————————————————-
#!/bin/sh
dir=$(dirname “$0”)
“$dir/network-bridge” “$@” vifnum=0
“$dir/network-bridge” “$@” vifnum=1
—————————————————————————-
# chmod 755 /etc/xen/scripts/network-multi-bridge
# /etc/rc.d/init.d/xend restart

VT delete ..

xm destroy vtst01
rm -f /etc/xen/guest
rm -f /xen/guest.img

VT boot ..
xm create vtst01
virsh start vtst01

VT connect ..

xm console guest
virt-viewer vtst01

서진우

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

페이스북/트위트/구글 계정으로 댓글 가능합니다.