mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-05 04:06:49 +02:00
Updating and fixing vagrant ONOS VM
Change-Id: I75313d7e254aa08d8567ae5701c219677f279991 (cherry picked from commit 5f8893092a82dded627806b086fef68e1c3fb394)
This commit is contained in:
parent
84c5a3d8ad
commit
d8d8231ef2
26
tools/dev/vagrant/Vagrantfile
vendored
26
tools/dev/vagrant/Vagrantfile
vendored
@ -13,6 +13,9 @@ Vagrant.configure(2) do |config|
|
||||
v.customize ["modifyvm", :id, "--vram", "32"]
|
||||
end
|
||||
|
||||
# Creates an ONOS tutorial VM.
|
||||
# It contains Mininet, three LXC containers used as ONOS target machines, the tutorial files.
|
||||
# The machine comes also with the Ubuntu GUI to support tutorials.
|
||||
config.vm.define "onostutorial" do |d|
|
||||
d.vm.box = "ubuntu/xenial64"
|
||||
d.vm.hostname = "onostutorial"
|
||||
@ -33,9 +36,12 @@ Vagrant.configure(2) do |config|
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "onosdev" do |d|
|
||||
# Creates a VM with three LXC containers inside.
|
||||
# Miniet is installed on the virtual machine itself.
|
||||
# The three LXC containers serve as ONOS target machines.
|
||||
config.vm.define "onosdevmn" do |d|
|
||||
d.vm.box = "ubuntu/xenial64"
|
||||
d.vm.hostname = "onosdev"
|
||||
d.vm.hostname = "onosmn"
|
||||
d.vm.network "private_network", ip: "10.100.198.200"
|
||||
d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
|
||||
d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local"
|
||||
@ -48,6 +54,22 @@ Vagrant.configure(2) do |config|
|
||||
end
|
||||
end
|
||||
|
||||
# Creates a VM with three LXC containers inside, to be used as ONOS target machines.
|
||||
config.vm.define "onosdev" do |d|
|
||||
d.vm.box = "ubuntu/xenial64"
|
||||
d.vm.hostname = "onosdev"
|
||||
d.vm.network "private_network", ip: "10.100.198.200"
|
||||
d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
|
||||
d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local"
|
||||
d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local"
|
||||
d.vm.provider "virtualbox" do |v|
|
||||
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
|
||||
v.memory = 4096
|
||||
v.cpus = 2
|
||||
end
|
||||
end
|
||||
|
||||
# Creates a VM and installs Mininet in it.
|
||||
config.vm.define "mn" do |d|
|
||||
d.vm.box = "ubuntu/xenial64"
|
||||
d.vm.hostname = "mn"
|
||||
|
||||
@ -4,14 +4,14 @@
|
||||
#
|
||||
- name: Making sure Application folder is present
|
||||
file:
|
||||
path: "{{ app_dir }}"
|
||||
path: "/home/ubuntu/{{ app_dir }}"
|
||||
state: directory
|
||||
mode: 0777
|
||||
|
||||
- name: Downloading IntelliJ
|
||||
get_url:
|
||||
url: "{{ intellij.url }}"
|
||||
dest: "{{ app_dir }}/intellij.tar.gz"
|
||||
dest: "/home/ubuntu/{{ app_dir }}/intellij.tar.gz"
|
||||
|
||||
- name: Extracting IntelliJ
|
||||
unarchive:
|
||||
@ -21,5 +21,5 @@
|
||||
|
||||
- name: Removing IntelliJ tar.gz archive
|
||||
file:
|
||||
path: "{{ app_dir }}/intellij.tar.gz"
|
||||
path: "/home/ubuntu/{{ app_dir }}/intellij.tar.gz"
|
||||
state: absent
|
||||
@ -1,50 +1,12 @@
|
||||
---
|
||||
#
|
||||
# Installs ONOS and downloads the related dependencies. It then compiles the code.
|
||||
# Installs ONOS and downloads the related dependencies.
|
||||
#
|
||||
- name: Installing Maven
|
||||
apt:
|
||||
name: maven
|
||||
force: yes
|
||||
tags: [common]
|
||||
|
||||
- name: Creating Application folder
|
||||
file:
|
||||
path: "{{ app_dir }}"
|
||||
state: directory
|
||||
mode: 0777
|
||||
|
||||
- name: Creating Download folder
|
||||
file:
|
||||
path: "{{ download_dir }}"
|
||||
state: directory
|
||||
mode: 0777
|
||||
|
||||
- name: Downloading Apache Karaf
|
||||
get_url:
|
||||
url: "http://archive.apache.org/dist/karaf/{{ karaf_version }}/apache-karaf-{{ karaf_version }}.tar.gz"
|
||||
dest: "{{ download_dir }}"
|
||||
mode: 0777
|
||||
|
||||
- name: Copying Apache Karaf in the Application directory
|
||||
copy:
|
||||
src: "/home/ubuntu/{{ download_dir }}/apache-karaf-{{ karaf_version }}.tar.gz"
|
||||
dest: "/home/ubuntu/{{ app_dir }}/apache-karaf-{{ karaf_version }}.tar.gz"
|
||||
mode: 0777
|
||||
|
||||
- name: Extracting Apache Karaf
|
||||
unarchive:
|
||||
src: "/home/ubuntu/{{ download_dir }}/apache-karaf-{{ karaf_version }}.tar.gz"
|
||||
dest: "/home/ubuntu/{{ app_dir }}"
|
||||
mode: 0777
|
||||
|
||||
- name: Cloning ONOS repository
|
||||
git:
|
||||
repo: "{{ onos_repo_url }}"
|
||||
dest: onos
|
||||
version: onos-"{{ onos_version }}"
|
||||
become: true
|
||||
become_user: ubuntu
|
||||
dest: "{{ onos_dir }}"
|
||||
version: "onos-{{ onos_version }}"
|
||||
|
||||
- name: Changing ONOS repository permissions
|
||||
file:
|
||||
@ -63,19 +25,9 @@
|
||||
- name: Compiling ONOS
|
||||
shell: "{{ item }}"
|
||||
args:
|
||||
chdir: "/home/ubuntu/onos"
|
||||
chdir: "/home/ubuntu/onos/tools/build"
|
||||
with_items:
|
||||
- mvn clean install
|
||||
become: true
|
||||
become_user: ubuntu
|
||||
|
||||
- name: Changing .m2 repository permissions
|
||||
file:
|
||||
path: "/home/ubuntu/.m2"
|
||||
state: directory
|
||||
owner: ubuntu
|
||||
group: ubuntu
|
||||
mode: 0777
|
||||
- "./onos-buck build onos"
|
||||
|
||||
- name: Creating 1 node ONOS cell
|
||||
template:
|
||||
@ -101,14 +53,30 @@
|
||||
group: ubuntu
|
||||
mode: 0777
|
||||
|
||||
- name: Changing ONOS repository permissions
|
||||
file:
|
||||
path: "/home/ubuntu/onos"
|
||||
state: directory
|
||||
owner: ubuntu
|
||||
group: ubuntu
|
||||
mode: 0777
|
||||
|
||||
- name: Changing /tmp/stc dir permissions
|
||||
file:
|
||||
path: "/tmp/stc"
|
||||
state: directory
|
||||
owner: ubuntu
|
||||
group: ubuntu
|
||||
mode: 0777
|
||||
|
||||
- name: Deploying ONOS
|
||||
become: yes
|
||||
become_user: ubuntu
|
||||
shell: "/home/ubuntu/onos_deploy.sh"
|
||||
environment:
|
||||
ONOS_ROOT: /home/ubuntu/onos
|
||||
args:
|
||||
executable: /bin/bash
|
||||
become: true
|
||||
become_user: ubuntu
|
||||
|
||||
- name: Adding ONOS to startup
|
||||
become: yes
|
||||
|
||||
@ -3,4 +3,4 @@
|
||||
source $ONOS_ROOT/tools/dev/bash_profile
|
||||
cell 3node
|
||||
|
||||
onos-test
|
||||
stc setup
|
||||
@ -75,9 +75,6 @@
|
||||
create: yes
|
||||
block: |
|
||||
export ONOS_ROOT=/home/ubuntu/onos
|
||||
export KARAF_ROOT=/home/ubuntu/Applications/apache-karaf-{{ karaf_version }}
|
||||
export KARAF_TAR=/home/ubuntu/Applications/apache-karaf-{{ karaf_version }}.tar.gz
|
||||
export M2_REPO=/home/ubuntu/.m2/repository
|
||||
. /home/ubuntu/onos/tools/dev/bash_profile
|
||||
cell {{ item.value.cell }} > /dev/null
|
||||
with_dict: "{{ tutorials }}"
|
||||
|
||||
@ -3,23 +3,15 @@
|
||||
sudo rm -rf /tmp/*
|
||||
|
||||
export ONOS_ROOT=/home/ubuntu/onos
|
||||
export M2_REPO=/home/ubuntu/.m2/repository
|
||||
export KARAF_TAR=/home/ubuntu/{{ app_dir }}/apache-karaf-{{ karaf_version }}.tar.gz
|
||||
export KARAF_ROOT=/home/ubuntu/Applications/apache-karaf-{{ karaf_version }}
|
||||
source ${ONOS_ROOT}/tools/dev/bash_profile
|
||||
|
||||
sudo mn -c
|
||||
|
||||
sudo chmod -R 777 /home/ubuntu/onos
|
||||
sudo chmod -R 777 /home/ubuntu/.m2
|
||||
|
||||
cell 3node
|
||||
onos-service --cell stop
|
||||
|
||||
cell 1node
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
export ONOS_APPS=$ONOS_APPS,$1
|
||||
fi
|
||||
|
||||
onos-test
|
||||
@ -3,20 +3,12 @@
|
||||
sudo rm -rf /tmp/*
|
||||
|
||||
export ONOS_ROOT=/home/ubuntu/onos
|
||||
export M2_REPO=/home/ubuntu/.m2/repository
|
||||
export KARAF_TAR=/home/ubuntu/{{ app_dir }}/apache-karaf-{{ karaf_version }}.tar.gz
|
||||
export KARAF_ROOT=/home/ubuntu/{{ app_dir }}/apache-karaf-{{ karaf_version }}
|
||||
source ${ONOS_ROOT}/tools/dev/bash_profile
|
||||
|
||||
sudo mn -c
|
||||
|
||||
sudo chmod -R 777 /home/ubuntu/onos
|
||||
sudo chmod -R 777 /home/ubuntu/.m2
|
||||
|
||||
cell 3node
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
export ONOS_APPS=$ONOS_APPS,$1
|
||||
fi
|
||||
|
||||
onos-test
|
||||
@ -1,9 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
export ONOS_ROOT=/home/ubuntu/onos
|
||||
export M2_REPO=/home/ubuntu/.m2/repository
|
||||
export KARAF_TAR=/home/ubuntu/"{{ app_dir }}"/apache-karaf-"{{ karaf_version }}".tar.gz
|
||||
export KARAF_ROOT=/home/ubuntu/"{{ app_dir }}"/apache-karaf-"{{ karaf_version }}"
|
||||
source ${ONOS_ROOT}/tools/dev/bash_profile
|
||||
|
||||
cell 1node
|
||||
|
||||
@ -9,10 +9,16 @@
|
||||
update_cache: yes
|
||||
with_items: "{{ tutorials.optical.packages }}"
|
||||
|
||||
- name: Making sure Application folder is present
|
||||
file:
|
||||
path: "/home/ubuntu/{{ app_dir }}"
|
||||
state: directory
|
||||
mode: 0777
|
||||
|
||||
- name: Downloading ERLANG package
|
||||
get_url:
|
||||
url: "{{ tutorials.optical.erlang.package_url }}"
|
||||
dest: "{{ app_dir }}"
|
||||
dest: "/home/ubuntu/{{ app_dir }}"
|
||||
|
||||
- name: Extracting ERLANG package
|
||||
unarchive:
|
||||
|
||||
@ -31,10 +31,6 @@ bridge:
|
||||
name: "onosbr0"
|
||||
ip: "{{ dev_host.ip }}/24"
|
||||
|
||||
# ONOS Applications and Downloads folders
|
||||
app_dir: "Applications"
|
||||
download_dir: "Downloads"
|
||||
|
||||
# Basic packages to be installed
|
||||
basic_packages:
|
||||
- "bridge-utils"
|
||||
@ -44,18 +40,18 @@ basic_packages:
|
||||
- "lxc-dev"
|
||||
- "python-dev"
|
||||
- "python-pip"
|
||||
- "unzip"
|
||||
- "zip"
|
||||
|
||||
# ONOS
|
||||
onos_repo_url: "https://gerrit.onosproject.org/onos"
|
||||
onos_version: "1.6"
|
||||
onos_dir: "/home/ubuntu/onos"
|
||||
onos_version: "1.9"
|
||||
onos_nic: "10.100.198.*"
|
||||
onos_variables:
|
||||
- "export ONOS_ROOT=~/onos"
|
||||
- "source $ONOS_ROOT/tools/dev/bash_profile"
|
||||
|
||||
# Karaf
|
||||
karaf_version: "3.0.8"
|
||||
|
||||
# Tutorial reset files
|
||||
reset_files:
|
||||
- "/home/ubuntu/reset-to-1.sh"
|
||||
@ -69,6 +65,10 @@ cell_files:
|
||||
# URL where the ONOS Desktop background is downloaded from
|
||||
onos_background_url: "https://gerrit.onosproject.org/gitweb?p=onos-vm.git;a=blob_plain;f=onos.png;hb=refs/heads/master"
|
||||
|
||||
# ONOS app dir
|
||||
app_dir: "Application"
|
||||
download_dir: "Downloads"
|
||||
|
||||
# Wireshark
|
||||
wireshark:
|
||||
plugins_dir: ".config/wireshark/plugins"
|
||||
@ -80,8 +80,8 @@ google_chrome_repo: "deb http://dl.google.com/linux/chrome/deb/ stable main"
|
||||
|
||||
# IDEs configuration
|
||||
intellij:
|
||||
dir_name: "idea-IC-162.1628.40"
|
||||
url: "https://download.jetbrains.com/idea/ideaIC-2016.2.2.tar.gz"
|
||||
dir_name: "idea-IC-171.3780.107"
|
||||
url: "https://download.jetbrains.com/idea/ideaIC-2017.1.tar.gz"
|
||||
|
||||
# Tutorials configuration
|
||||
tutorials:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user