OpenMANO初探

OpenMANO包含:openvimd、opennanod和openmano-gui三部分以及两个命令行客户端:openvim和openmano。


OpenMANO框架

OpenMANO初探_第1张图片

OpenMANO架构图如上,openvimd负责管理外部组件,直接管理计算节点和图像存储,并通过Floodlight Openflow控制器来间接管理交换机。


环境需求:

为了简单体验一下openmano,搭建NFV环境至少需要两台在同一LAN下的服务器:

  • 一台服务器用作controller node控制节点,运行openmano组件。Openflow控制器运行在这个节点上。可以使用虚拟机或者在compute node计算机点内部。
  • 另一台服务器用作compute node计算节点,虚拟机部署在它上面。这台服务器必须是Linux系统、64bits OS with KVM, qemu and libvirt。为了发挥最佳性能,compute node计算节点必须遵循指定的方法配置。

ps:在测试API和CLI时,也可以没有compute node计算节点和Openflow控制器,在‘test’模式下运行openvim。但在这种模式下实际上并没有部署虚拟机。


安装

简单起见,可以将openmano和openvim都安装在同一台服务器上。两者都需要数据库(如MySQL)。Openvim还依赖于一台Openflow控制器。

自动安装

可以下载并运行Ubuntu Server LAMP,执行安装脚本。

  • 下载一个VDI Ubuntu Server14.10 LAMP。运行虚拟机并执行以下指令:
wget https://github.com/nfvlabs/openmano/raw/master/scripts/install-openmano.sh
chmod +x install-openmano.sh 
sudo ./install-openmano.sh    #mysql-user mysql-passwd
#NOTE: you can pass as parameters the mysql user and password (**root adminuser** for this VM image)
  • 也可以使用其他版本,如 Ubuntu Server 14.04 LTS (ubuntu/reverse), Ubuntu Desktop 64bits 14.04.2 LTS (osboxes/osboxes.org), CentOS 7。

手工安装

  • 在控制器节点上安装下列工具包:mysql, python-yaml, python-libvirt, python-bottle, python-mysqldb, python-jsonchema, python-paramiko, python-bs4, python-argcomplete, git。此外还可以安装screen工具包。

RedHat/Fedora/CentOS

#perhaps epel repository need to be installed: 'yum install epel-release; yum repolist'
sudo yum install     PyYAML      libvirt-python python-bottle MySQL-python \
python-jsonschema python-paramiko python-argcomplete python-requests git screen wget

Ubuntu/Debian

sudo apt-get install python-yaml python-libvirt python-bottle python-mysqldb \
python-jsonschema python-paramiko python-argcomplete python-requests git screen
  • Clone git 代码仓库
git clone https://github.com/nfvlabs/openmano.git openmano
  • 创建和初始化数据库

创建数据库

mysqladmin -u root -p create vim_db
mysqladmin -u root -p create mano_db

从localhost获得访问授权。

mysql> CREATE USER 'vim'@'localhost' identified by 'vimpw';
mysql> GRANT ALL PRIVILEGES ON vim_db.* TO 'vim'@'localhost';
mysql> CREATE USER 'mano'@'localhost' identified by 'manopw';
mysql> GRANT ALL PRIVILEGES ON mano_db.* TO 'mano'@'localhost';  
  • 编辑SQL数据库VIM文件 host_ranking.sql 和of_ports_correspondence.sql

  • 初始化数据库

openvim/database_utils/init_vim_db.sh # -uvim -pvimpw
openmano/database_utils/init_mano_db.sh -umano -pmanopw
  • 下载安装floodlight-0.90 Openflow controller
  • 下载安装openmano-gui
#allow apache user 'www-data'(or 'apache') grant access to the files, changing user owner
sudo chown -R www-data ./openmano-gui       #or 'apache' for other distributions
#create a link 
sudo ln -s //openmano-gui /var/www/html/openmano
#if web can not be loaded check:
#   Web service is running: 'sudo service apache2(or httpd) start'
#   Access permissions, e.g. parent directories have 'x' flag for others:
#       'sudo chmod o+x parent_folders'
#   check SElinux access for Redhat, Centos distributions:
#       sudo  chcon -R --reference=/var/www ./openmano-gui 
#   run 'sudo tail /var/log/apache2/error.log' (or 'sudo tail /var/log/httpd/error_log') to get clues on the problem
#   in case web server fails sending commands to openmano revise iptables (or firewalld) on running port (e.g. 9090)
  • 配置arg-complete和添加openvim and openmano clients环境便令
#creates a bin folder and links to openmano and openvim files inside /home/user/bin folder
mkdir -p ~/bin           #this folder is in the PATH for most Linux distributions
ln -s ${PWD}/openmano/openvim/openvim   ~/bin/openvim
ln -s ${PWD}/openmano/openmano/openmano ~/bin/openmano
#configure argautocomplete for this user
mkdir -p ~/.bash_completion.d
activate-global-python-argcomplete --dest=/home/${USER}/.bash_completion.d
#execute . .bash_completion.d/python-argcomplete.sh at login. Add to .bashrc
echo ". .bash_completion.d/python-argcomplete.sh" >> ~/.bashrc

配置和运行

你可能感兴趣的:(web,NVF,openmano)