layout: post title: “openvnet のインストール” date: 2015-02-20 12:11:16 +0900 comments: true category: openvnet tags: [network] keywords: openvnet published: true


目的

openvnet のインストールと簡単なオペレーションのメモ

インストール

1
2
3
4
5
# curl -o /etc/yum.repos.d/openvnet.repo -R https://raw.githubusercontent.com/axsh/openvnet/master/openvnet.repo

# curl -o /etc/yum.repos.d/openvnet-third-party.repo -R https://raw.githubusercontent.com/axsh/openvnet/master/openvnet-third-party.repo

# yum install -y openvnet

設定ファイル

/etc/openvnet/vnmgr.conf

1
2
3
4
5
6
7
8
9
node {
  id "vnmgr"
  addr {
    protocol "tcp"
    host "127.0.0.1"
    port 9102
  }
  plugins [:vdc_vnet_plugin]
}

/etc/openvnet/vna.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
node {
  id "vna"
  addr {
    protocol "tcp"
    host "127.0.0.1"
    port 9103
  }
}

network {
  uuid ""
  gateway {
    address ""
  }
}

/etc/openvnet/webapi.conf

1
2
3
4
5
6
7
8
node {
  id "webapi"
  addr {
    protocol "tcp"
    host "127.0.0.1"
    port 9101
  }
}

vnmgr/vna/webapi が同一 Host に同居する場合は ZeroMQ の port は被らないように設定が必要

/etc/openvnet/common.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
registry {
  adapter "redis"
  host "127.0.0.1"
  port 6379
}

db {
  adapter "mysql2"
  host "localhost"
  database "vnet"
  port 3306
  user "root"
  password ""
}

初期セットアップ

/opt/axsh/openvnet/vnet/README.md を参照して作業

1
2
3
4
5
6
7
# mysqladmin -uroot create vnet

# export PATH=/opt/axsh/openvnet/ruby/bin:$PATH

# cd /opt/axsh/openvnet/vnet
# gem install bundler
# bundle exec rake db:init

下記のくだりの作業は不要(みたい)

1
2
3
4
Copy the upstart scripts into their proper directories

    cp /opt/axsh/openvnet/deployment/conf_files/etc/init/* /etc/init
    cp /opt/axsh/openvnet/deployment/conf_files/etc/default/* /etc/default

redis の設定

1
bind 172.25.255.254

redis の起動

1
service redis start

サービスの起動

1
2
3
start vnet-vnmgr
start vnet-vna
start vnet-webapi

サービスの起動確認

1
2
# initctl status vnet-vnmgr
vnet-vnmgr start/running, process 47122
1
2
# initctl status vnet-vna
vnet-vna start/running, process 47216
1
2
# initctl status vnet-webapi
vnet-webapi start/running, process 47283

ログの確認

vnctl コマンドのセットアップ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# cd /opt/axsh/openvnet/vnctl/bin
# /opt/axsh/openvnet/ruby/bin/bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on
this machine.
Fetching gem metadata from http://rubygems.org/.......
Installing fuguta 1.0.2
Installing multi_json 1.8.0
Installing multi_xml 0.5.5
Installing httparty 0.11.0
Installing thor 0.18.1
Using bundler 1.7.12
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from httparty:
When you HTTParty, you must party hard!

1 Box OpenVNet

1
2
3
4
# curl -o /root/vnet-test-kvm.tgz -R http://dlc.openvnet.axsh.jp/tests/vnet-test-kvm.tgz
# tar xvfz ./vnet-test-kvm.tgz
# export PATH=/opt/axsh/openvnet/ruby/bin:$PATH
# cd /root/vnet-test-kvm

db.sh の下記記述をコメントアウト

1
2
# mysqladmin -uroot create vnet
# (cd /opt/axsh/wakame-vnet/vnet; bundle exec rake db:init)

ip_node1 を opvbr0 に割り当てている IP に設定

ip_node1=‘10.1.0.1’

nw-public の一部を下記のように編集

–data-urlencode ipv4_network=10.1.0.0 \

1
# ./db.sh

ovs コマンド

1
# ovs-vsctl show

vnctl コマンド

1
# ./vnctl datapaths network show dp-1

OpenVNet の設定の流れ

Memo

メッセージキューに ZeroMQ を使っている Wakame-vdc だと RabbitMQ 使ってる

vnet-vna は Controller という名前のプロセスで動作している

redis の警告の対策

/var/log/redis/redis.log に下記のログが吐かれる

1
[4271] 04 Feb 09:23:33 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1
2
echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf
sysctl -p

:vdc_vnet_plugin

/etc/openvnet/vnmgr.conf の plugins [:vdc_vnet_plugin] は wakame-vdc との連携をさせる際に必要

bundle install 失敗

1
2
3
4
5
6
7
8
9
10
11
12
13
# gem list

*** LOCAL GEMS ***

bigdecimal (1.2.4)
bundler (1.8.3, 1.6.2)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.3)
rake (10.1.0)
rdoc (4.1.0)
test-unit (2.1.1.0)

参照 URL