# network interface settings
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet manual
auto eth0
iface eth0 inet manual
allow-vmbr1 bond0
iface bond0 inet manual
ovs_type OVSBond
ovs_bridge vmbr1
ovs_bonds eth0 eth1
ovs_options bond_mode=active-backup
auto vmbr1
iface vmbr1 inet static
address 192.168.0.22
netmask 255.255.255.0
gateway 192.168.0.1
ovs_type OVSBridge
ovs_ports bond0
[root@kvm2 ~]# ovs-vsctl add-bond br2 bond2 eth2 eth5
ovs-vsctl: cannot create an interface named eth2 because a port named eth2 already exists on bridge br2
[root@kvm2 ~]# ovs-appctl bond/show bond1
---- bond1 ----
bond_mode: active-backup
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: off
slave eth1: disabled
may_enable: false
slave eth6: enabled
active slave
may_enable: true
eth1 Link Up 時
1234567891011121314
[root@kvm2 ~]# ovs-appctl bond/show bond1
---- bond1 ----
bond_mode: active-backup
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: off
slave eth1: enabled
may_enable: true
slave eth6: enabled
active slave
may_enable: true
openvswitch 2.1.3 と 2.3.1 の違い
2.1.3
1234567891011121314
# ovs-appctl bond/show bond3
---- bond3 ----
bond_mode: active-backup
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: off
slave eth3: enabled
active slave
may_enable: true
slave eth4: enabled
may_enable: true
2.3.1
12345678910111213141516
# ovs-appctl bond/show bond3
---- bond3 ----
bond_mode: active-backup
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: off
active slave mac: fc:15:b4:28:86:93(eno4)
slave eno4: enabled
active slave
may_enable: true
slave ens2f3: enabled
may_enable: true
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 の設定
/etc/redis.conf
1
bind 172.25.255.254
redis の起動
1
service redis start
サービスの起動
123
start vnet-vnmgr
start vnet-vna
start vnet-webapi
サービスの起動確認
12
# initctl status vnet-vnmgr
vnet-vnmgr start/running, process 47122
12
# initctl status vnet-vna
vnet-vna start/running, process 47216
12
# initctl status vnet-webapi
vnet-webapi start/running, process 47283
ログの確認
/var/log/openvnet/vna.log
/var/log/openvnet/vnmgr.log
/var/log/openvnet/webapi.log
vnctl コマンドのセットアップ
123456789101112131415
# 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
1234
# 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
[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.
vdc-manage>> network dc add public --uuid dcn-public --description "the network instances are started in"
vdc-manage>> network dc add-network-mode public securitygroup
vdc-manage>> network forward nw-demo1 public
$ vagrant box add chef/centos-6.6
==> box: Loading metadata for box 'chef/centos-6.6'
box: URL: https://vagrantcloud.com/chef/centos-6.6
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.
1) virtualbox
2) vmware_desktop
Enter your choice: 1
==> box: Adding box 'chef/centos-6.6' (v1.0.0) for provider: virtualbox
box: Downloading: https://vagrantcloud.com/chef/boxes/centos-6.6/versions/1.0.0/providers/virtualbox.box
==> box: Successfully added box 'chef/centos-6.6' (v1.0.0) for 'virtualbox'!
Vagrantfile の作成
vagrant init コマンドを利用して、Vagrantfile を作成
12345
$ vagrant init chef/centos-6.6
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
作成される Vagrantfile ( コメントアウト行は削除 )
123456789
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "chef/centos-6.6"
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "chef/centos-6.6"
config.vm.synced_folder ".", "/vagrant", disabled: true
end
任意で追加
Docker 環境セットアップ
123
config.vm.provision "docker" do |d|
d.version = 'latest'
end
chef 環境セットアップ
1
config.omnibus.chef_version = :latest
Vagrant Box の起動
vagrant up コマンドで起動
Vagrant Box のパッケージ化
vagrant package コマンドを利用して Box のパッケージを作成
1234567
$ vagrant package --output centos-6.6.box
WARNING: Could not load IOV methods. Check your GSSAPI C library for an update
WARNING: Could not load AEAD methods. Check your GSSAPI C library for an update
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Exporting VM...
==> default: Compressing package to: /private/tmp/centos-6.6.box
S3 へのアップロード
S3 の任意の場所に作成したパッケージファイル ( e.g. centos-6.6.box ) をアップロード。
==> default: Mounting shared folders...
default: /vagrant => /private/tmp
Vagrant::Errors::LinuxMountFailed: Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
The error output from the last command was:
/sbin/mount.vboxsf: mounting failed with the error: No such device