Native Charms: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
(Created page with "= Native Charms = == Setup == Native charms are '''enabled by default''' on new installations of OSM. If you would like to enable support in an existing installation, see th...")
 
No edit summary
Line 14: Line 14:
3. Re-deploy OSM using the new environment variable.
3. Re-deploy OSM using the new environment variable.
  docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
  docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
4. Get the IP address of the Juju controller
$ juju status -m controller
Model      Controller  Cloud/Region        Version  SLA          Timestamp
controller  osm        localhost/localhost  2.5.8    unsupported  02:23:14Z<br>
Machine  State    DNS            Inst id        Series  AZ  Message
0        started  10.166.171.19  juju-4e295f-0  xenial      Running
5. Forward API traffic to the Juju controller (and make the rule persistent)
sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 17070 -j DNAT --to-destination 10.166.171.19:17070
netfilter-persistent save


== Design ==
== Design ==

Revision as of 02:26, 2 October 2019

Native Charms

Setup

Native charms are enabled by default on new installations of OSM. If you would like to enable support in an existing installation, see the following steps.

1. Remove the current OSM stack

docker stack rm osm

2. Edit /etc/osm/docker/lcm.env and append the following, substituting the IP address with that of your OSM host:

OSMLCM_VCA_APIPROXY=172.21.248.72

3. Re-deploy OSM using the new environment variable.

docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

4. Get the IP address of the Juju controller

$ juju status -m controller
Model       Controller  Cloud/Region         Version  SLA          Timestamp
controller  osm         localhost/localhost  2.5.8    unsupported  02:23:14Z
Machine State DNS Inst id Series AZ Message 0 started 10.166.171.19 juju-4e295f-0 xenial Running

5. Forward API traffic to the Juju controller (and make the rule persistent)

sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 17070 -j DNAT --to-destination 10.166.171.19:17070
netfilter-persistent save

Design

Native Charm Network Diagram.png

OSM uses Juju's LXD provider, which means that the Juju controller is only reachable, by default, from the OSM host machine via the lxdbr0 bridge. In order to use Juju's manual provisioning, the VM needs to be able to communicate bi-directionally with the Juju controller.

Manual provisioning is the process where the Virtual Machine is prepared to operate as a machine in Juju.

To accomplish this, we first add an iptable rule to the OSM host machine, routing traffic to port 17070 to the LXD container where the Juju controller is running. This is done automatically by the OSM installer.

Second, an iptable rule is added to the VM, during the provisioning process, routing traffic bound for the Juju controller's private address on the lxdbr0 network. This is done by the N2VC module when a Network Service, VNF, or VDU with a non-proxy charm is deployed.

Example Descriptor

Network Descriptor: File:Native ns.tar.gz

VNF Descriptor: File:Native vnf.tar.gz

In order to specify the use of a native charm, set the proxy key to False. It's also required to set the initial-config-primitive values for ssh-hostname and ssh-username, which tell N2VC how to connect to the Virtual Machine.

vdu-configuration:
    juju:
        charm: native-ci
        proxy: False
    initial-config-primitive:
    -   seq: '1'
        name: config
        parameter:
        -   name: ssh-hostname
            value: <rw_mgmt_ip>
        -   name: ssh-username
            value: ubuntu