Initial OpenECOMP Demo commit
[demo.git] / heat / README.md
1 Content
2 ---
3
4 This repository contains all the HEAT templates for the instantiation of the OpenECOMP platform, and the vFirewall and vLoadBalancer/vDNS demo applications.
5
6 The repository includes:
7  - README.md: this file
8  - LICENSE.TXT: the license text
9  - OpenECOMP: contains the HEAT template for the installation of the OpenECOMP platform (openecomp.yaml) and the environment file (openecomp.env)
10  - vFW: contains the HEAT template for the instantiation of the vFirewall VNF (base_vfw.yaml) and the environment file (base_vfw.env)
11  - vLB: contains the HEAT template for the instantiation of the vLoadBalancer/vDNS VNF (base_vlb.yaml) and the environment file (base_vlb.env). The folder also contains the HEAT template for the DNS scaling-up scenario (dnsscaling.yaml) with its environment file (dnsscaling.env), and the HEAT template for the vLB packet generator (packet_gen_vlb.yaml) and its environment file (packet_gen_vlb.env).
12
13
14 OpenECOMP HEAT Template
15 ---
16
17 The OpenECOMP HEAT template spins up the entire OpenECOMP platform. The template, openecomp.yaml, comes with an environment file, openecomp.env, in which all the default values are defined.
18
19 The HEAT template is composed of two sections: (i) parameters, and (ii) resources. The parameter section contains the declaration and description of the parameters that will be used to spin up OpenECOMP, such as public network identifier, URLs of code and artifacts repositories, etc.
20 The default values of these parameters can be found in the environment file. The resource section contains the definition of:
21  - OpenECOMP Private Management Network, which OpenECOMP components use to communicate with each other and with VNFs
22  - OpenECOMP Virtual Machines (VMs)
23  - Public/private key pair used to access OpenECOMP VMs
24  - Virtual interfaces towards the OpenECOMP Private Management Network
25  - Disk volumes. 
26
27 Each VM specification includes Operating System image name, VM size (i.e. flavor), VM name, etc. Each VM has two virtual network interfaces: one towards the public network and one towards the OpenECOMP Private Management network, as described above. 
28 Furthermore, each VM runs a post-instantiation script that downloads and installs software dependencies (e.g. Java JDK, gcc, make, Python, ...) and OpenECOMP software packages and docker containers from remote repositories.
29
30 When the HEAT template is executed, the Openstack HEAT engine creates the resources defined in the HEAT template, based on the parameters values defined in the environment file.
31
32 Before running HEAT, it is necessary to customize the environment file. Indeed, some parameters, namely public_net_id, pub_key, openstack_tenant_id, openstack_username, and openstack_api_key, need to be set depending on the user's environment:
33
34         public_net_id:       INSERT YOUR NETWORK ID/NAME HERE
35         pub_key:             INSERT YOUR PUBLIC KEY HERE
36         openstack_tenant_id: INSERT YOUR TENANT ID HERE
37         openstack_username:  INSERT YOUR USERNAME HERE
38         openstack_api_key:   INSERT YOUR API KEY HERE
39
40 public_net_id is the unique identifier (UUID) or name of the public network of the cloud provider. Note that for Rackspace template, this value is already set to
41    
42         00000000-0000-0000-0000-000000000000
43
44
45 pub_key is string value of the public key that will be installed in each OpenECOMP VM. To create a public/private key pair in Linux, execute the following instruction:
46    
47         user@ubuntu:~$ ssh-keygen -t rsa
48
49 The following operations to create the public/private key pair occur:
50    
51         Generating public/private rsa key pair.
52         Enter file in which to save the key (/home/user/.ssh/id_rsa): 
53         Created directory '/home/user/.ssh'.
54         Enter passphrase (empty for no passphrase): 
55         Enter same passphrase again: 
56         Your identification has been saved in /home/user/.ssh/id_rsa.
57         Your public key has been saved in /home/user/.ssh/id_rsa.pub.
58
59 openstack_username, openstack_tenant_id (password), and openstack_api_key are user's credentials to access the Openstack-based cloud. Note that in the Rackspace web interface, openstack_api_key can be found by clicking on the username and then "Account Settings".
60
61
62 The OpenECOMP platform can be instantiated via Rackspace GUI or command line.
63
64 Instantiation via Rackspace GUI:
65  - Login to Rackspace with your personal credentials
66  - Click "Stack Templates" from the "Orchestration" menu
67  - Click "Create Custom Template"
68  - Paste or manually upload the HEAT template (openecomp.yaml)
69  - Specify a name for your template in the "Template Name" form
70  - Click "Create Template and Launch Stack" at the bottom of the page
71  - In the "Create Stack" page, specify a name for your stack in the "Stack Name" form and select the Rackspace Region
72  - In the "Advanced Option" menu, insert the values of the parameters specified in the environment file (openecomp.env)
73  - Click "Create Stack"
74
75
76 Instantiation via Command Line:
77  - Install the HEAT client on your machine, e.g. in Ubuntu (ref. http://docs.openstack.org/user-guide/common/cli-install-openstack-command-line-clients.html):
78
79         apt-get install python-dev python-pip
80         pip install python-heatclient        # Install heat client
81         pip install python-openstackclient   # Install the Openstack client to support multiple services
82  
83  - Create a file (named i.e. ~/rackspace/openrc) that sets all the environmental variables required to access Rackspace:
84
85         export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
86         export OS_USERNAME=INSERT YOUR USERNAME HERE
87         export OS_TENANT_ID=INSERT YOUR TENANT ID HERE
88         export OS_REGION_NAME=INSERT THE RACKSPACE REGION ID [IAD | DFW | SYD | HKG]
89         export OS_PASSWORD=INSERT YOUR PASSWORD HERE
90         
91  - Run the script from command line:
92
93         source ~/rackspace/openrc
94         
95  - In order to install the OpenECOMP platform, type:
96
97         heat stack-create STACK_NAME -f PATH_TO_HEAT_TEMPLATE(YAML FILE) -e PATH_TO_ENV_FILE       # Old HEAT client, OR
98         openstack stack create -t PATH_TO_HEAT_TEMPLATE(YAML FILE) -e PATH_TO_ENV_FILE STACK_NAME  # New Openstack client
99
100
101 VNFs HEAT Templates
102 ---
103
104 The HEAT templates for the demo apps are stored in vFW and vLB directories. 
105
106 vFW contains the HEAT template, base_vfw.yaml, and the environment file, base_vfw.env, that are used to instantiate a virtual firewall. The VNF is composed of three VMs:
107   - Packet generator
108   - Firewall
109   - Sink
110
111 The packet generator generates traffic that passes through the firewall and reaches the sink. The firewall periodically reports the number of packets received in a unit of time to the DCAE collector. If the reported number of packets received on the firewall is above a high-water mark or below a low-water mark, OpenECOMP will enforce a configuration change on the packet generator, reducing or augmenting the quantity of traffic generated, respectively.
112
113 vLB contains the HEAT template, base_vlb.yaml, and the environment file, base_vlb.env, that are used to spin up a virtual load balancer and a virtual DNS. vLB also contains the HEAT template, packet_gen_vlb.yaml, and the environment file packet_gen_vlb.env, of a packet generator that generates DNS queries.
114 The load balancer periodically reports the number of DNS query packets received in a time unit to the DCAE collector. If the reported number of received packets crosses a threshold, then OpenECOMP will spin up a new DNS based on the dnsscaling.yaml HEAT template and dnsscaling.env to better balance the load of incoming DNS queries.
115
116 The vFW and vLB HEAT templates and environment files are onboarded into OpenECOMP SDC and run automatically. The user is not required to run these templates manually.
117 However, before onboarding the templates following the instructions in the OpenECOMP documentation, the user should set the following values in the environment files:
118
119         public_net_id:       INSERT YOUR NETWORK ID/NAME HERE
120         pub_key:             INSERT YOUR PUBLIC KEY HERE