Juju installation (release 0): Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
No edit summary
 
(52 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This document intent is to provide a practical way to reproduce the environment in Telefonica lab (TEF) aim at running the demo scenario for Mobile World Congress 2016. It is not an explanation or long term recommendation for using juju.
__TOC__


Initially setup 2 Ubuntu 14.04 LTS VMs with 4 vcpu, 4G RAM and 40GB drive. Create user juju in sudo group (usermod -a -G sudo juju)
=VM creation=
* Juju Server and Client (single VM)
**Minimum Requirements:
*** 4 vCPU
*** 4GB RAM
*** 40GB disk
*Base image: ubuntu-14.04.4-server-amd64


#The first is juju jump server (or juju client) VM (10.95.172.10). This VM is only required for manual execution of juju commands and charms debugging.
In case you want to install them in separate VMs, the minimum requirements are:
#The second is juju server VM (10.95.172.193). This VM will receive commands from Juju client VM when doing manual testing, or directly from Rift.io Launchpad VM in OSM context. Juju charms will be deployed as containers in this VM
* Juju Server:
** 4 vCPU
** 4GB RAM
** 40GB disk
* Juju Client:
** 2 vCPU
** 2GB RAM
** 20GB disk
*Base image in both cases: ubuntu-14.04.4-server-amd64


On juju client VM:
=Installing required packages and libraries=
*install juju:
==Install Juju Server==
  sudo apt-get install python-software-properties
*Create a user (e.g. user osm, pwd osm) and add it to the sudo group.
sudo adduser osm
usermod -a -G sudo osm
*Install packages for Juju Server
sudo apt-get install systemd-services lxc ssh
*If required, edit the file '''/etc/default/lxc-net''' to change the lxc network addressing. This is only needed if there is overlapping with other network interfaces used by the Juju Server.
For instance, in order to use the subnet 10.0.3.0/24, you could make the following configuration:
LXC_BRIDGE="lxcbr0"
LXC_ADDR="10.0.3.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.3.0/24"
LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
LXC_DHCP_MAX="253"
 
==Install Juju Client==
*Install packages for Juju Client
  sudo apt-get install software-properties-common
  sudo add-apt-repository ppa:juju/stable
  sudo add-apt-repository ppa:juju/stable
  sudo apt-get update
  sudo apt-get update
  sudo apt-get install juju-quickstart juju-core
  sudo apt-get install juju juju-local juju-quickstart charm-tools squid-deb-proxy
*configure the connection to juju server VM in manual provider mode: ensure to have the following in your ~/.juju/environements.yaml
environments:
  mwc16manual:
    admin-secret: nfvjuju
    bootstrap-host: 10.95.172.193
    bootstrap-user: juju
    default-series: trusty
    type: manual


On juju server VM:
=Configuration=
*Configure it to access the management networks of openvim and openstack
*In the Juju client, edit '''/etc/squid-deb-proxy/mirror-dstdomain.acl''' to add the following lines:
*Change the default lxc
# launchpad personal package archives (disabled by default)
In TEF we use 10.0.3.0 which is the default lxc network so need to change that first:
ppa.launchpad.net
● sudo apt-get install systemd-services lxc
private-ppa.launchpad.net
Edit /etc/default/lxc-net to have something like :
LXC_BRIDGE="lxcbr0"
LXC_ADDR="10.1.3.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.1.3.0/24"
LXC_DHCP_RANGE="10.1.3.2,10.1.3.254"
Adapt to you need if necessary.
At this stage it is recommended to reboot to see if the networks are ok and resilient.
Setting up Juju
On the juju client ensure to have the following in your ~/.juju/environements.yaml


environments:
*In the Juju client, restart squid-deb-proxy:
  mwc16manual:
sudo service squid-deb-proxy restart
    admin-secret: nfvjuju
    bootstrap-host: 10.95.172.193
    bootstrap-user: juju
    default-series: trusty
    type: manual
Then :
● juju switch mwc16manual
● juju bootstrap --upload-tools


More information on the bootstrap process is available here: https://jujucharms.com/docs/1.25/config-manual
*In the Juju client, create file '''${HOME}/.juju/environments.yaml''' using the appropriate IP address for the bootstrap host (Juju server's IP address) and for the squid proxy (either the IP address of the LXC bridge - 10.0.3.1 - in case of a single-VM installation, or the IP address of the Juju client in case server and client are running in different VMs).
 
default: osm0-manual
As a nice optional add-on :
environments:
● juju deploy juju-gui --to 0
  osm0-manual:
Once done you can connect via https to the IP of the server.
    admin-secret: osm
 
    bootstrap-host: <jujuserver-ip>
More about using juju : https://github.com/juju/cheatsheet
    bootstrap-user: osm
 
    default-series: trusty
Charms for MWC :
    type: manual
 
    enable-os-refresh-update: False
Get the charms (do once)
    enable-os-upgrade: False
Let’s create a local repo of charms for convenience:
    apt-http-proxy: http://<proxy-ip>:8000
● mkdir -p ~/mwc16charms/trusty
    apt-https-proxy: http://<proxy-ip>:8000
● cd ~/mwc16charms/trusty
*From Juju client, bootstrap the environment:
● git clone git@github.com:6WIND/LinuxPE.git vpe-router
juju bootstrap -v    # -v so you can see what's going on
● git clone -b clearwater-aio-proxy https://github.com/Metaswitch/clearwater-juju.git
*From Juju client, test the environment deploying juju-gui:
● cp -rf clearwater-juju/charms/trusty/clearwater-aio-proxy/ .
juju deploy juju-gui --to 0
 
*Access juju-gui through the web browser (https://<jujuserver-ip> user:admin, pwd:osm)
To deploy
*Additional commands:
● cd ~/mwc16charms/
juju debug-log        # open this in another terminal or tab, so you can see what juju is doing while you type other commands
juju deploy local:trusty/vpe-router --to lxc:0 vpe1
juju status          # provides the status. When no charms have been launched, you should see an output like below:
juju deploy local:trusty/vpe-router --to lxc:0 vpe2
  environment: osm0-manual
● juju deploy local:trusty/vpe-router --to lxc:0 vpe3
  machines:
● juju deploy local:trusty/clearwater-aio-proxy --to lxc:0 ims-a
    "0":
juju deploy local:trusty/clearwater-aio-proxy --to lxc:0 ims-b
      agent-state: started
      agent-version: 1.25.5
      dns-name: 10.11.12.13
      instance-id: 'manual:'
      series: trusty
      hardware: arch=amd64 cpu-cores=4 mem=3953M
      state-server-member-status: has-vote
  services: {}
juju status --format=tabular
[Services]
NAME      STATUS  EXPOSED CHARM
juju-gui  unknown false  cs:trusty/juju-gui-54
[Units]
ID        WORKLOAD-STATE AGENT-STATE VERSION MACHINE PORTS          PUBLIC-ADDRESS MESSAGE
juju-gui/0 unknown        idle        1.25.5  0      80/tcp,443/tcp 10.11.12.13
[Machines]
ID        STATE  VERSION DNS          INS-ID  SERIES HARDWARE
0          started 1.25.5  10.11.12.13  manual: trusty arch=amd64 cpu-cores=4 mem=3953M


You can then configure/run actions on them.
*More about using juju: https://github.com/juju/cheatsheet


Using the API:
{{Feedback}}
● juju api-endpoints
Will give you the IP:Port to connect the juju client API code to.

Latest revision as of 09:09, 22 June 2016

VM creation

  • Juju Server and Client (single VM)
    • Minimum Requirements:
      • 4 vCPU
      • 4GB RAM
      • 40GB disk
  • Base image: ubuntu-14.04.4-server-amd64

In case you want to install them in separate VMs, the minimum requirements are:

  • Juju Server:
    • 4 vCPU
    • 4GB RAM
    • 40GB disk
  • Juju Client:
    • 2 vCPU
    • 2GB RAM
    • 20GB disk
  • Base image in both cases: ubuntu-14.04.4-server-amd64

Installing required packages and libraries

Install Juju Server

  • Create a user (e.g. user osm, pwd osm) and add it to the sudo group.
sudo adduser osm
usermod -a -G sudo osm
  • Install packages for Juju Server
sudo apt-get install systemd-services lxc ssh
  • If required, edit the file /etc/default/lxc-net to change the lxc network addressing. This is only needed if there is overlapping with other network interfaces used by the Juju Server.

For instance, in order to use the subnet 10.0.3.0/24, you could make the following configuration:

LXC_BRIDGE="lxcbr0" 
LXC_ADDR="10.0.3.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.3.0/24"
LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
LXC_DHCP_MAX="253"

Install Juju Client

  • Install packages for Juju Client
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:juju/stable
sudo apt-get update
sudo apt-get install juju juju-local juju-quickstart charm-tools squid-deb-proxy

Configuration

  • In the Juju client, edit /etc/squid-deb-proxy/mirror-dstdomain.acl to add the following lines:
# launchpad personal package archives (disabled by default)
ppa.launchpad.net
private-ppa.launchpad.net
  • In the Juju client, restart squid-deb-proxy:
sudo service squid-deb-proxy restart
  • In the Juju client, create file ${HOME}/.juju/environments.yaml using the appropriate IP address for the bootstrap host (Juju server's IP address) and for the squid proxy (either the IP address of the LXC bridge - 10.0.3.1 - in case of a single-VM installation, or the IP address of the Juju client in case server and client are running in different VMs).
default: osm0-manual
environments:
  osm0-manual:
    admin-secret: osm
    bootstrap-host: <jujuserver-ip>
    bootstrap-user: osm
    default-series: trusty
    type: manual
    enable-os-refresh-update: False
    enable-os-upgrade: False
    apt-http-proxy: http://<proxy-ip>:8000
    apt-https-proxy: http://<proxy-ip>:8000
  • From Juju client, bootstrap the environment:
juju bootstrap -v     # -v so you can see what's going on
  • From Juju client, test the environment deploying juju-gui:
juju deploy juju-gui --to 0
  • Access juju-gui through the web browser (https://<jujuserver-ip> user:admin, pwd:osm)
  • Additional commands:
juju debug-log        # open this in another terminal or tab, so you can see what juju is doing while you type other commands
juju status           # provides the status. When no charms have been launched, you should see an output like below:
 environment: osm0-manual
 machines:
   "0":
     agent-state: started
     agent-version: 1.25.5
     dns-name: 10.11.12.13
     instance-id: 'manual:'
     series: trusty
     hardware: arch=amd64 cpu-cores=4 mem=3953M
     state-server-member-status: has-vote
 services: {}
juju status --format=tabular
[Services]
NAME       STATUS  EXPOSED CHARM
juju-gui   unknown false   cs:trusty/juju-gui-54

[Units]
ID         WORKLOAD-STATE AGENT-STATE VERSION MACHINE PORTS          PUBLIC-ADDRESS MESSAGE
juju-gui/0 unknown        idle        1.25.5  0       80/tcp,443/tcp 10.11.12.13

[Machines]
ID         STATE   VERSION DNS          INS-ID  SERIES HARDWARE
0          started 1.25.5  10.11.12.13  manual: trusty arch=amd64 cpu-cores=4 mem=3953M
Your feedback is most welcome!
You can send us your comments and questions to OSM_TECH@list.etsi.org
Or join the OpenSourceMANO Slack Workplace
See hereafter some best practices to report issues on OSM