2009年3月24日火曜日

Hyper-V Linux統合サービス

 
先日、Hyper-V上に構築したCentOS(参照)にLinux用統合サービスをインストールする。
(Microsoft Windows Server 2008 Hyper-V Linux Integration Components)

そもそもサーバ用途で構築しているので、マウスキャプチャは意味がありません。
ネイティブのネットワークアダプタを使ってパフォーマンスアップを目的とします。

1.LinuxICの取得
Microsoft Connectにログオンします。(hotmail等のアカウントが必要です)
「会員制プログラム一覧」→「カテゴリ」→ 「サーバー」→
「Linux Integration Components for Microsoft Hyper-V」 → ダウンロード(左上)
以下を指定してダウンロードします。
Microsoft Windows Server 2008 Hyper-V Linux Integration Components (Japanese)

※2009/07/20 RC2リリースに伴い一部変更になりました。
「会員制プログラム一覧」→「カテゴリ」→ 「サーバー」→ 「Linux Integration Components for Microsoft Hyper-V」 → ダウンロード(左上)
タイトルからLinux Integration Components RC2を指定してLinux_IC_v2_RC2.exeをダウンロードします。
サポートゲストOS

●SUSE Linux Enterprise Server 10 SP2 x86 and x64
●SUSE Linux Enterprise Server 11 x86 and x64
●Red Hat Enterprise Linux 5.2 x86 and x64
●Red Hat Enterprise Linux 5.3 x86 and x64
 
自己解凍式のEXEを展開するとLinuxIC.isoというイメージがあります。
これをそのまま仮想マシンのディスクの挿入として読み込みます。





2.LinuxICをコピー(rootで実行)
挿入されたISOファイルのあるドライブをマウントして中身をコピーします。また、コピー先はoptのlinux_icとします。

# mkdir /opt/linux_ic
# mkdir /mnt/cdrom
# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
# cp /mnt/cdrom/* /opt/linux_ic/ -r
# ls /opt/linux_ic/
drivers
patch
setup.pl
shim
v2v

3.仮想化関連のインストール
必要なツールをyumでインストールします。
# yum install kernel-devel kernel-xen kernel-xen-devel

4.ハイパーコールアダプタのインストール
# /opt/linux_ic/setup.pl x2v /boot/grub/grub.conf
Checking for XEN Virtualization install...done.
Installing Linux integration components (x2vshim) for Hyper-V...
Backing up /boot/grub/grub.conf...done.
Updating /boot/grub/grub.conf...done.
Copying X2V shim...done.
*** The x2vshim has been installed successfully. You will need to reboot. ***

再起動が必要ですと言われますが、実はこのまま再起動してもXENカーネルがうまく起動してくれません。

# ls /boot
x2v-pae.gzがあることを確認し次にgrub.confを書き換えます。
# vi /boot/grub/grub.conf
kernel /boot/x2v-32.gz → kernel /x2v-pae.gz
ここで再起動するとXENカーネルで起動します。
もし起動できない場合は、起動時に表示されるカーネル指定画面でXENカーネルになる前の旧カーネルを指定してとりあえず起動し、ここまでの内容をもう一度チェックしてみましょう。

5.ドライバのインストール
# /opt/linux_ic/setup.pl drivers
Checking if required components are installed...done.
Installing Linux integration components (vmbus, enlightened ide, enlightened scsi and network drivers) for Hyper-V...
Building vmbus driver...done.
Building blkvsc driver...done.
Building storvsc driver...done.
Building netvsc driver...done.
Installing vmbus driver...done.
Installing blkvsc driver...done.
Installing storvsc driver...done.
Installing netvsc driver...done.
Updating module dependencies. This may take a while...done.
Installing various udev rules and scripts...done.
Updating initrd image...
Backing up /boot/initrd-2.6.18-92.1.22.el5xen.img to /boot/initrd-2.6.18-92.1.22.el5xen.img.backup0
Done. Updated /boot/initrd-2.6.18-92.1.22.el5xen.img
Updating grub conf file...
Done.
Installing vmbus startup script...
*** The drivers have been installed successfully.*** [ OK ]

一度シャットダウンします。

6.Hyper-V仮想ネットワークの変更
レガシーネットワークアダプタを削除して通常(VMBus)のネットワークアダプタを割り当てて起動する。
ネットワークインターフェイスはeth0からseth0に変わります。
※seth0はDHCP取得に設定されている

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes → ONBOOT=no
# vi /etc/sysconfig/network-scripts/ifcfg-seth0
※私の環境です
DEVICE=seth0
BOOTPROTO=static
BROADCAST=10.1.255.255
IPADDR=10.1.1.71
NETMASK=255.255.0.0
NETWORK=10.1.0.0
ONBOOT=yes
 
# /etc/init.d/network restart
 

0 件のコメント:

Google検索