summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/moon-controller.yml2
-rw-r--r--deploy/adapters/ansible/roles/keystone/tasks/keystone_config.yml2
-rwxr-xr-xdeploy/compass_vm.sh11
-rwxr-xr-xdeploy/deploy_parameter.sh8
-rwxr-xr-xdeploy/launch.sh1
-rwxr-xr-xdeploy/network.sh2
-rwxr-xr-xdeploy/prepare.sh8
-rw-r--r--docs/FAQ/faq.rst21
-rw-r--r--docs/FAQ/how-to-build-customized-iso.rst42
-rw-r--r--docs/FAQ/how-to-deploy-while-jumphost-cannot-access-internet.rst7
-rw-r--r--docs/FAQ/how-to-deploy-without-internet-access.rst11
-rw-r--r--docs/FAQ/how-to-integrate-plugins.rst7
-rw-r--r--docs/FAQ/index.rst6
-rw-r--r--util/check_valid.py155
14 files changed, 216 insertions, 67 deletions
diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/moon-controller.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/moon-controller.yml
index 7a507c88..95dd2e89 100644
--- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/moon-controller.yml
+++ b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/moon-controller.yml
@@ -142,7 +142,7 @@
#############################################
- name: wait for keystone ready
- wait_for: port=35357 delay=3 timeout=10 host={{ internal_vip.ip }}
+ wait_for: port=35357 delay=3 timeout=10 host={{ internal_ip }}
#- name: cron job to purge expired tokens hourly
# cron:
diff --git a/deploy/adapters/ansible/roles/keystone/tasks/keystone_config.yml b/deploy/adapters/ansible/roles/keystone/tasks/keystone_config.yml
index 574ebabd..e7e9297e 100644
--- a/deploy/adapters/ansible/roles/keystone/tasks/keystone_config.yml
+++ b/deploy/adapters/ansible/roles/keystone/tasks/keystone_config.yml
@@ -12,7 +12,7 @@
shell: su -s /bin/sh -c 'keystone-manage db_sync' keystone
- name: wait for keystone ready
- wait_for: port=35357 delay=3 timeout=10 host={{ internal_vip.ip }}
+ wait_for: port=35357 delay=3 timeout=10 host={{ internal_ip }}
- name: cron job to purge expired tokens hourly
cron:
diff --git a/deploy/compass_vm.sh b/deploy/compass_vm.sh
index dc391acc..0c213e31 100755
--- a/deploy/compass_vm.sh
+++ b/deploy/compass_vm.sh
@@ -59,7 +59,16 @@ function wait_ok() {
sleep 1
let retry+=1
if [[ $retry -ge $1 ]];then
- timeout 1s ssh $ssh_args root@$MGMT_IP "exit"
+ # first try
+ ssh $ssh_args root@$MGMT_IP "exit"
+ # second try
+ ssh $ssh_args root@$MGMT_IP "exit"
+ exit_status=$?
+ if [[ $exit_status == 0 ]]; then
+ log_warn "final ssh login compass success !!!"
+ break
+ fi
+ log_error "final ssh retry failed with status: " $exit_status
log_error "os install time out"
exit 1
fi
diff --git a/deploy/deploy_parameter.sh b/deploy/deploy_parameter.sh
index d8696ce8..9c0d5dc0 100755
--- a/deploy/deploy_parameter.sh
+++ b/deploy/deploy_parameter.sh
@@ -111,3 +111,11 @@ function process_input_para()
echo $input_file
}
+
+function check_input_para()
+{
+ python ${COMPASS_DIR}/util/check_valid.py "$DHA" "$NETWORK"
+ if [ $? -ne 0 ];then
+ exit 1
+ fi
+}
diff --git a/deploy/launch.sh b/deploy/launch.sh
index 488e0fd7..489c06d8 100755
--- a/deploy/launch.sh
+++ b/deploy/launch.sh
@@ -19,6 +19,7 @@ prepare_python_env
source ${COMPASS_DIR}/util/log.sh
source ${COMPASS_DIR}/deploy/deploy_parameter.sh
source $(process_input_para $*) || exit 1
+check_input_para
source $(process_default_para $*) || exit 1
source ${COMPASS_DIR}/deploy/conf/${FLAVOR}.conf
source ${COMPASS_DIR}/deploy/conf/${TYPE}.conf
diff --git a/deploy/network.sh b/deploy/network.sh
index 46b8c023..b8bcd08b 100755
--- a/deploy/network.sh
+++ b/deploy/network.sh
@@ -17,6 +17,8 @@ function setup_bridge_net()
net_name=$1
nic=$2
+ sudo ifconfig $nic up
+
sudo virsh net-destroy $net_name
sudo virsh net-undefine $net_name
diff --git a/deploy/prepare.sh b/deploy/prepare.sh
index c8aa49f9..d326bd5b 100755
--- a/deploy/prepare.sh
+++ b/deploy/prepare.sh
@@ -114,6 +114,10 @@ function _pre_env_setup()
cd $WORK_DIR/prepare/jh_env_package
tar -zxvf trusty-jh-ppa.tar.gz
+ if [[ ! -z /etc/apt/sources.list.d ]]; then
+ mv /etc/apt/sources.list.d /etc/apt/sources.list.d.bak
+ fi
+
if [[ -f /etc/apt/apt.conf ]]; then
mv /etc/apt/apt.conf /etc/apt/apt.conf.bak
fi
@@ -158,6 +162,10 @@ EOF
if [[ -f /etc/apt/apt.conf.bak ]]; then
mv /etc/apt/apt.conf.bak /etc/apt/apt.conf
fi
+
+ if [[ ! -z /etc/apt/sources.list.d.bak ]]; then
+ mv /etc/apt/sources.list.d.bak /etc/apt/sources.list.d
+ fi
}
function _pre_pip_setup()
diff --git a/docs/FAQ/faq.rst b/docs/FAQ/faq.rst
index feae4142..177ff0bb 100644
--- a/docs/FAQ/faq.rst
+++ b/docs/FAQ/faq.rst
@@ -21,7 +21,9 @@ What's the additional setting in switch if use the default network configuration
================================================================================
Here is the Compass4nfv default network configration file:
-compass4nfv/deploy/conf/network_cfg.yaml
+compass4nfv/deploy/conf/hardware_environment/huawei-pod1/network.yml
+OR
+compass4nfv_FAQ/deploy/conf/vm_environment/huawei-virtual1/network.yml
It uses a VLAN network for mgmt and storage networks that are share one NIC(eth1) as a
default network configuration. So you need add an additional tagged VLAN (101) and VLAN (102) on
@@ -58,25 +60,26 @@ How to visit OpenStack Dashboard
You can visit OpenStack Dashboard by URL: http://{puclib_vip}/horizon
-The public virtual IP is configured in "compass4nfv/deploy/conf/network_cfg.yaml", defined as below:
+The public virtual IP is configured in "compass4nfv/deploy/conf/hardware_environment/huawei-pod1/network.yml"
+or "compass4nfv_FAQ/deploy/conf/vm_environment/huawei-virtual1/network.yml", defined as below:
.. code-block:: yaml
public_vip:
ip: 192.168.50.240
-How to access BM nodes after deployment
-=======================================
+How to access controller nodes after deployment
+===============================================
-1. First you should login Compass VM via ssh command on Jumphost by default user/pass root/root.
+1. First you should login Compass VM via ssh command on Jumphost by default user/pass root/root.
The default login IP of Compass VM is configured in "compass4nfv/deploy/conf/base.conf", defined as below:
.. code-block:: bash
export MGMT_IP=${MGMT_IP:-192.168.200.2}
-2. Then you can login the BM nodes (host1-3) by default user/pass root/root via the install network IPs
-which are configured in "compass4nfv/deploy/conf/base.conf", defined as below:
+2. Then you can login the controller nodes (host1-3) by default user/pass root/root via the install
+network IPs which are configured in "compass4nfv/deploy/conf/base.conf", defined as below:
.. code-block:: bash
@@ -108,8 +111,8 @@ which are configured in "compass4nfv/deploy/conf/base.conf", defined as below:
Where is OpenStack RC file
==========================
-It is located /opt/admin-openrc.sh in each BM node as default. Please source it first if you want to use
-OpenStack CLI.
+It is located /opt/admin-openrc.sh in each controller node as default. Please source it first if you
+want to use OpenStack CLI.
How to recovery network connection after Jumphost reboot
========================================================
diff --git a/docs/FAQ/how-to-build-customized-iso.rst b/docs/FAQ/how-to-build-customized-iso.rst
index 37b5c72b..c0bf4083 100644
--- a/docs/FAQ/how-to-build-customized-iso.rst
+++ b/docs/FAQ/how-to-build-customized-iso.rst
@@ -5,24 +5,20 @@ How to build a customized ISO
If you want to use Compass4nfv official ISO to deploy the environment, you can jump over this section.
-
This section indicates how to add additional packages and how to build a new compass4nfv ISO file
so that Compass4nfv would install the additional packages automatically during the deployment.
-
-* Approach 1 ----- apt/yum installation:
-
+Approach 1 ----- apt/yum installation
+-------------------------------------
1. Confirm the targeted packages could be installed via apt-get(Ubuntu) and yum(Centos),
you can verify on your own environment first by commands
"apt-get install {targeted packages}" on Ubuntu and "yum install {targeted packages}" on Centos.
-
2. Create a new role folder ({newrole}) in the compass4nfv/deploy/adapters/ansible/roles/,
create a new folder named "vars" in the new role folder({newrole}),
and create a file named "main.yml" and add "---" at the head of this file.
-
3. If the targeted packages names are same in both Ubuntu and Centos, you just need edit main.yml.
Add the packages' names as following:
@@ -35,7 +31,6 @@ Add the packages' names as following:
- {targeted packages3}
...
-
4. If the targeted packages' names are different in Ubuntu and Centos,
you need create "Debian.yml" and/or "RedHat.yml" in the same folder as "main.yml" and add "---" at the head of the files.
@@ -50,10 +45,8 @@ Add the packages' names as following in the "Debian.yml" and/or "RedHat.yml" :
- {targeted Ubuntu/RedHat packages3}
...
-
Also you can refer "compass4nfv/deploy/adapters/ansible/roles/glance/vars" as example.
-
5.1 Add the new role to ansible so that Compass4nfv will install the packages during the deployment :
"enter compass4nfv/deploy/adapters/ansible/openstack_juno/" and edit HA-ansible-multinodes.yml and/or single-controller.yml,
add {newrole} at an appropriate position, please be aware of that compass4nfv deploys the roles
@@ -70,7 +63,6 @@ The first line "hosts" of the section means compass4nfv will deploy {newrole} on
Also you can refer "glance" position in HA-ansible-multinodes.yml and single-controller.yml.
-
Attention
"HA-ansible-multinodes.yml" deploys controllers backup targeted environment
and 3 controllers in backup mode + 2 compute by default;.
@@ -101,10 +93,8 @@ Also please pay attention to the position inserted as Compass4nfv deploys the pa
Also you can refer "glance" position as example in HA-ansible-multinodes.yml and single-controller.yml.
-
6. Run compass4nfv/build/make_repo.sh.
-
7. After 6 finishs, please check "compass4nfv/work/repo/" folder,
if files as following exist in the folder, that means building packages successfully.
@@ -130,16 +120,12 @@ CENTOS7_JUNO_PPA is packages path for Centos, TRUSTY_JUNO_PPA is packages path f
9. Run compass4nfv/build.sh to build a new ISO, after finished, if there is a new ISO file compass.iso
in the "compass4nfv/work/building" folder, that means building iso successfully.
-
-
-
-* Approach 2 ---- source installation
-
+Approach 2 ---- source installation
+-----------------------------------
This section indicates to install packages from source codes. If the targeted packages could not be
installed from apt-get and yum but from source codes, please refer this section.
-
1. Enter folder "compass4nfv/build/arch/Debian" or "compass4nfv/build/arch/RedHat" that depend on
operating system you want to install package, create a bash(.sh) file
which includes all the commands which install the packages from source codes.
@@ -169,13 +155,11 @@ which includes all the commands which install the packages from source codes.
Please pay attention to the last second sentence, all the compiled packages need to be
copied to the "/var/cache/apt/archives/"(Ubuntu) folder, and for Centos, the folder is ... to be continued .
-
2. Add a new role so that Compass4nfv will install the packages during the deployment,
create a new role folder ({newrole}) in the "compass4nfv/deploy/adapters/ansible/roles/",
create a new folder named "vars" in the new role folder({newrole}),
and create a file named "main.yml" and add "---" at the head of this file.
-
3. If the packages' names are same in both Ubuntu and Centos, you just need edit main.yml.
Add the packages' names as following:
@@ -203,10 +187,8 @@ Add the packages' names as following in the "Debian.yml" and/or "RedHat.yml" :
- {targeted Ubuntu/RedHat packages3}
...
-
Also you can refer "compass4nfv/deploy/adapters/ansible/roles/glance/vars" as example.
-
5.1 Enter "compass4nfv/deploy/adapters/ansible/openstack_juno/" and edit HA-ansible-multinodes.yml
and/or single-controller.yml, add {newrole} at an appropriate position, please be aware of that compass4nfv
deploys the roles in the order as list in HA-ansible-multinodes.yml/single-controller.yml,
@@ -223,13 +205,11 @@ The first line "hosts" of the section means compass4nfv will deploy {newrole} on
Also you can refer "glance" position in HA-ansible-multinodes.yml and single-controller.yml.
-
Attention
"HA-ansible-multinodes.yml" deploys controllers backup targeted environment and
3 controllers in backup mode + 2 compute by default.
"single-controller.yml" deploys 1 controller + 4 compute.
-
5.2 Or insert the new role into the existing section at an appropriate position
in HA-ansible-multinodes.yml and single-controller.yml.
@@ -254,12 +234,8 @@ Also please pay attention to the position inserted as Compass4nfv deploys the pa
Also you can refer "glance" position as example in HA-ansible-multinodes.yml and single-controller.yml.
-
-
6. Run compass4nfv/build/make_repo.sh .
-
-
7. After 6 finishs, please check "compass4nfv/work/repo/" folder,
if files as following exist in the folder, that means building packages successfully.
@@ -269,8 +245,6 @@ trusty-juno-ppa.tar.gz is OpenStack Juno version for Ubuntu14.04.
trusty-kilo-ppa.tar.gz is OpenStack Kilo version for Ubuntu14.04.
-
-
8. Edit compass4nfv/build/build.conf, find CENTOS7_JUNO_PPA and TRUSTY_JUNO_PPA items,
modify these 2 items as local paths(if you just want deploy with one operating system, you just modify one item).
@@ -282,13 +256,5 @@ CENTOS7_JUNO_PPA is packages path for Centos, TRUSTY_JUNO_PPA is packages path f
TRUSTY_JUNO_PPA=/compass4nfv/work/repo/trusty-juno-ppa.tar.gz
-
-
9. Run compass4nfv/build.sh to build a new ISO, after finished, if there is a new ISO file compass.iso
in the "compass4nfv/work/building" folder, that means building ISO successfully.
-
-
-
-* Approach 3 ---- autonomous packages installation
-
-package installed, to be continued...
diff --git a/docs/FAQ/how-to-deploy-while-jumphost-cannot-access-internet.rst b/docs/FAQ/how-to-deploy-while-jumphost-cannot-access-internet.rst
index f12d38d0..986bd79a 100644
--- a/docs/FAQ/how-to-deploy-while-jumphost-cannot-access-internet.rst
+++ b/docs/FAQ/how-to-deploy-while-jumphost-cannot-access-internet.rst
@@ -3,8 +3,11 @@
How to deploy while Jumphost cannot access internet
===================================================
-If your Jumphost cannot access internet, don't worry, you can definitely deploy compass without internet access.
+If your Jumphost cannot access internet, don't worry, you can definitely deploy compass without
+internet access.
-You can download compass.iso first from OPNFV artifacts repository (http://artifacts.opnfv.org/, search compass4nfv and select an appropriate ISO file) via wget or curl. Then copy the compass.iso and the compass4nfv repository to your Jumphost and editor the ISO_URL to your local path.
+You can download compass.iso first from OPNFV artifacts repository (http://artifacts.opnfv.org/,
+search compass4nfv and select an appropriate ISO file) via wget or curl. Then copy the compass.iso
+and the compass4nfv repository to your Jumphost and editor the ISO_URL to your local path.
After that you can deploy compass without internet access.
diff --git a/docs/FAQ/how-to-deploy-without-internet-access.rst b/docs/FAQ/how-to-deploy-without-internet-access.rst
index 6bfcb3de..e91f110b 100644
--- a/docs/FAQ/how-to-deploy-without-internet-access.rst
+++ b/docs/FAQ/how-to-deploy-without-internet-access.rst
@@ -6,13 +6,12 @@ How to deploy without internet access
If you have created your own ISO file(compass.iso), you realy could deploy without internet access,
edit "compass4nfv/deploy/conf/base.conf" file and assign item ISO_URL as your local ISO file path
(export ISO_URL=file:///compass4nfv/work/building/compass.iso).
-Then execute "compass4nfv/deploy.sh" and Compass4nfv could deploy with local compass.iso without internet access.
-
+Then execute "compass4nfv/deploy.sh" and Compass4nfv could deploy with local compass.iso without
+internet access.
Also you can download compass.iso first from OPNFV artifacts repository
(http://artifacts.opnfv.org/, search compass4nfv and select an appropriate ISO file) via wget or curl.
-After this, edit "compass4nfv/deploy/conf/base.conf" file and assign item ISO_URL as your local ISO file path.
-Then execute "compass4nfv/deploy.sh" and Compass4nfv could deploy with local compass.iso without internet access.
-
-
+After this, edit "compass4nfv/deploy/conf/base.conf" file and assign item ISO_URL as your local ISO file
+path.Then execute "compass4nfv/deploy.sh" and Compass4nfv could deploy with local compass.iso without
+internet access.
diff --git a/docs/FAQ/how-to-integrate-plugins.rst b/docs/FAQ/how-to-integrate-plugins.rst
deleted file mode 100644
index 8e810d7d..00000000
--- a/docs/FAQ/how-to-integrate-plugins.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-.. two dots create a comment. please leave this logo at the top of each of your rst files.
-
-How to integrate plugins
-========================
-
-tbd
-
diff --git a/docs/FAQ/index.rst b/docs/FAQ/index.rst
index 7b349d0e..36408d0d 100644
--- a/docs/FAQ/index.rst
+++ b/docs/FAQ/index.rst
@@ -5,10 +5,12 @@
OPNFV(Colorado) Compass4nfv Frequently Asked Questions
=========================================================
-Contents:
-
.. toctree::
:numbered:
:maxdepth: 4
+ how-to-build-customized-iso.rst
+ how-to-deploy-while-jumphost-cannot-access-internet.rst
+ how-to-deploy-without-internet-access.rst
+ how-to-integrate-plugins.rst
faq.rst
diff --git a/util/check_valid.py b/util/check_valid.py
new file mode 100644
index 00000000..87cd57ed
--- /dev/null
+++ b/util/check_valid.py
@@ -0,0 +1,155 @@
+import re
+import os
+import yaml
+import sys
+import traceback
+
+
+def load_file(file):
+ with open(file) as fd:
+ try:
+ return yaml.load(fd)
+ except:
+ traceback.print_exc()
+ return None
+
+
+def err_print(info):
+ print '\033[0;31m%s\033[0m' % info
+
+
+def is_valid_ip(ip):
+ """return True if the given string is a well-formed IP address
+ currently only support IPv4
+ """
+ if not ip:
+ return False
+ res = re.search(
+ "^(0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}(\/(\d|[1-2]\d|3[0-2]))?$",
+ ip) is not None
+ return res
+
+
+def is_valid_mac(mac):
+ """return True if the given string is a well-formed MAC address
+ """
+ if not mac:
+ return False
+ res = re.search("^([a-zA-Z0-9]{2}:){5}[a-zA-Z0-9]{2}$", mac) is not None
+ return res
+
+
+def check_network_file(network):
+ invalid = False
+ for i in network['ip_settings']:
+ if not is_valid_ip(i['cidr']):
+ err_print('''invalid address:
+ ip_settings:
+ - name: %s
+ cidr: %s''' % (i['name'], i['cidr']))
+ invalid = True
+ if not is_valid_ip(i['ip_ranges'][0][0]):
+ err_print('''invalid address:
+ ip_settings:
+ - name: %s
+ ip_ranges:
+ - - %s''' % (i['name'], i['ip_ranges'][0][0]))
+ invalid = True
+ if not is_valid_ip(i['ip_ranges'][0][1]):
+ err_print('''invalid address:
+ ip_settings:
+ - name: %s
+ ip_ranges:
+ - %s''' % (i['name'], i['ip_ranges'][0][1]))
+ invalid = True
+ if i['name'] == 'external' and not is_valid_ip(i['gw']):
+ err_print(i['gw'])
+ err_print('''invalid address:
+ ip_settings:
+ - name: %s
+ gw: %s''' % (i['name'], i['gw']))
+ invalid = True
+
+ for i in network['public_net_info'].keys():
+ if i in ('external_gw', 'floating_ip_cidr',
+ 'floating_ip_start', 'floating_ip_end'):
+ if not is_valid_ip(network['public_net_info'][i]):
+ err_print('''invalid address:
+ public_net_info:
+ %s: %s''' % (i, network['public_net_info'][i]))
+ invalid = True
+
+ if not invalid:
+ return True
+ else:
+ return False
+
+
+def check_dha_file(dha):
+ invalid = False
+ if dha['TYPE'] == 'baremetal':
+ for i in dha['hosts']:
+ if not is_valid_mac(i['mac']):
+ err_print('''invalid address:
+ hosts:
+ - name: %s
+ mac: %s''' % (i['name'], i['mac']))
+ invalid = True
+ for j in i['interfaces']:
+ if not is_valid_mac(j.values()[0]):
+ err_print('''invalid address:
+ hosts:
+ - name: %s
+ interfaces:
+ - %s: %s''' % (i['name'], j.keys()[0], j.values()[0]))
+ invalid = True
+ if not is_valid_ip(i['ipmiIp']):
+ err_print('''invalid address:
+ hosts:
+ - name: %s
+ ipmiIp: %s''' % (i['name'], i['ipmiIp']))
+ invalid = True
+
+ if not invalid:
+ return True
+ else:
+ return False
+
+if __name__ == "__main__":
+
+ has_invalid = False
+
+ if len(sys.argv) != 3:
+ err_print('input file error')
+ sys.exit(1)
+
+ _, dha_file, network_file = sys.argv
+
+ if not os.path.exists(dha_file):
+ err_print("DHA file doesn't exit")
+ sys.exit(1)
+ else:
+ dha = load_file(dha_file)
+ if not dha:
+ err_print('format error in DHA: %s' % dha_file)
+ has_invalid = True
+ else:
+ if not check_dha_file(dha):
+ err_print('in DHA: %s' % dha_file)
+ has_invalid = True
+
+ if not os.path.exists(network_file):
+ err_print("NETWORK file doesn't exit")
+ sys.exit(1)
+ else:
+ network = load_file(network_file)
+ if not network:
+ err_print('format error in NETWORK: %s' % network_file)
+ has_invalid = True
+ else:
+ if not check_network_file(network):
+ err_print('in NETWORK: %s' % network_file)
+ has_invalid = True
+
+ if has_invalid:
+ sys.exit(1)