Onap Setup   

ONAP Setup

0. init

0.1 add user

Use the adduser command to add a new user to your system. Be sure to replace username with the user that you want to create.

$ adduser username

0.2 set sudo

$ echo "{username} ALL = (root) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/{username}
$ sudo chmod 0440 /etc/sudoers.d/{username}

echo “unap ALL = (root) NOPASSWD: ALL” | sudo tee /etc/sudoers.d/unap sudo chmod 0440 /etc/sudoers.d/unap

1. Perpare Environment

git clone http://github.com/openstack/fuel-plugin-ovs
cd fuel-plugin-ovs/demo

1.1 config resource

./00_bootstrap.sh

Config redsocks

$ ./01_setup_redsocks.sh
$ onap@hstack:~$ cat /etc/resolv.conf 
	# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
	#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
	nameserver 10.248.2.1
	search sh.intel.com

configure network

$ wget --no-proxy www.google.com  //if can upload, this is ok
$  sudo iptables-save
$  sudo service redsocks restart

1.2 Install Gnome

$ ./02_install_packages.sh 

1.3 Setup VNC

$ ./03_setup_vnc.sh
$ vncpasswd
$ vncserver :1
$ vnc4server -kill :1
$ vncconfig -nowin &

1.4 Setup VirtualBox

apt-get install -y virtualbox

1.5 Setup Vagrant

$ git clone http://github.intel.com/rguo/vagrant 
$ cd vagrant
$ ./setup_vagrant.sh

2.Setup Openstack and ONAP

2.1 Install Openstack

$ http://gerrit.onap.org/r/multicloud/openstack  
$ cd openstack/ocata/vagrant/
$ vi Vagrantfile   // change num_compute_nodes=1

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
$num_compute_nodes = 1

Vagrant.configure("2") do |config|

  config.vm.box = "bento/ubuntu-16.04"

  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--memory", 4096]
    vb.customize ["modifyvm", :id, "--cpus", 4]
    vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
    vb.customize "post-boot",["controlvm", :id, "setlinkstate1", "on"]
  end


$ vagrant status
$ vagrant up         // install all

Q1: how to know use config file(Vagrantfile)
A1: you must run "vagrant up" with Vagrantfile directory.

2.2 Install ONAP

Start ONAP

$ vagrant up onap

END ONAP

$ vagrant destroy -f onap

3.Vagrant

$ vagrant status
Current machine states:

control                   running (virtualbox)
compute-1                 running (virtualbox)
onap                      running (virtualbox)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.

$ vagrant ssh compute-1
$ cd devstack
$ vi stack.sh.log.2017-09-26-160010.summary.2017-09-26-160010

$ vagrant ssh control
$ bash /vagrant/create_vm.sh

4. Test Multi Cloud

$ cd openstack/ocata/vagrant/test
$ ./test_multicloud.sh