build/docker: CI: no tag reuse on env var change
[fuel.git] / deploy / README
1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # peter.barabas@ericsson.com
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 ======== PREREQUISITES ========
11
12 the following dependencies and python modules are required to be installed:
13
14 - for Ubuntu:
15
16 sudo apt-get update
17 sudo apt-get install -y libvirt-bin qemu-kvm python-pip fuseiso mkisofs \
18 genisoimage ipmitool
19 sudo apt-get install -y python-dev libz-dev libxml2-dev libxslt-dev libyaml-dev
20 sudo pip install pyyaml netaddr paramiko lxml scp pycrypto ecdsa amt
21
22 During libvirt install the user is added to the libvirtd group, so you have to
23 logout then login back again
24
25
26 ======== PREPARE and RUN the OPNFV Autodeployment ========
27
28
29 --- Step.1 Prepare the DEA and DHA configuration files and the OPNFV ISO file
30
31 Make sure that you are using the right DEA - Deployment Environment Adapter and
32 DHA - Deployment Hardware Adapter configuration files, the ones provided are only templates
33 you will have to modify them according to your needs
34
35 - If wou wish to deploy OPNFV cloud environment on top of KVM/Libvirt
36   virtualization use as example the following configuration files:
37
38   =>   templates/virtual_environment/conf/ha
39                 dea.yaml
40                 dha.yaml
41
42
43 - If you wish to deploy OPNFV cloud environment on hardware
44   use as example the following configuration files:
45
46   =>   templates/hardware_environment/conf/ericsson_montreal_lab/pod1/ha
47                 dea.yaml
48                 dha.yaml
49
50   =>   templates/hardware_environment/conf/linux_foundation_lab/pod1/ha
51                 dea.yaml
52                 dha.yaml
53
54   =>   templates/hardware_environment/conf/linux_foundation_lab/pod2/ha
55                 dea.yaml
56                 dha.yaml
57
58
59 --- Step.2 Run Autodeployment ---
60
61 usage: python ./deploy.py [-h] [-nf] [-nh] [-fo] [-co] [-c] [-iso [ISO_FILE]]
62                           [-dea [DEA_FILE]] [-dha [DHA_FILE]] [-s STORAGE_DIR]
63                           [-b PXE_BRIDGE] [-p FUEL_PLUGINS_DIR]
64                           [-pc FUEL_PLUGINS_CONF_DIR] [-np]
65                           [-dt DEPLOY_TIMEOUT] [-nde]
66
67 optional arguments:
68   -h, --help            show this help message and exit
69   -nf                   Do not install Fuel Master (and Node VMs when using
70                         libvirt)
71   -nh                   Don't run health check after deployment
72   -fo                   Install Fuel Master only (and Node VMs when using
73                         libvirt)
74   -co                   Cleanup VMs and Virtual Networks according to what is
75                         defined in DHA
76   -c                    Cleanup after deploy
77   -iso [ISO_FILE]       ISO File [default: OPNFV.iso]
78   -dea [DEA_FILE]       Deployment Environment Adapter: dea.yaml
79   -dha [DHA_FILE]       Deployment Hardware Adapter: dha.yaml
80   -s STORAGE_DIR        Storage Directory [default: images]
81   -b PXE_BRIDGE         Linux Bridge for booting up the Fuel Master VM
82                         [default: pxebr]
83   -p FUEL_PLUGINS_DIR   Fuel Plugins directory
84   -pc FUEL_PLUGINS_CONF_DIR
85                         Fuel Plugins Configuration directory
86   -np                   Do not install Fuel Plugins
87   -dt DEPLOY_TIMEOUT    Deployment timeout (in minutes) [default: 240]
88   -nde                  Do not launch environment deployment
89   -log [LOG_FILE]      Deployment log path and file name
90
91 * EXAMPLES:
92
93 - Install Fuel Master and deploy OPNFV Cloud from scratch on Hardware Environment:
94
95     sudo python deploy.py -iso ~/ISO/opnfv.iso -dea ~/CONF/hardware/dea.yaml -dha ~/CONF/hardware/dha.yaml -s /mnt/images -b pxebr -log ~/Deployment-888.log.tar.gz
96
97
98 - Install Fuel Master and deploy OPNFV Cloud from scratch on Virtual Environment:
99
100     sudo python deploy.py -iso ~/ISO/opnfv.iso -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -s /mnt/images -log ~/Deployment-888.log.tar.gz
101
102
103 - Deploy OPNFV Cloud on an already active Environment where Fuel Master VM is running so no need to install Fuel again:
104
105     sudo python deploy.py -nf -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -log ~/Deployment-888.log.tar.gz
106
107     => with plugin installation
108     sudo python deploy.py -nf -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -log ~/Deployment-888.log.tar.gz
109
110     => with cleanup after deployment is finished
111     sudo python deploy.py -nf -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -c -log ~/Deployment-888.log.tar.gz
112
113     => no healthcheck after deployment is completed
114     sudo python deploy.py -nf -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -nh -log ~/Deployment-888.log.tar.gz
115
116
117 - Install Fuel Master only (and Node VMs when using virtual environment):
118
119     => for virtual environment:
120     sudo python deploy.py -iso ~/ISO/opnfv.iso -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -s /mnt/images -log ~/Deployment-888.log.tar.gz
121
122     => for hardware environment:
123     sudo python deploy.py -iso ~/ISO/opnfv.iso -dea ~/CONF/hardware/dea.yaml -dha ~/CONF/hardware/dha.yaml -s /mnt/images -b pxebr -log ~/Deployment-888.log.tar.gz
124
125
126 - Cleanup a running OPNFV environment:
127
128     sudo python deploy.py -co -dha ~/CONF/virtual/dha.yaml
129
130
131 * WARNINGS:
132
133 =>  If optional argument -s <storage_dir> is not specified, Autodeployment will use
134 "<current_working_dir>/images" as default, and it will create it, if it hasn't been created before
135
136 =>  If optional argument -b <pxe_bridge> is not specified, Autodeployment will use "pxebr" as default,
137 if the bridge does not exist, the application will terminate with an error message
138
139 =>  If argument -iso [ISO_FILE] is not specified, Autodeployment will use "<current_working_dir>/OPNFV.iso"
140 as default, if the iso file does not exist, the application will terminate with an error message
141
142 =>  If argument -dea [DEA_FILE] is not specified, Autodeployment will use "<current_working_dir>/dea.yaml"
143 as default, if DEA file does not exist, the application will terminate with an error message
144
145 =>  If argument -dha [DHA_FILE] is not specified, Autodeployment will use "<current_working_dir>/dha.yaml"
146 as default, if DHA file does not exist, the application will terminate with an error message
147
148 => Optional argument -b PXE_BRIDGE is not required for Autodeployment in virtual environment,
149    even if it is specified it will not be used at all because virtual environment is using a different virtual network setup
150
151 => If optional argument -p FUEL_PLUGINS_DIR is not specified, no external plugins will be installed in Fuel
152
153
154 --- Networking considerations ---
155
156 For Virtual Environment:
157
158 There are some NAT, IPTABLE conflicts on the edge of libvirt bridging and Fuel Master
159 according to http://wiki.libvirt.org/page/Networking
160 netfilter on the bridges should be disabled
161
162 Add these lines to /etc/sysctl.conf
163
164 cat >> /etc/sysctl.conf <<EOF
165 net.bridge.bridge-nf-call-ip6tables = 0
166 net.bridge.bridge-nf-call-iptables = 0
167 net.bridge.bridge-nf-call-arptables = 0
168 EOF
169
170 and then reload configuration:
171 sysctl -p /etc/sysctl.conf