Native Charms: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
No edit summary
No edit summary
Line 50: Line 50:
In order to specify the use of a native charm, set the '''''proxy''''' key to False. The ''config-access'' key informs OSM that SSH access is required, and to use the user '''ubuntu'''.  
In order to specify the use of a native charm, set the '''''proxy''''' key to False. The ''config-access'' key informs OSM that SSH access is required, and to use the user '''ubuntu'''.  


image: "ubuntu-16.04"
  vdu-configuration:
  vdu-configuration:
     juju:
     juju:

Revision as of 12:24, 8 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. The config-access key informs OSM that SSH access is required, and to use the user ubuntu.

image: "ubuntu-16.04"
vdu-configuration:
    juju:
        charm: native-ci
        proxy: False
    config-access:
        ssh-access:
            required: True
            default-user: ubuntu

Image

For best results, native charms expect to use a standard Ubuntu cloud image.

wget https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img
openstack image create --file="./xenial-server-cloudimg-amd64-disk1.img" \
   --container-format=bare \
   --disk-format=qcow2 \
   ubuntu-16.04
http://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
openstack image create --file="./bionic-server-cloudimg-amd64.img" \
   --container-format=bare \
   --disk-format=qcow2 \
   ubuntu-18.04