virtualization/OpenVZ

수동으로 OS 템플릿를 추가, VPS 작성하기

yueisu 2009. 4. 15. 12:37
OpenVZ상에서 수동으로 각종 OS 템플릿를 추가, VPS를 작성하는 방법입니다.
(SUSE Linux 10.3의 경우)
[root@vzhost /]# cd /vz/template/cache   <---템플릿 디렉토리로 이동
[root@vzhost cache]# wget http://download.openvz.org/template/precreated/suse-10.3-x86.tar.gz <--템플릿 다운로드
--16:39:59--  http://download.openvz.org/template/precreated/suse-10.3-x86.tar.gz
download.openvz.org
.
.
.
Saving to: `suse-10.3-x86.tar.gz'

100%[====================================================>] 153,487,230 2.59M/s   in 75s

16:41:15 (1.94 MB/s) - `suse-10.3-x86.tar.gz' is saved [153487230/153487230]

[root@vzhost cache]# ls
centos-4-i386-default.tar.gz  centos-5-i386-minimal.tar.gz-old  suse-10.3-x86.tar.gz
centos-4-i386-minimal.tar.gz  debian-5.0-x86.tar.gz             ubuntu-8.10-x86.tar.gz
centos-5-i386-default.tar.gz  debian-5.0-x86.tar.gz.1           ubuntu-8.10-x86_64.tar.gz
centos-5-i386-minimal.tar.gz  fedora-9-x86.tar.gz
[root@vzhost cache]# vzctl create 160 --ostemplate suse-10.3-x86  <--VPS작성
Unable to get full ostemplate name for suse-10.3-x86
Creating container private area (suse-10.3-x86)
Performing postcreate actions
Container private area was created
[root@vzhost cache]# vzctl set 160 --ipadd 10.10.10.234 --hostname suse01.localdomain.com --save  <--VPS의 ip, 호스트명 설정
Saved parameters for CT 160
[root@vzhost cache]# vzctl start 160  <--VPS 기동
Starting container ...
Container is mounted
Adding IP address(es): 10.10.10.234
Setting CPU units: 1000
Configure meminfo: 65536
Set hostname: suse01.localdomain.com
Container start in progress...
[root@vzhost cache]# vzctl exec 160 passwd root  <--VPS의 root 패스워드 설정
New Password: password
Bad password: it is based on a dictionary word
Reenter New Password: password
Changing password for root.
Password changed.
[root@vzhost cache]# vzlist -a  <--작성된 VPS리스트 확인
      CTID      NPROC STATUS  IP_ADDR         HOSTNAME
       120         19 running 10.10.10.230    centos01.localdomain.com
       130         10 running 10.10.10.231    ubuntu01.localdomain.com
       140         10 running 10.10.10.232    debian01.localdomain.com
       150         16 running 10.10.10.233    fedora01.localdomain.com
       160         16 running 10.10.10.234    suse01.localdomain.com
[root@vzhost cache]# vzctl enter 160  <--VPS에 로그인
entered into CT 160
suse01:/ # uname -a
Linux suse01 2.6.18-92.1.18.el5.028stab060.8ent #1 SMP Mon Feb 9 22:44:56 MSK 2009 i686 i686 i386 GNU/Linux
suse01:/ # exit  <--VPS로부터 로그아웃
logout
exited from CT 160
[root@vzhost cache]#

PS 1>호스트상에서 VPS의 패스워드를 설정할 경우는 마스킹 않되는군요. 흐흐

'virtualization > OpenVZ' 카테고리의 다른 글

OpenVZ의 CT에서 PHP 버전 올리기  (0) 2010.01.22
Unable to open pty: No such file or directory  (0) 2009.04.08