Convirt2のインストール

Convirt2を入れてみる。
手順は「ConVirt Wiki」の「Using Appliance with KVM」を参考にした。

1.CentOS5.6をインストール
  ※KVMのインストール忘れに注意
  ※インストール後のアップデートも忘れずに

2.インストール前の準備
  ・VNCクライアントがインストールされたPC準備
  ・ブリッジ(br0)の作成と仮想ネットワークの停止
   ※これを参考
  ・tcpの5900番ポートの開放
  ・libvirtVNC設定変更
   デフォルトでは「localhost(127.0.0.1)」しかListenしていないので変更する。
   ※「0.0.0.0」を指定すると、どのIPアドレスからも接続可能となるので注意
   ※可能なら「vnc_password」も有効にしパスワードを設定する。というか、しろ!
   # vi /etc/libvirt/qemu.conf

# vnc_listen = "0.0.0.0"
 ↓
vnc_listen = "0.0.0.0"

# vnc_password = "XYZ12345"
 ↓
vnc_password = "hogehoge" #デフォルトとままとかないよね?

3.Convirt2.0.1のVMイメージのダウンロードと展開
  # wget http://convirture.com/downloads/appliances/convirt-appliance-2.0.1.tbz2
  # tar xvfj convirt-appliance-2.0.1.tbz2

4.Convirt2.0.1のVMを登録と起動
  ・VMイメージの移動
   # mv c2_appliance.disk.xm /var/lib/libvirt/images/
  ・UUIDの生成
   # uuidgen -t

f632ffb8-84fd-11e0-829d-001d09f09baf

  ・VM設定ファイルの作成
   # vi /etc/libvirt/qemu/cms.xml

<domain type='kvm'>
  <name>cms</name>
  <uuid>f632ffb8-84fd-11e0-829d-001d09f09baf</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel5.4.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'>
    <timer name='pit' tickpolicy='delay'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/c2_appliance.disk.xm'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <controller type='ide' index='0'/>
    <interface type='bridge'>
      <mac address='54:52:00:07:6b:1f'/>
      <source bridge='br0'/>
      <model type='virtio'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='no' keymap='en-us'/>
  </devices>
</domain>

  ・VMの登録
   # virsh define /etc/libvirt/qemu/cms.xml

ドメイン cms が /etc/libvirt/qemu/cms.xml から定義されました

  ・VMの起動
   # virsh start cms

ドメイン cms が起動されました

5.Convirt2.0.1のVM接続と設定
  ※VNCクライアントから接続する。
  ※Convirt2のVM上で実施
  ※接続できない場合、tcp5900ポートが開放されているか確認。
  ・cmsへログイン
   ID:cms Password:convirt
  ・ネットワーク設定変更
   ※デフォルト「DHCP」なので問題なければそのまま
   $ sudo vi /etc/network/interfaces

# The primary network interface
auto eth0
iface eth0 inet dhcp
 ↓
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.0.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.254

  ネットワーク再起動
  $ sudo /etc/init.d/networking restart

6.Convirt2.0.1の起動
  ※Convirt2のVM上で実施
  $ cd ~/convirt
  $ ./convirt-ctl start

Trying to source ./tg2env/bin/activate
virtualenv set to /home/cms/convirt/tg2env

Using  /home/cms/.ssh/cms_id_rsa
Agent pid 864
Identity added: /home/cms/.ssh/cms_id_rsa (/home/cms/.ssh/cms_id_rsa)
ssh key added to agent.
Starting ConVirt using virtualenv : /home/cms/convirt/tg2env
Default character encoding is utf-8
Entering daemon mode
Server running in PID 874
ConVirt Started.

長くなったので続きは、後で。