Clone
3
joid_on_single_machine
wluhan edited this page 2016-10-09 15:57:32 +02:00
  • RAM: 32GB
  • CPU: 10
  • Hard Disk: 1TB
  • OS: Ubuntu 14.04
  • Ethernet Interface: at least one (internet connected)

Prepare your environment

Before you actually deploy OpNFV, you need to enable virtualization in the BIOS settings. And then you can check whether it is enabled by running the command:kvm-ok

If it is properly enabled, you should see:

INFO: /dev/kvm exists
KVM acceleration can be used

You also need to create an account on your machine with the name ubuntu

sudo adduser ubuntu
sudo adduser ubuntu sudo \# give sudo privilege to user ubuntu
sudo su ubuntu \# change to user ubuntu

Deploy OpNFV with JOID

After you download the code, uncompress it, and change to the target directory: cd yourfolder/joid/ci

To make the deployment procedure more clear, you can firstly create a MAAS environment on you machine by using:

00-maasdeploy.sh

When it is done, you can type virsh list --all, you will notice that four VMs are created, including one bootstrap, and three VMs for control and compute.

Then bootstrap the Juju environment:

01-bootstrap.sh

If you can successfully bootstrap the environment, it means that your machine is ready to actually deploy OpNFV. If you failed at this step, carefully check your network connection. If the connection to internet is bad, you might failed.

./deploy.sh is the script that is used to deploy OpNFV. In fact, the above two steps are integrated into this script. You can using clean.sh to clear the created Juju environment, and use deploy.sh to deploy OpNFV in one shot. We are going to deploy OpNFV in a nonha mode, which needs less VMs. There is deployconfig.yaml under ~/.juju/ and joid/ci directory please modify the units: 5 to untis:3. Then you can deloy OpNFV by using:

./deploy.sh -o mitaka -s nosdn -t nonha -l default -f none -d xenial

The deployment will be finished in one or two hours, it depends on your network connection.

Trouble shooting

You might experience hook failures, add realtion failures or stuck at installing charms for a long time while running ./deploy.sh, what you can do is:

  • ssh into the VM with probelms by using juju ssh <machine id>, check its free memory cat /proc/meminfo, if it is too low, you can looply free memory using a script:
#!/bin/bash
while [  1 ]; do
        echo "Memory Freeing....."
        date
        sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches '
        cat /proc/meminfo |grep MemFree
        sleep 2m
done

Otherwise, you can allocate more memories to each VM by modify the default values in 00-maasdeploy.sh, and redeploy it.

  • If the failure is not due to low memory, you can run the following command should able to do rest of configuraiton and have openstack up and running.
count=`juju status nodes --format=short | grep nodes | wc -l`
c=0
while [ $c -lt $count ]; do
    juju ssh nodes/$c 'echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p' || true
    juju ssh nodes-compute/$c 'echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p' || true
    juju ssh nodes/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances' || true
    juju ssh nodes-compute/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances' || true
    let c+=1
done

Neglect the errors, like "node-compute not found...", and then

juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml xenial-mitaka

After that, you need to run the following commands:

juju expose ceph-radosgw
./openstack.sh nosdn default xenial mitaka || true
status=`juju action do heat/0 domain-setup`

You should solve it by using the above commands.