hnakamur’s blog

ものすごい勢いで忘れる私のために未整理でもいいからとりあえずメモ

2011-11-13

Scientific Linux 6.1のyumレポジトリ設定

参考:Scientific Linux 6.1 での yum リポジトリ設定 - ふたつの川うるおう日記
Scientific Linux 6 - 初期設定 - システム最新化 : Server World

yum -y install yum-conf-sl-other yum-plugin-fastestmirror yum-plugin-priorities

cd /etc/yum.repos.d/
mv sl.repo sl.repo.default
mv sl-other.repo sl-other.repo.default

cat << '_EOF_' > /etc/yum.repos.d/sl.repo
[sl]
name=Scientific Linux $releasever - $basearch
mirrorlist = file:///etc/yum.repos.d/mirrors-sl
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-security]
name=Scientific Linux $releasever - $basearch - security updates
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-security
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-source]
name=Scientific Linux $releasever - Source
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-source
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/os/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/os/
http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/os/
http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/os/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/os/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/os/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/os/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-security
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/updates/security/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/updates/security/
http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/updates/security/
http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-source
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/SRPMS/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/SRPMS/
http://ftp.riken.jp/Linux/scientific/$releasever/SRPMS/
http://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/SRPMS/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/SRPMS/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/
_EOF_

cat << '_EOF_' > /etc/yum.repos.d/sl-other.repo
[sl-fastbugs]
name=Scientific Linux $releasever - $basearch - fastbug updates
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-fastbugs
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-debuginfo]
name=Scientific Linux Debuginfo
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-debuginfo
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-testing]
name=Scientific Linux Testing - $basearch
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-testing
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1

[sl-testing-source]
name=Scientific Linux Testing - Source
mirrorlist = file:///etc/yum.repos.d/mirrors-sl-testing-source
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
priority=1
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-fastbugs
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/updates/fastbugs/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/updates/fastbugs/
http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/updates/fastbugs/
http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-debuginfo
http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/archive/debuginfo/
http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/archive/debuginfo/
http://ftp.riken.jp/Linux/scientific/$releasever/archive/debuginfo/
http://ftp.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/
http://ftp1.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/
http://ftp2.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/
ftp://ftp.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-testing
http://ftp.ne.jp/Linux/packages/scientificlinux/6rolling/testing/$basearch/
http://ftp.jaist.ac.jp/pub/Linux/scientific/6rolling/testing/$basearch/
http://ftp.riken.jp/Linux/scientific/6rolling/testing/$basearch/
http://ftp.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/
http://ftp1.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/
http://ftp2.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/
ftp://ftp.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/
_EOF_
cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-testing-source
http://ftp.ne.jp/Linux/packages/scientificlinux/6rolling/testing/SRPMS/
http://ftp.jaist.ac.jp/pub/Linux/scientific/6rolling/testing/SRPMS/
http://ftp.riken.jp/Linux/scientific/6rolling/testing/SRPMS/
http://ftp.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/
http://ftp1.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/
http://ftp2.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/
ftp://ftp.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/
_EOF_

Scientific Linux 6.1にKVMのゲストインストール

参考:Scientific Linux 6 - KVM - 仮想マシン作成#1 : Server World

mkdir -p /var/kvm/images
virt-install -n www \
-r 1024 \
-f /var/kvm/images/www.img \
-s 20 \
--vcpus=2 \
--os-type linux \
--os-variant=rhel6 \
--network bridge=br0 \
--nographics \
--location='http://ftp.riken.jp/Linux/scientific/6.1/x86_64/os/' \
--extra-args='console=tty0 console=ttyS0,115200n8'

ゲストOSのインストール後、再起動したらhnakamur’s blog: Scientific Linux 6.1のyumレポジトリ設定を行った後、パッケージをアップデート。
yum update

私の環境は英語キーボードなので特に設定変更は不要。

ゲストOSをシャットダウンした状態で、イメージをテンプレート用にコピーしてとっておく。
virt-clone --original www --name template --file /var/kvm/images/template.img
クローンするたびにゲストでifconfig -aで見たときにイーサデバイスの名前がeth1, eth2と変わっていくことが判明。virt-clone したら eth0 が eth1 になっていた件 | MyNotebookでも同じ現象があったようだ。でも私のところではゲストをシャットダウンしても治らなかった。私のところでもその後さらにシャットダウンして起動で治りました。hnakamur’s blog: virt-cloneでコピー後eth0がeth1などに変わってしまうのを戻すの手順を行う必要があります。

ストレージプールの設定
mkdir /etc/libvirt/storage
cat << _EOF_ > /etc/libvirt/storage/disk01.xml
<pool type='dir'>
  <name>disk01</name>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
  </source>
  <target>
    <path>/var/kvm/images</path>
    <permissions>
        <mode>0700</mode>
        <owner>-1</owner>
        <group>-1</group>
    </permissions>
  </target>
</pool>
_EOF_

virsh pool-define /etc/libvirt/storage/disk01.xml

virsh pool-start disk01

virsh pool-autostart disk01

virsh pool-list

virsh pool-info disk01


ブログ アーカイブ