OpenVZ vol.1 | CentOS5.4にインストールしてみた - 十返舎.com
の続き。
ここは詰まりようが無いくらいサクサクいきました。
追記:2009/11/23 22:30
以下を見ると本エントリで言う ${id} 部(CTIDというそうな)には、
100未満の数字は使わない方が良さそうです。
適宜置き換えて調整ください。
CTID 101としてダウンロードしたCentOS5.3のContainerを作成する。
CTIDはContainerを特定するための番号で、自分で適当に決めればよい。
ただし、100番未満の数字は予約済みのため使えないらしい。
"--ostemplate"の後にはダウンロードしたテンプレートの名前を入力する。
Containerの作成・設定 - なんとなくWiki - livedoor Wiki(ウィキ)
VMware Fusion for Mac | Fusion 入門
今回は以下を参考にした。
【VPS】 OpenVZ インストール(CentOS5もできるよ) at softel メモ
とてもわかりやすかったです。
最新のテンプレートをダウンロードする
# cd /root # wget http://download.openvz.org/contrib/template/precreated/centos-5-x86_64-default-5.4-20091116.tar.gz # wget http://download.openvz.org/contrib/template/precreated/centos-5-x86_64-default.tar.gz # wget http://download.openvz.org/contrib/template/precreated/centos-5-x86_64-minimal.tar.gz
テンプレートを配置する
外から持ってきたパッケージは /vz/template/cache に置くらしい。# cp -a /root/centos-5-x86_64_*.tar.gz /vz/template/cache/
仮想インストール開始
基本は vzctl コマンド一発。
${id}はコンテナID、
${template_name}はファイル名から拡張子 tar.gz をとったものを指定。
# vzctl create ${id} --ostemplate ${template_name}
加えて各テンプレート毎に time でインストール時間を計測してみた。
は、はやっ!# time vzctl create 80 --ostemplate centos-5-x86_64-default-5.4-20091116 Unable to get full ostemplate name for centos-5-x86_64-default-5.4-20091116 Creating container private area (centos-5-x86_64-default-5.4-20091116) Performing postcreate actions Container private area was created real 0m22.138s user 0m4.962s sys 0m3.361s # time vzctl create 81 --ostemplate centos-5-x86_64-default Creating container private area (centos-5-x86_64-default) Performing postcreate actions Container private area was created real 0m16.190s user 0m4.533s sys 0m2.672s # time vzctl create 82 --ostemplate centos-5-x86_64-minimal Creating container private area (centos-5-x86_64-minimal) Performing postcreate actions Container private area was created real 0m7.809s user 0m2.000s sys 0m1.180s
管理コンテナ一覧表示
# vzlist -a CTID NPROC STATUS IP_ADDR HOSTNAME 80 - stopped - - 81 - stopped - - 82 - stopped - -
管理コンテナ起動
見事に立ち上がっとるようだ# vzctl start 80 Starting container ... Container is mounted Setting CPU units: 1000 Configure meminfo: 65536 Container start in progress... # vzlist -a CTID NPROC STATUS IP_ADDR HOSTNAME 80 16 running - - 81 - stopped - - 82 - stopped - -
管理コンテナログイン
# vzctl enter 80 entered into CT 80
/vz/private/${id}/を / とする chroot な感じ。
大元のHost機もそこのファイル操作できるから、バックアップとか楽そうではある。
付録
rpm list とってみた。
centos-5-x86_64-default-5.4-20091116.tar.gz
# rpm -qa chkconfig-1.3.30.1-2 beecrypt-4.1.2-10.1.1 libacl-2.2.39-3.el5 libgpg-error-1.4-2 libusb-0.1.12-5.1 keyutils-libs-1.2-1.el5 sed-4.1.5-5.fc6 gawk-3.1.5-14.el5 diffutils-2.8.1-15.2.3.el5 gzip-1.3.5-10.el5.centos gpm-1.20.1-74.1 cracklib-dicts-2.8.9-3.3 time-1.7-27.2.2 aspell-0.60.3-7.1 ncompress-4.2.4-47 passwd-0.73-1 python-sqlite-1.1.7-1.2.1 xinetd-2.3.14-10.el5 vzdev-1.0-7.swsoft screen-4.0.3-1.el5 tar-1.15.1-23.0.1.el5 zlib-1.2.3-3 libcap-1.10-26 libattr-2.4.32-1.1 libjpeg-6b-37 libtermcap-2.0.8-46.1 groff-1.18.1.1-11.1 procmail-3.22-17.1.el5.centos mailcap-2.1.23-1.fc6 telnet-0.17-39.el5 vzdummy-jre-el5-1.0-1.swsoft finger-0.17-32.2.1.1 rootfiles-8.1-1.1.1 sendmail-8.13.8-2.el5 sendmail-cf-8.13.8-2.el5 which-2.16-7 man-1.6d-1.1 elfutils-libelf-0.137-3.el5 lm_sensors-2.10.7-4.el5 procps-3.2.7-11.1.el5 libpng-1.2.10-7.1.el5_3.2 tmpwatch-2.9.7-1.1.el5.2 man-pages-2.39-12.el5 shadow-utils-4.0.17-14.el5 usermode-1.88-3.el5.2 SysVinit-2.86-15.el5 tcpdump-3.9.4-14.el5 yum-fastestmirror-1.1.16-13.el5.centos file-4.17-15.el5_3.1 curl-7.15.5-2.1.el5_3.5 apr-util-1.2.7-7.el5_3.2 gnutls-1.4.1-3.el5_3.5 openssl-0.9.8e-12.el5 fetchmail-6.3.6-1.1.el5_3.1 kbd-1.12-21.el5 wireless-tools-28-2.el5 dbus-glib-0.73-8.el5 kudzu-1.2.57.1.21-1.el5.centos glibc-2.5-42 libselinux-1.33.4-5.5.el5 e2fsprogs-libs-1.39-23.el5 grep-2.5.1-55.el5 readline-5.1-3.el5 findutils-4.2.27-6.el5 e2fsprogs-1.39-23.el5 libgcrypt-1.4.4-5.el5 cyrus-sasl-lib-2.1.22-5.el5 db4-4.3.29-10.el5 tcp_wrappers-7.6-40.7.el5 iproute-2.6.18-10.el5 libselinux-utils-1.33.4-5.5.el5 iputils-20020927-46.el5 vim-common-7.0.109-6.el5 binutils-2.17.50.0.6-12.el5 centos-release-5-4.el5.centos.1 vim-enhanced-7.0.109-6.el5 glibc-2.5-42 python-2.4.3-27.el5 krb5-libs-1.6.1-36.el5 util-linux-2.13-0.52.el5 rpm-4.4.2.3-18.el5 bind-libs-9.3.6-4.P1.el5 audit-libs-python-1.7.13-2.el5 libselinux-python-1.33.4-5.5.el5 fipscheck-lib-1.2.0-1.el5 dmraid-events-1.0.0.rc13-53.el5 bind-utils-9.3.6-4.P1.el5 sudo-1.6.9p17-5.el5 nscd-2.5-42 initscripts-8.45.30-2.el5.centos hal-0.5.8.1-52.el5 dhclient-3.0.5-21.el5 mkinitrd-5.1.19.6-54 hwdata-0.213.16-1.el5 system-config-network-tui-1.3.99.18-1.el5 nspr-4.7.6-1.el5_4 openssh-4.3p2-36.el5_4.2 libstdc++-4.1.2-46.el5_4.1 postgresql-libs-8.1.18-2.el5_4.1 libuser-0.54.7-2.1.el5_4.1 lvm2-2.02.46-8.el5_4.2 wget-1.11.4-2.el5_4.1 tcsh-6.14-14.el5_4.2 httpd-2.2.3-31.el5.centos.2 elinks-0.11.1-6.el5_4.1 net-snmp-utils-5.3.2.2-7.el5_4.2 tzdata-2009o-2.el5 mktemp-1.5-23.2.2 bzip2-libs-1.0.3-4.el5_2 expat-1.95.8-8.2.1 hesiod-3.1.0-8 libsysfs-2.0.0-6 termcap-5.5-1.20060701.1 info-4.8-14.el5 bzip2-1.0.3-4.el5_2 jwhois-3.2.3-8.el5 make-3.81-3.el5 talk-0.17-29.2.2 mailx-8.1.1-44.2.2 cracklib-2.8.9-3.3 python-elementtree-1.2.6-5 net-tools-1.60-78.el5 setuptool-1.19.2-1.el5.centos ntsysv-1.3.30.1-2 lynx-2.8.5-28.1.el5_2.1 lsof-4.78-3 basesystem-8.0-5.1.1.el5.centos gdbm-1.8.0-26.2.1 pcre-6.6-2.el5_1.7 slang-2.0.6-4.el5 mingetty-1.07-5.2.2 ncurses-5.5-24.20060715 libidn-0.6.5-1.1 m4-1.4.5-3.el5.1 aspell-en-6.0-2.1 sharutils-4.6.1-2 ed-0.2-39.el5_2 crontabs-1.10-8 rsync-2.6.8-3.1 python-iniparse-0.2.3-4.el5 MAKEDEV-3.23-1.2 sysklogd-1.4.1-44.el5 sendmail-doc-8.13.8-2.el5 portmap-4.0-65.2.2.1 gpg-pubkey-e8562897-459f07a4 bash-3.2-24.el5 glib2-2.12.3-4.el5_3.1 elfutils-libs-0.137-3.el5 elfutils-0.137-3.el5 unzip-5.52-3.el5 ftp-0.17-35.el5 traceroute-2.0.1-5.el5 filesystem-2.4.0-2.el5.centos openldap-2.3.43-3.el5 mcstrans-0.2.11-3.el5 libutempter-1.1.4-4.el5 logrotate-3.7.4-9 quota-3.13-1.2.5.el5 vixie-cron-4.1-76.el5 gnupg-1.4.5-14 stunnel-4.15-2.el5.1 python-urlgrabber-3.1.0-5.el5 dbus-libs-1.1.2-12.el5 dbus-1.1.2-12.el5 nss-3.12.3.99.3-1.el5.centos.2 libtiff-3.8.2-7.el5_3.4 libxml2-2.6.26-2.1.2.8 libxml2-python-2.6.26-2.1.2.8 apr-1.2.7-11.el5_3.1 rhpl-0.194.1-1 pm-utils-0.99.3-10.el5.centos glibc-common-2.5-42 libsepol-1.15.2-2.el5 device-mapper-1.02.32-1.el5 audit-libs-1.7.13-2.el5 popt-1.10.2.3-18.el5 sqlite-3.3.6-5 cryptsetup-luks-1.0.3-5.el5 perl-5.8.8-27.el5 libvolume_id-095-14.21.el5 psmisc-22.2-7 vim-minimal-7.0.109-6.el5 ethtool-6-3.el5 centos-release-notes-5.4-4 device-mapper-event-1.02.32-1.el5 cpio-2.6-23.el5 hmaccalc-0.9.6-1.el5 sgpio-1.2.0_10-2.el5 nash-5.1.19.6-54 mlocate-0.15-1.el5.2 less-394-6.el5 setup-2.5.58-7.el5 pam-0.99.6.2-6.el5 udev-095-14.21.el5 rpm-libs-4.4.2.3-18.el5 rpm-python-4.4.2.3-18.el5 libsemanage-1.9.1-4.4.el5 yum-metadata-parser-1.1.2-3.el5.centos dmraid-1.0.0.rc13-53.el5 fipscheck-1.2.0-1.el5 authconfig-5.3.21-6.el5 m2crypto-0.16-6.el5.6 yum-3.2.22-20.el5.centos cyrus-sasl-2.1.22-5.el5 policycoreutils-1.33.12-14.6.el5 module-init-tools-3.3-0.pre3.1.54.el5 pciutils-2.2.3-7.el5 net-snmp-libs-5.3.2.2-7.el5_4.2 coreutils-5.97-23.el5_4.1 libgcc-4.1.2-46.el5_4.1 net-snmp-5.3.2.2-7.el5_4.2 cups-libs-1.3.7-11.el5_4.3 kpartx-0.4.7-30.el5_4.2 newt-0.52.2-12.el5_4.1 openssh-server-4.3p2-36.el5_4.2 dmidecode-2.10-2.el5_4 iptables-1.3.5-5.3.el5_4.1 device-mapper-multipath-0.4.7-30.el5_4.2 openssh-clients-4.3p2-36.el5_4.2
centos-5-x86_64-default.tar.gz
# rpm -qa libgcc-4.1.2-14.el5 setup-2.5.58-1.el5 basesystem-8.0-5.1.1.el5.centos centos-release-notes-5.1.0-2 mailcap-2.1.23-1.fc6 glibc-common-2.5-18.el5_1.1 glibc-2.5-18.el5_1.1 chkconfig-1.3.30.1-1 popt-1.10.2-47.el5 libtermcap-2.0.8-46.1 ncurses-5.5-24.20060715 sed-4.1.5-5.fc6 libsepol-1.15.2-1.el5 db4-4.3.29-9.fc6 sqlite-3.3.6-2 glib2-2.12.3-2.fc6 elfutils-libelf-0.125-3.el5 beecrypt-4.1.2-10.1.1 libxml2-2.6.26-2.1.2.1 nspr-4.6.5-3.el5 libjpeg-6b-37 gdbm-1.8.0-26.2.1 libattr-2.4.32-1.1 libgcrypt-1.2.3-1 grep-2.5.1-54.2.el5 less-394-5.el5 pkgconfig-0.21-1.fc6 libcap-1.10-26 gzip-1.3.5-9.el5.centos elfutils-libs-0.125-3.el5 iproute-2.6.18-4.el5 libusb-0.1.12-5.1 procps-3.2.7-8.1.el5 iputils-20020927-43.el5 ethtool-5-1.el5 libXdmcp-1.0.1-2.1 wireless-tools-28-2.el5 elfutils-0.125-3.el5 jwhois-3.2.3-8.el5 ed-0.2-38.2.2 cpio-2.6-20 telnet-0.17-39.el5 iptables-1.3.5-1.2.1 libdbi-0.8.1-2.1 netpbm-10.35-6.fc6 unixODBC-2.2.11-7.1 libtool-ltdl-1.5.22-6.1 zlib-1.2.3-3 cyrus-sasl-lib-2.1.22-4 libgpg-error-1.4-2 libjpeg-6b-37 libsepol-1.15.2-1.el5 libstdc++-4.1.2-14.el5 gnutls-1.4.1-2 libtiff-3.8.2-7.el5 gnutls-1.4.1-2 keyutils-libs-1.2-1.el5 slang-2.0.6-4.el5 libXdmcp-1.0.1-2.1 expat-1.95.8-8.2.1 cyrus-sasl-plain-2.1.22-4 libxslt-1.1.17-2 readline-5.1-1.1 MAKEDEV-3.3.13-1.4.swsoft unixODBC-2.2.11-7.1 libdbi-0.8.1-2.1 libX11-1.0.3-8.0.1.el5 libXpm-3.5.5-3 centos-release-5-1.0.el5.centos.1 man-pages-2.39-10.el5 libselinux-1.33.4-4.el5 perl-5.8.8-10.el5_0.2 findutils-4.2.27-4.1 python-2.4.3-19.el5 newt-0.52.2-9 pam-0.99.6.2-3.26.el5 e2fsprogs-libs-1.39-10.el5_1.1 krb5-libs-1.6.1-17.el5_1.1 samba-common-3.0.25b-1.el5_1.4 apr-1.2.7-11 apr-util-1.2.7-6 bind-libs-9.3.3-10.el5 python-elementtree-1.2.6-5 yum-metadata-parser-1.0-8.fc6 libselinux-python-1.33.4-4.el5 libxml2-python-2.6.26-2.1.2.1 module-init-tools-3.3-0.pre3.1.34.el5 net-tools-1.60-73 logrotate-3.7.4-8 cracklib-2.8.9-3.3 samba-client-3.0.25b-1.el5_1.4 stunnel-4.15-2 wget-1.10.2-7.el5 ntsysv-1.3.30.1-1 tcsh-6.14-12.el5 mlocate-0.15-1.el5 libutempter-1.1.4-3.fc6 tar-1.15.1-23.0.1.el5 vzdev-3.3.13-1.4.swsoft gd-2.0.33-9.4.el5_1.1 python-urlgrabber-3.1.0-2 xml-common-0.6.3-18 e2fsprogs-libs-1.39-10.el5_1.1 rpm-libs-4.4.2-47.el5 krb5-libs-1.6.1-17.el5_1.1 openldap-2.3.27-8.el5_1.3 e2fsprogs-1.39-10.el5_1.1 passwd-0.73-1 SysVinit-2.86-14 openssh-4.3p2-24.el5 mcstrans-0.2.6-1.el5_1.1 sysklogd-1.4.1-40.el5 cyrus-sasl-2.1.22-4 httpd-2.2.3-11.el5_1.centos.3 fetchmail-6.3.6-1.1.el5 openssh-server-4.3p2-24.el5 quota-3.13-1.2.3.2.el5 setuptool-1.19.2-1.el5.centos gnupg-1.4.5-13 man-1.6d-1.1 curl-7.15.5-2.el5 xinetd-2.3.14-10.el5 talk-server-0.17-29.2.2 sendmail-doc-8.13.8-2.el5 sendmail-cf-8.13.8-2.el5 finger-server-0.17-32.2.1.1 gpg-pubkey-e8562897-459f07a4 libgcc-4.1.2-14.el5 filesystem-2.4.0-1.el5.centos cracklib-dicts-2.8.9-3.3 termcap-5.5-1.20060701.1 tzdata-2007k-2.el5 glibc-2.5-18.el5_1.1 zlib-1.2.3-3 mktemp-1.5-23.2.2 audit-libs-1.5.5-7.el5 bash-3.1-16.1 info-4.8-14.el5 readline-5.1-1.1 libstdc++-4.1.2-14.el5 bzip2-libs-1.0.3-3 expat-1.95.8-8.2.1 tcp_wrappers-7.6-40.4.el5 gawk-3.1.5-14.el5 libidn-0.6.5-1.1 freetype-2.2.1-19.el5 nss-3.11.7-1.3.el5.centos cyrus-sasl-lib-2.1.22-4 libgpg-error-1.4-2 libacl-2.2.39-2.1.el5 pcre-6.6-2.el5_1.7 diffutils-2.8.1-15.2.2 libpng-1.2.10-7.1.el5_0.1 slang-2.0.6-4.el5 hesiod-3.1.0-8 libtiff-3.8.2-7.el5 bzip2-1.0.3-3 groff-1.18.1.1-11.1 m4-1.4.5-3.el5.1 procmail-3.22-17.1.el5.centos file-4.17-9.0.1.el5 libXau-1.0.1-3.1 keyutils-libs-1.2-1.el5 mingetty-1.07-5.2.2 rsync-2.6.8-3.1 ftp-0.17-33.fc6 time-1.7-27.2.2 talk-0.17-29.2.2 unzip-5.52-2.2.1 tcl-8.4.13-3.fc6 traceroute-2.0.1-2.el5 finger-0.17-32.2.1.1 ncompress-4.2.4-47 mailx-8.1.1-44.2.2 audit-libs-1.5.5-7.el5 libxml2-2.6.26-2.1.2.1 libgcrypt-1.2.3-1 libpng-1.2.10-7.1.el5_0.1 freetype-2.2.1-19.el5 popt-1.10.2-47.el5 cups-libs-1.2.4-11.14.el5_1.6 db4-4.3.29-9.fc6 libidn-0.6.5-1.1 libXau-1.0.1-3.1 gdbm-1.8.0-26.2.1 glib2-2.12.3-2.fc6 libxslt-1.1.17-2 cups-libs-1.2.4-11.14.el5_1.6 cyrus-sasl-plain-2.1.22-4 tcl-8.4.13-3.fc6 hesiod-3.1.0-8 netpbm-10.35-6.fc6 xorg-x11-filesystem-7.1-2.fc6 libX11-1.0.3-8.0.1.el5 libXpm-3.5.5-3 crontabs-1.10-8 rootfiles-8.1-1.1.1 shadow-utils-4.0.17-12.el5 psmisc-22.2-5 coreutils-5.97-12.1.el5 perl-5.8.8-10.el5_0.2 cracklib-2.8.9-3.3 device-mapper-1.02.20-1.el5 openssl-0.9.8b-8.3.el5_0.2 openldap-2.3.27-8.el5_1.3 libuser-0.54.7-2.el5.2 postgresql-libs-8.1.11-1.el5_1.1 m2crypto-0.16-6.el5.1 audit-libs-python-1.5.5-7.el5 libsemanage-1.9.1-3.el5 python-sqlite-1.1.7-1.2.1 rhpl-0.194.1-1 dbus-1.0.0-6.3.el5_1 fontconfig-2.4.1-7.el5 vim-minimal-7.0.109-3.el5.3 fontconfig-2.4.1-7.el5 gd-2.0.33-9.4.el5_1.1 cyrus-sasl-gssapi-2.1.22-4 lynx-2.8.5-28.1 screen-4.0.3-1.el5 sharutils-4.6.1-2 tmpwatch-2.9.7-1.1.el5.1 MAKEDEV-3.23-1.2 tcpdump-3.9.4-11.el5 lsof-4.78-3 util-linux-2.13-0.45.el5_1.1 newt-0.52.2-9 sgml-common-0.6.3-18 rpm-4.4.2-47.el5 libselinux-1.33.4-4.el5 pam-0.99.6.2-3.26.el5 openssl-0.9.8b-8.3.el5_0.2 device-mapper-1.02.20-1.el5 curl-7.15.5-2.el5 usermode-1.88-3.el5 initscripts-8.45.17.EL-1.el5.centos.1 policycoreutils-1.33.12-12.el5 bind-9.3.3-10.el5 samba-3.0.25b-1.el5_1.4 sendmail-8.13.8-2.el5 rpm-python-4.4.2-47.el5 vixie-cron-4.1-72.el5 openssh-clients-4.3p2-24.el5 portmap-4.0-65.2.2.1 authconfig-5.3.12-2.el5 sudo-1.6.8p12-10 libuser-0.54.7-2.el5.2 cyrus-sasl-gssapi-2.1.22-4 httpd-manual-2.2.3-11.el5_1.centos.3 caching-nameserver-9.3.3-10.el5 samba-swat-3.0.25b-1.el5_1.4 yum-3.0.5-1.el5.centos.5
centos-5-x86_64-minimal.tar.gz
ろ、ログインできねー!なんで?不明
トラックバック(1)
このブログ記事を参照しているブログ一覧: OpenVZ vol.2 | 仮想OSインストールしてみた
このブログ記事に対するトラックバックURL: http://jippenshar.com/igc/mt/mt-tb.cgi/221
仮想化で OpenVZ なるものがあって、これが VMよか全然速いよ!って噂を聞... 続きを読む


コメントする