diff options
231 files changed, 5606 insertions, 1015 deletions
@@ -1,33 +0,0 @@ -Project Name: Compass4nfv -Repo name: compass4nfv -Project Category: Integration and testing -Lifecycle State: Proposal approved -Primary Contact: Justin chi(chigang@huawei.com) -Project Lead: Justin chi -Jira Project Name: Compass4nfv -Jira Project Prefix: COMPASS -mailing list tag [COMPASS] -IRC: Server:freenode.net Channel:#opnfv-compass4nfv - -Committers: -Weidong shao (weidong.shao@huawei.com) -Prakash Ramchandran (Prakash.Ramchandran@huawei.com) -Justin chi (chigang@huawei.com) -Chenshuai (chenshuai@huawei.com) -Ashlee Young (ashlee@yunify.com) -Yifei Xue (xueyifei@huawei.com) -Xinhui Hu (xinhui_hu@foxmail.com) -Ramamani yeleswarapu (ramamani.yeleswarapu@intel.com) -Yibo Cai (yibo.cai@arm.com) -Harry Huang (huangxiangyu5@huawei.com) -Tianwei Wu (wutianwei1@huawei.com) - -Link to TSC approval: http://ircbot.wl.linuxfoundation.org/meetings/opnfv-meeting/2015/opnfv-meeting.2015-07-21-14.02.html - -Link to approval of new PTL: -https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2017-January/014591.html -https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2017-January/014601.html -https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2017-January/014709.html -https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2017-January/014726.html - -Link to approval of additional submitters: @@ -4,11 +4,11 @@ project_creation_date: '' project_category: 'Integration and testing' lifecycle_state: 'Proposal approved' project_lead: &opnfv_compass4nfv_ptl - name: 'Justin chi' - email: 'chigang@huawei.com' - id: 'chigang' + name: 'Harry Huang' + email: 'huangxiangyu5@huawei.com' + id: 'huangxiangyu' company: 'huawei.com' - timezone: 'Unknown' + timezone: 'UTC+8' primary_contact: *opnfv_compass4nfv_ptl issue_tracking: type: 'jira' @@ -23,25 +23,18 @@ realtime_discussion: server: 'freenode.net' channel: '#opnfv-compass4nfv' meetings: - - type: 'gotomeeting+irc' - agenda: # eg: 'https://wiki.opnfv.org/display/' - url: # eg: 'https://global.gotomeeting.com/join/819733085' + - type: 'zoom+irc' + agenda: 'https://wiki.opnfv.org/display/meetings/Compass4NFV+Integration+Discuss+Meeting' + url: 'https://zoom.us/j/5014627785' server: 'freenode.net' - channel: '#opnfv-meeting' + channel: '#opnfv-compass4nfv' repeats: 'weekly' - time: # eg: '16:00 UTC' + time: '01:00 UTC' repositories: - 'compass4nfv' + - 'compass-containers' committers: - <<: *opnfv_compass4nfv_ptl - - name: 'Prakash Ramchandran' - email: 'prakash.ramchandran@huawei.com' - company: 'huawei.com' - id: 'rprakash' - - name: 'shuai chen' - email: 'chenshuai@huawei.com' - company: 'huawei.com' - id: 'chenshuai' - name: 'Yifei Xue' email: 'xueyifei@huawei.com' company: 'huawei.com' @@ -50,6 +43,22 @@ committers: email: 'xinhui_hu@foxmail.com' company: 'foxmail.com' id: 'huxinhui' + - name: 'Ramamani yeleswarapu' + email: 'ramamani.yeleswarapu@intel.com' + company: 'intel.com' + id: 'ramay' + - name: 'Yibo Cai' + email: 'yibo.cai@arm.com' + company: 'arm.com' + id: 'yibocai' + - name: 'Tianwei Wu' + email: 'wutianwei1@huawei.com' + company: 'huawei.com' + id: 'wutianwei' + - name: 'Justin chi' + email: 'chigang@huawei.com' + company: 'huawei.com' + id: 'chigang' tsc: # yamllint disable rule:line-length approval: 'http//ircbot.wl.linuxfoundation.org/meetings/opnfv-meeting/2015/opnfv-meeting.2015-07-21-14.02.html' @@ -1,3 +1,11 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## # Compass4nfv Build Guide @@ -22,7 +22,7 @@ echo $COMPASS_PATH REDHAT_REL=${REDHAT_REL:-"false"} -PACKAGES="curl python-pip" +PACKAGES="curl python-pip aria2" mkdir -p $WORK_DIR $CACHE_DIR @@ -99,13 +99,13 @@ function download_packages() function build_tar() { cd $CACHE_DIR - sudo rm -rf compass_dists + sudo rm -rf compass_dists $TAR_DIR/$TAR_NAME mkdir -p compass_dists - sudo cp -f *.tar *.iso compass_dists - sudo cp $COMPASS_PATH/build/build*.yaml compass_dists - sudo cp -rf $COMPASS_PATH/util/docker-compose ./ - sudo tar -zcf compass.tar.gz docker-compose compass_dists - sudo mv compass.tar.gz $TAR_DIR/$TAR_NAME + cp -f *.tar *.iso *.tgz compass_dists + cp $COMPASS_PATH/build/build*.yaml compass_dists + cp -rf $COMPASS_PATH/util/docker-compose ./ + tar -zcf compass.tar.gz docker-compose compass_dists + mv compass.tar.gz $TAR_DIR/$TAR_NAME cd - } diff --git a/build/build-aarch64.yaml b/build/build-aarch64.yaml index 84352284..72d376e6 100644 --- a/build/build-aarch64.yaml +++ b/build/build-aarch64.yaml @@ -1,36 +1,42 @@ --- packages: - - name: CentOS-7-aarch64-Minimal-1611.iso + - name: CentOS-7-aarch64-Minimal-1708.iso description: "Centos ISO of each host for provisioning" get_method: cached - url: $COMPASS_ISO_REPO/CentOS-7-aarch64-Minimal-1611.iso + url: http://artifacts.opnfv.org/compass4nfv/package/master/CentOS-7-aarch64-Minimal-1708.iso - name: ubuntu-16.04-server-arm64.iso description: "Ubuntu ISO of each host for provisioning" get_method: cached - url: $COMPASS_ISO_REPO/ubuntu-16.04-server-arm64.iso + url: http://artifacts.opnfv.org/compass4nfv/package/master/ubuntu-16.04-server-arm64.iso + + # XXX: For now, it's only an empty file to satisfy build.sh + - name: harbor-empty.tgz + description: "The package of harbor offline installer" + get_method: cached + url: http://people.linaro.org/~yibo.cai/compass/harbor-empty.tgz - name: compass-deck description: "RESTful API and DB Handlers for Compass" get_method: docker - url: linaro/compass-deck:latest + url: opnfv/compass-deck:latest - name: compass-tasks-k8s description: "compass task container for kubernets deployment via kargo" get_method: docker - url: linaro/compass-tasks-k8s:latest + url: opnfv/compass-tasks-k8s:latest - name: compass-cobbler description: "cobbler container for compass" get_method: docker - url: linaro/compass-cobbler:latest + url: opnfv/compass-cobbler:latest - name: compass-db description: "datebase container for compass" get_method: docker - url: linaro/compass-db:latest + url: opnfv/compass-db:latest - name: compass-mq description: "message queue container for compass" get_method: docker - url: linaro/compass-mq:latest + url: rabbitmq:3.6.12 diff --git a/build/build.yaml b/build/build.yaml index 4f70f397..75faa280 100644 --- a/build/build.yaml +++ b/build/build.yaml @@ -3,12 +3,23 @@ packages: - name: CentOS-7-x86_64-Minimal-1708.iso description: "Centos ISO of each host for provisioning" get_method: cached - url: http://artifacts.opnfv.org/compass4nfv/package/master/CentOS-7-x86_64-Minimal-1708.iso + url: + - http://192.168.137.222/download/CentOS-7-x86_64-Minimal-1708.iso + - http://artifacts.opnfv.org/compass4nfv/package/master/CentOS-7-x86_64-Minimal-1708.iso - name: ubuntu-16.04.3-server-amd64.iso description: "Ubuntu ISO of each host for provisioning" get_method: cached - url: http://artifacts.opnfv.org/compass4nfv/package/master/ubuntu-16.04.3-server-amd64.iso + url: + - http://192.168.137.222/download/ubuntu-16.04.3-server-amd64.iso + - http://artifacts.opnfv.org/compass4nfv/package/master/ubuntu-16.04.3-server-amd64.iso + + - name: harbor-offline-installer-v1.5.0.tgz + description: "The package of harbor v1.5.0" + get_method: cached + url: + - http://192.168.137.222/download/harbor-offline-installer-v1.5.0.tgz + - http://artifacts.opnfv.org/compass4nfv/package/master/harbor-offline-installer-v1.5.0.tgz - name: compass-deck description: "RESTful API and DB Handlers for Compass" @@ -18,12 +29,12 @@ packages: - name: compass-tasks-osa description: "compass task container integrated with openstack-ansible" get_method: docker - url: huangxiangyu/compass-tasks-osa:latest + url: opnfv/compass-tasks-osa:latest - name: compass-tasks-k8s description: "compass task container integrated with kubespray" get_method: docker - url: compass4nfv/compass-tasks-k8s:latest + url: huxinhui/compass-tasks-k8s:7.0.1 - name: compass-cobbler description: "cobbler container for compass" @@ -43,7 +54,7 @@ packages: - name: yardstick description: "yardstick container for compass" get_method: docker - url: opnfv/yardstick:latest + url: opnfv/yardstick:stable - name: compass-repo-osa-ubuntu description: "compass repo container for deployment" diff --git a/build/parser.py b/build/parser.py index b80709cb..971d2844 100644 --- a/build/parser.py +++ b/build/parser.py @@ -18,65 +18,73 @@ def load_env(): return cache_dir +def exec_command(cmd, ignore_error=False): + rc = os.system(cmd) + if not ignore_error and rc != 0: + sys.exit(1) + else: + return rc + + def get_from_cache(cache, package): filename = package.get("name") - remotefile = package.get("url") + remotefile = list(package.get("url")) localfile = cache + "/" + filename localmd5file = localfile + ".md5" - remotemd5file = remotefile + ".md5" print "removing local md5 file...." cmd = "rm -f " + localmd5file - os.system(cmd) + exec_command(cmd) print "downloading remote md5 file to local...." - cmd = "curl --connect-timeout 10 -o " + localmd5file + " " + remotemd5file - os.system(cmd) - if os.path.exists(localmd5file): - print "calculate md5sum of local file" - cmd = "md5sum " + localfile + "|cut -d ' ' -f 1" - localmd5sum = os.popen(cmd).readlines() - cmd = "cat " + localmd5file + "|cut -d ' ' -f 1" - remotemd5sum = os.popen(cmd).readlines() - print "md5 local %s remote %s" % (localmd5sum, remotemd5sum) - if (remotemd5sum == localmd5sum): - print "Same with remote, no need to download...." - return + for file in remotefile: + remotemd5file = file + ".md5" + cmd = "curl --connect-timeout 10 -o {0} {1}".format( + localmd5file, remotemd5file) + rc = exec_command(cmd, True) + if os.path.exists(localfile): + print "calculate md5sum of local file" + cmd = "md5sum " + localfile + "|cut -d ' ' -f 1" + localmd5sum = os.popen(cmd).readlines() + cmd = "cat " + localmd5file + "|cut -d ' ' -f 1" + remotemd5sum = os.popen(cmd).readlines() + print "md5 local %s remote %s" % (localmd5sum, remotemd5sum) + if (remotemd5sum == localmd5sum): + print "Same with remote, no need to download...." + return + if rc == 0: + break print "downloading remote file to local...." - cmd = "curl --connect-timeout 10 -o " + localfile + " " + remotefile + cmd = "aria2c --max-tries 1 --max-connection-per-server=4 \ + --allow-overwrite=true --dir={0} --out={1} {2}".format( + cache, filename, " ".join(remotefile)) print cmd - rc = os.system(cmd) - if rc != 0: - sys.exit(1) + exec_command(cmd) def get_from_git(cache, package): localfile = cache + "/" + package.get("name") cmd = "rm -rf " + localfile print cmd - os.system(cmd) + exec_command(cmd) cmd = "git clone " + package.get("url") + " " + localfile print cmd - rc = os.system(cmd) - if rc != 0: - sys.exit(1) + exec_command(cmd) def get_from_docker(cache, package): + package_ouput = cache+"/"+package.get("name")+".tar" cmd = "sudo docker pull "+package.get("url") - os.system(cmd) - cmd = "sudo docker save "+package.get("url")+" -o "+cache+"/" - cmd += package.get("name")+".tar" - rc = os.system(cmd) - if rc != 0: - sys.exit(1) + exec_command(cmd) + cmd = "sudo docker save "+package.get("url")+" -o "+package_ouput + exec_command(cmd) + cmd = "user=$(whoami); sudo chown -R $user:$user "+package_ouput + exec_command(cmd) def get_from_curl(cache, package): cmd = "curl --connect-timeout 10 -o " + cache + "/" cmd += package.get("name") + " " + package.get("url") print cmd - rc = os.system(cmd) - if rc != 0: - sys.exit(1) + exec_command(cmd) def usage(): diff --git a/ci/deploy_ci.sh b/ci/deploy_ci.sh index dd8786af..028a8c9d 100755 --- a/ci/deploy_ci.sh +++ b/ci/deploy_ci.sh @@ -32,7 +32,7 @@ fi if [[ $ROOT_BUILD_CAUSE == MANUALTRIGGER ]]; then # For manual ci trigger build, directly use the value pass from CI export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-xenial} - export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-pike} + export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-queens} else # For daily build or verify build, adjust COMPASS_OS_VERSION and OPENSTACK_VERSION @@ -40,10 +40,10 @@ else if [[ $COMPASS_OS_VERSION == centos7 ]]; then export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-centos7} - export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-pike} + export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-queens} else export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-xenial} - export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-pike} + export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-queens} fi fi @@ -16,6 +16,9 @@ # export TAR_URL=file:///home/compass/compass4nfv.iso #export TAR_URL= +#export DEPLOY_HARBOR="true" +#export HABOR_VERSION="1.5.0" + # Set hardware deploy jumpserver PXE NIC # You need to comment out it when virtual deploy. #export INSTALL_NIC=eth1 @@ -30,7 +33,7 @@ #export OPENSTACK_VERSION=${OPENSTACK_VERSION:-ocata} -export OPENSTACK_VERSION=pike +export OPENSTACK_VERSION=queens export COMPASS_ARCH=$(uname -m) diff --git a/deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml b/deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml index 68dec5c2..094c6488 100755 --- a/deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml +++ b/deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml @@ -35,7 +35,10 @@ remote_user: root max_fail_percentage: 0 roles: - - kargo + - role: kargo + when: opencontrail is not defined + - role: install-k8s-opencontrail + when: opencontrail is defined and opencontrail == "Enable" - hosts: kube_master remote_user: root diff --git a/deploy/adapters/ansible/kubernetes/roles/ha/files/chk_k8s_master.sh b/deploy/adapters/ansible/kubernetes/roles/ha/files/chk_k8s_master.sh index 62e79b3b..db44246a 100644 --- a/deploy/adapters/ansible/kubernetes/roles/ha/files/chk_k8s_master.sh +++ b/deploy/adapters/ansible/kubernetes/roles/ha/files/chk_k8s_master.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016-2018 compass4nfv and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #!/bin/bash count=`ss -tnl | grep 6443 | wc -l` diff --git a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/tasks/main.yml index 4f8ca005..af234415 100644 --- a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/tasks/main.yml @@ -25,5 +25,5 @@ pkg: "{{ item }}" state: "present" update_cache: 'yes' - with_items: "{{ packages }}" + with_items: "{{ vars['packages_' + ansible_architecture] }}" when: ansible_os_family == 'Debian' diff --git a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/Debian.yml b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/Debian.yml index 0453dc44..6be9e06f 100644 --- a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/Debian.yml +++ b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/Debian.yml @@ -1,5 +1,5 @@ --- -packages: +packages_x86_64: - ubuntu-cloud-keyring - python-dev - python-pip @@ -11,6 +11,17 @@ packages: - python-crypto - git +packages_aarch64: + - ubuntu-cloud-keyring + - python-dev + - python-pip + - openvswitch-switch + - python-memcache + - python-iniparse + - python-lxml + - python-crypto + - git + pip_packages: - crudini - python-keyczar diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml index 26e3fa75..ae3dce76 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml @@ -3,7 +3,7 @@ # roles/download/defaults/main.yml etcd_version: v3.2.4-arm64 -flannel_version: "v0.8.0-arm64" +flannel_version: "v0.9.1-arm64" flannel_cni_image_repo: "linaro/flannel-cni-arm64" hyperkube_image_repo: "gcr.io/google-containers/hyperkube-arm64" hyperkube_image_tag: "{{ kube_version }}" @@ -14,20 +14,8 @@ dnsmasq_nanny_image_repo: "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-arm64" dnsmasq_sidecar_image_repo: "gcr.io/google_containers/k8s-dns-sidecar-arm64" kubednsautoscaler_image_repo: "gcr.io/google_containers/\ cluster-proportional-autoscaler-arm64" +dashboard_image_repo: "gcr.io/google_containers/kubernetes-dashboard-arm64" # inventory/group_vars/k8s-cluster.yml kube_network_plugin: flannel helm_enabled: false -docker_options: "--insecure-registry={{ kube_service_addresses }} \ ---graph={{ docker_daemon_graph }} {{ docker_log_opts }} \ ---add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \ ---default-runtime=docker-runc \ ---exec-opt native.cgroupdriver=systemd \ ---userland-proxy-path=/usr/libexec/docker/docker-proxy-current \ ---signature-verification=false" - -# roles/docker/vars/redhat.yml -docker_package_info: - pkg_mgr: yum - pkgs: - - name: docker diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml deleted file mode 100644 index e13e33ca..00000000 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Override default kubespray variables - -# Just a placeholder to satisfy ansible -dummy_var: 0 - -# helm_enabled: true diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/generate_inventories.py b/deploy/adapters/ansible/kubernetes/roles/kargo/files/generate_inventories.py deleted file mode 100755 index 2ffb4cae..00000000 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/generate_inventories.py +++ /dev/null @@ -1,86 +0,0 @@ -import yaml
-import sys
-import os
-from jinja2 import Environment
-try:
- import json
-except ImportError:
- import simplejson as json
-
-INVENTORY_TEMPLATE = """
-[all]
-{% for host, vales in hostvars.iteritems() %}
-{{ host }} ansible_ssh_host={{ vales['ansible_ssh_host'] }} \
-ansible_ssh_pass=root ansible_user=root
-{% endfor %}
-[kube-master]
-{% for host in kube_master %}
-{{ host }}
-{% endfor %}
-
-[etcd]
-{% for host in etcd %}
-{{ host }}
-{% endfor %}
-
-[kube-node]
-{% for host in kube_node %}
-{{ host }}
-{% endfor %}
-
-[k8s-cluster:children]
-kube-node
-kube-master
-
-[calico-rr]
-[vault]
-"""
-
-
-def _byteify(data, ignore_dicts=False):
-
- if isinstance(data, unicode):
- return data.encode('utf-8')
- if isinstance(data, list):
- return [_byteify(item, ignore_dicts=True) for item in data]
- if isinstance(data, dict) and not ignore_dicts:
- return {
- _byteify(key, ignore_dicts=True):
- _byteify(value, ignore_dicts=True)
- for key, value in data.iteritems()
- }
- return data
-
-
-def load_inventory(inventory):
- if not os.path.exists(inventory):
- raise RuntimeError('file: %s not exist' % inventory)
- with open(inventory, 'r') as fd:
- return json.load(fd, object_hook=_byteify)
-
-
-def create_inventory_file(inventories_path,
- hostvars, kube_master, etcd, kube_node):
- content = Environment().from_string(INVENTORY_TEMPLATE).render(
- hostvars=hostvars, kube_master=kube_master,
- etcd=etcd, kube_node=kube_node)
- with open(inventories_path, 'w+') as f:
- f.write(content)
-
-
-def main(inventories_path, local_inventory):
- inventory_data = load_inventory(local_inventory)
- hostvars = inventory_data['_meta']['hostvars']
- kube_node = inventory_data['kube_node']['hosts']
- kube_master = inventory_data['kube_master']['hosts']
- etcd = inventory_data['etcd']['hosts']
-
- create_inventory_file(inventories_path,
- hostvars, kube_master, etcd, kube_node)
-
-
-if __name__ == "__main__":
- path = yaml.load(sys.argv[1])
- local_inventory = yaml.load(sys.argv[2])
-
- main(path, local_inventory)
diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo b/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo index 1d622d3c..1d622d3c 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/openssl.conf.j2 b/deploy/adapters/ansible/kubernetes/roles/kargo/files/openssl.conf.j2 deleted file mode 100644 index d998d4cb..00000000 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/openssl.conf.j2 +++ /dev/null @@ -1,34 +0,0 @@ -[req] -req_extensions = v3_req -distinguished_name = req_distinguished_name -[req_distinguished_name] -[ v3_req ] -basicConstraints = CA:FALSE -keyUsage = nonRepudiation, digitalSignature, keyEncipherment -subjectAltName = @alt_names -[alt_names] -DNS.1 = kubernetes -DNS.2 = kubernetes.default -DNS.3 = kubernetes.default.svc -DNS.4 = kubernetes.default.svc.{{ dns_domain }} -DNS.5 = localhost -{% for host in groups['kube-master'] %} -DNS.{{ 5 + loop.index }} = {{ host }} -{% endfor %} -{% if loadbalancer_apiserver is defined and apiserver_loadbalancer_domain_name is defined %} -{% set idx = groups['kube-master'] | length | int + 5 + 1 %} -DNS.{{ idx | string }} = {{ apiserver_loadbalancer_domain_name }} -{% endif %} -{% for host in groups['kube-master'] %} -IP.{{ 2 * loop.index - 1 }} = {{ hostvars[host]['access_ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }} -IP.{{ 2 * loop.index }} = {{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }} -{% endfor %} -{% set idx = groups['kube-master'] | length | int * 2 + 1 %} -IP.{{ idx }} = {{ kube_apiserver_ip }} -IP.{{ idx + 1 }} = 127.0.0.1 -{% if supplementary_addresses_in_ssl_keys is defined %} -{% set is = idx + 1 %} -{% for addr in supplementary_addresses_in_ssl_keys %} -IP.{{ is + loop.index }} = {{ addr }} -{% endfor %} -{% endif %} diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml index b9d9c234..512121e2 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml @@ -7,153 +7,39 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -- name: clean local repo conf - file: - path: /etc/yum.repos.d - state: absent - run_once: "True" - when: ansible_os_family == 'RedHat' - -- name: create local repo conf dir - file: - path: /etc/yum.repos.d - state: directory - run_once: "True" - when: ansible_os_family == 'RedHat' - -- name: configure local mirror repo - copy: - src: "{{ item }}" - dest: /etc/yum.repos.d/mirrors.repo - with_first_found: - - mirrors_{{ ansible_architecture }}.repo - - mirrors.repo - run_once: "True" - when: ansible_os_family == 'RedHat' - -- name: clean local pip conf to use official pip repo - file: - path: /root/.pip/pip.conf - state: absent - run_once: "True" - -- name: install dependency for ansible update - yum: - name: "{{ item }}" - state: latest - with_items: - - git - - libffi-devel - - openssl-devel - - python-devel - run_once: "True" - when: ansible_os_family == 'RedHat' - -- name: update python packages - pip: - name: "{{ item }}" - state: latest - with_items: - - netaddr - - jinja2 - -- name: copy inventories generate script - copy: - src: generate_inventories.py - dest: /tmp/generate_inventories.py +- name: check the kubespray sample path + stat: path=/opt/kargo_k8s/inventory/sample + register: sample_stat + +- name: Move kubespray group_vars folder + command: mv /opt/kargo_k8s/inventory/sample/group_vars /opt/kargo_k8s/inventory/ + when: sample_stat.stat.exists + +- name: generate kubespray inventory configure file + template: + src: "inventory.j2" + dest: "/opt/kargo_k8s/inventory/inventory.cfg" tags: - ansible -- name: copy inventoriy.json file - copy: - src: "{{ run_dir }}/inventories/inventory.json" - dest: /tmp/inventory.json - tags: - - ansible - -- name: generate kargo inventories - shell: > - python /tmp/generate_inventories.py \ - "/opt/kargo_k8s/inventory/inventory.cfg" \ - "/tmp/inventory.json" - tags: - - ansible - -- name: configure target hosts - shell: | - cd /opt/kargo_k8s - ansible -i inventory/inventory.cfg -m ping all - ansible -i inventory/inventory.cfg all -m shell -a "rm /etc/yum.repos.d/*" - ansible -i inventory/inventory.cfg all -m copy -a \ - "src=/etc/yum.repos.d/mirrors.repo dest=/etc/yum.repos.d" - tags: - - ansible - -- name: enable helm - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/k8s-cluster.yml - regexp: '^helm_enabled:' - line: 'helm_enabled: {{ helm_flag }}' - -- name: enable external lb | set lb domain_nam - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/all.yml - regexp: '^## apiserver_loadbalancer_domain_name:' - line: 'apiserver_loadbalancer_domain_name: {{ apiserver_loadbalancer_domain_name }}' - -- name: enable external lb | - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/all.yml - regexp: '^#loadbalancer_apiserver:' - line: 'loadbalancer_apiserver:' - -- name: enable external lb | set vip address - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/all.yml - regexp: '^# address: 1.2.3.4' - line: ' address: {{ vipaddress }}' - -- name: enable external lb | set vip port - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/all.yml - regexp: '^# port: 1234' - line: ' port: {{ exlb_port }}' - -- name: enable internal lb - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/all.yml - regexp: '^#loadbalancer_apiserver_localhost: true' - line: 'loadbalancer_apiserver_localhost: true' - -- name: use the user name and password login the dashboard - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/k8s-cluster.yml - regexp: '^#kube_basic_auth: false' - line: 'kube_basic_auth: true' - - -- name: add vip to ssl keys - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/k8s-cluster.yml - line: 'supplementary_addresses_in_ssl_keys: [{{ vipaddress }}]' - -- name: rm openssl file - file: - path: /opt/kargo_k8s/roles/kubernetes/secrets/templates/openssl.conf.j2 - state: absent - -- name: copy openssl.conf.j2 - copy: - src: openssl.conf.j2 - dest: /opt/kargo_k8s/roles/kubernetes/secrets/templates/openssl.conf.j2 - -- name: copy overrided variables +- name: copy overrided variables for arm architecture copy: src: "{{ item }}" dest: /opt/kargo_k8s/extra-vars.yml with_first_found: - extra-vars-{{ ansible_architecture }}.yml - extra-vars.yml + - skip: true + +- name: copy overrided variables for kubespray + template: + src: "{{ item }}" + dest: "/opt/kargo_k8s/extra-vars.yml" + with_first_found: + - extra-vars-{{ ansible_architecture }}.yml.j2 + - extra-vars.yml.j2 + tags: + - ansible - name: copy 2flannel playbook to kargo copy: @@ -264,8 +150,22 @@ kube-controller-manager.manifest.j2", - name: run kargo playbook shell: | - cd /opt/kargo_k8s ansible-playbook -i inventory/inventory.cfg cluster.yml \ -e "@extra-vars.yml" -b -v 2>&1 | tee kargo.log + args: + chdir: "/opt/kargo_k8s" tags: - ansible + +- name: read the ansible log file + shell: "cat /opt/kargo_k8s/kargo.log | tail -n 1000" + register: setup_kargo_result + +- fail: + msg: "some task failed when setup kargo." + when: setup_kargo_result.stdout.find('failed=1') != -1 + +- fail: + msg: "some host are unreachable." + when: setup_kargo_result.stdout.find('unreachable=1') != -1 + run_once: true diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/templates/extra-vars.yml.j2 b/deploy/adapters/ansible/kubernetes/roles/kargo/templates/extra-vars.yml.j2 new file mode 100755 index 00000000..1d7a2fa2 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/templates/extra-vars.yml.j2 @@ -0,0 +1,40 @@ +--- +# Override default kubespray variables + +#dashboard_port: "{{dashboard_port|default('31746')}}" + +# kubespray configure +apiserver_loadbalancer_domain_name: "{{ public_vip.ip }}" +loadbalancer_apiserver: + address: "{{ public_vip.ip }}" + port: {{ loadbalancer_apiserver_port|default(8383) }} +loadbalancer_apiserver_localhost: {{ loadbalancer_apiserver_localhost|default(true) }} + +kube_basic_auth: {{ kube_basic_auth |default(true) }} +kube_network_plugin: {{ kube_network_plugin|default('calico') }} +# Monitoring apps for k8s +efk_enabled: {{ efk_enabled |default(true)}} +# Helm deployment +helm_enabled: {{ helm_enabled |default(true)}} +# Istio deployment +istio_enabled: {{ istio_enabled |default(false)}} +supplementary_addresses_in_ssl_keys: ["{{ public_vip.ip }}"] +#storage +local_volume_provisioner_enabled: {{local_volume_provisioner_enabled |default(false) }} +# local_volume_provisioner_namespace: "system_namespace" +# local_volume_provisioner_base_dir: /mnt/disks +# local_volume_provisioner_mount_dir: /mnt/disks +# local_volume_provisioner_storage_class: local-storage + +# CephFS provisioner deployment +cephfs_provisioner_enabled: {{ cephfs_provisioner_enabled |default(false)}} +# cephfs_provisioner_namespace: "cephfs-provisioner" +# cephfs_provisioner_cluster: ceph +# cephfs_provisioner_monitors: "172.24.0.1:6789,172.24.0.2:6789,172.24.0.3:6789" +# cephfs_provisioner_admin_id: admin +# cephfs_provisioner_secret: secret +# cephfs_provisioner_storage_class: cephfs +# cephfs_provisioner_reclaim_policy: Delete +# cephfs_provisioner_claim_root: /volumes +# cephfs_provisioner_deterministic_names: true + diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/templates/inventory.j2 b/deploy/adapters/ansible/kubernetes/roles/kargo/templates/inventory.j2 new file mode 100644 index 00000000..0120ae18 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/templates/inventory.j2 @@ -0,0 +1,26 @@ +[all] +{% for host, vales in hostvars.iteritems() %} +{{ host }} ansible_ssh_host={{ vales['ansible_ssh_host'] }} ansible_ssh_pass=root ansible_user=root +{% endfor %} + +[kube-master] +{% for host in hostvars[inventory_hostname]['groups']['kube_master'] %} +{{ host }} +{% endfor %} + +[etcd] +{% for host in hostvars[inventory_hostname]['groups']['etcd'] %} +{{ host }} +{% endfor %} + +[kube-node] +{% for host in hostvars[inventory_hostname]['groups']['kube_node'] %} +{{ host }} +{% endfor %} + +[k8s-cluster:children] +kube-node +kube-master + +[calico-rr] +[vault] diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/vars/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/vars/main.yml index 21287b02..af9c9675 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/vars/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/vars/main.yml @@ -1,6 +1,3 @@ --- -helm_flag: true -apiserver_loadbalancer_domain_name: "{{ public_vip.ip }}" -vipaddress: "{{ public_vip.ip }}" -exlb_port: 8383 -kubelet_fail_swap_on: false +http_proxy: "{{ proxy }}" +https_proxy: "{{ proxy }}" diff --git a/deploy/adapters/ansible/kubernetes/roles/post-k8s/defaults/main.yml b/deploy/adapters/ansible/kubernetes/roles/post-k8s/defaults/main.yml new file mode 100644 index 00000000..aa9fd8a0 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/post-k8s/defaults/main.yml @@ -0,0 +1,11 @@ +--- + +local_release_dir: "/tmp/releases" +heapster_enable: true +retry_stagger: 5 +heapster: + enabled: true + owner: "root" + mode: "0755" + version: "1.5.2" +heapster_download_url: https://github.com/kubernetes/heapster/archive/v{{ heapster.version }}.tar.gz diff --git a/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml index 3feca3e5..d382a5e1 100644 --- a/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml @@ -14,3 +14,51 @@ dest: /opt/admin.conf flat: "yes" when: inventory_hostname == groups['kube_master'][0] + +- name: Create heapster dest directory + file: + path: "{{local_release_dir}}/heapster" + state: directory + recurse: "yes" + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] + +- name: get the package of heapster + get_url: + url: "{{heapster_download_url}}" + dest: "{{local_release_dir}}/heapster" + owner: "{{ heapster.owner|default(omit) }}" + mode: "{{ heapster.mode|default(omit) }}" + register: get_url_result + until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg" + retries: 4 + delay: "{{ retry_stagger | random + 3 }}" + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] + +- name: untar the file of heapster + shell: | + cd "{{ local_release_dir }}/heapster"; + tar zxvf "heapster-{{ heapster.version }}.tar.gz" + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] + +- name: replace the cpu architecture for aarch64 + shell: | + cd "{{ local_release_dir }}/heapster/heapster-{{ heapster.version }}/deploy/"; + find ./kube-config -name "*.yaml" -exec sed -i "s/amd64/arm64/g" {} \; + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] + - ansible_architecture == "aarch64" + +- name: install the heapster + shell: | + cd "{{ local_release_dir }}/heapster/heapster-{{ heapster.version }}/deploy/"; + ./kube.sh start + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/sources.list.official.aarch64 b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/sources.list.official.aarch64 new file mode 100644 index 00000000..f4a3f5e9 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/sources.list.official.aarch64 @@ -0,0 +1,54 @@ +# deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial main restricted + +# deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted +# deb http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial main restricted +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial universe +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial universe +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates universe +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial multiverse +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial multiverse +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates multiverse +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted universe multiverse +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu xenial partner +# deb-src http://archive.canonical.com/ubuntu xenial partner + +deb http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted +deb http://ports.ubuntu.com/ubuntu-ports xenial-security universe +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security universe +deb http://ports.ubuntu.com/ubuntu-ports xenial-security multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security multiverse diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/Ubuntu.yml b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/Ubuntu.yml index 44e3b1f6..b4ef9278 100644 --- a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/Ubuntu.yml +++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/Ubuntu.yml @@ -62,10 +62,17 @@ - name: remove the space end of the line in the resolv.conf shell: "sed -i 's/ *$//' /etc/resolv.conf" +- name: remove estuary overlay and update apt cache + shell: rm -f /etc/apt/sources.list.d/estuary.list && apt-get update + when: ansible_architecture == "aarch64" + - name: change sources list copy: - src: sources.list.official + src: "{{ item }}" dest: /etc/apt/sources.list + with_first_found: + - sources.list.official.{{ ansible_architecture }} + - sources.list.official - name: restart ntp service shell: "service ntp restart" diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/main.yml index c915ec09..844d76a3 100644 --- a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/main.yml @@ -15,4 +15,6 @@ - name: close the swap partition shell: | + systemctl disable swap.target + systemctl mask swap.target swapoff -a diff --git a/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/tasks/RedHat.yml b/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/tasks/RedHat.yml index 5b434dbe..d32cf238 100644 --- a/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/tasks/RedHat.yml +++ b/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/tasks/RedHat.yml @@ -56,6 +56,9 @@ - name: restart the network shell: systemctl restart network +- name: install python lib + shell: yum install -y python-yaml python-netaddr + - name: make sure python lib exist action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov-rbac.yml.j2 b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov-rbac.yml.j2 index 1298aeaa..0ce663b1 100644 --- a/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov-rbac.yml.j2 +++ b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov-rbac.yml.j2 @@ -11,7 +11,7 @@ metadata: namespace: "{{system_namespace}}" --- kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 metadata: name: sriov rules: @@ -36,7 +36,7 @@ rules: - patch --- kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 metadata: name: sriov roleRef: diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov.yml.j2 b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov.yml.j2 index 90c7f28c..3a9e819b 100644 --- a/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov.yml.j2 +++ b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov.yml.j2 @@ -4,13 +4,20 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 --- -apiVersion: extensions/v1beta1 -kind: ThirdPartyResource +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition metadata: name: network.kubernetes.com -description: "A specification of a Network obj in the kubernetes" -versions: -- name: v1 +spec: + group: kubernetes.com + version: v1 + scope: Namespaced + names: + plural: networks + singular: network + kind: Network + shortNames: + - net --- apiVersion: v1 kind: ServiceAccount @@ -43,7 +50,7 @@ data: } } --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: kube-flannel-ds diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index c14f958e..152a7dc0 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -107,6 +107,7 @@ - utility_all[0] - network_hosts[0] - horizon + - compute remote_user: root roles: - post-openstack @@ -120,3 +121,10 @@ remote_user: root roles: - moon + +- hosts: + - ceph_adm + - ceph-mon + remote_user: root + roles: + - os-stor4nfv diff --git a/deploy/adapters/ansible/openstack_pike/README.md b/deploy/adapters/ansible/openstack_pike/README.md index 7682d325..8a5b5765 100644 --- a/deploy/adapters/ansible/openstack_pike/README.md +++ b/deploy/adapters/ansible/openstack_pike/README.md @@ -1 +1,10 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # keep for openstack pike diff --git a/deploy/adapters/ansible/openstack_queens/README.md b/deploy/adapters/ansible/openstack_queens/README.md new file mode 100644 index 00000000..bea43534 --- /dev/null +++ b/deploy/adapters/ansible/openstack_queens/README.md @@ -0,0 +1,10 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# keep for openstack queens diff --git a/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 b/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 index b23550f9..e7b79436 100644 --- a/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 +++ b/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 @@ -64,13 +64,13 @@ iface br-external inet static gateway {{ ip_settings[inventory_hostname]["external"]["gw"] }} offload-sg off # Create veth pair, don't bomb if already exists - pre-up ip link add br-vlan-veth type veth peer name eth12 || true + pre-up ip link add external-veth type veth peer name external-nic || true # Set both ends UP - pre-up ip link set br-vlan-veth up - pre-up ip link set eth12 up + pre-up ip link set external-veth up + pre-up ip link set external-nic up # Delete veth pair on DOWN - post-down ip link del br-vlan-veth || true - bridge_ports br-vlan-veth + post-down ip link del external-veth || true + bridge_ports external-veth # VXLAN (tunnel/overlay) bridge config auto br-tenant diff --git a/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 b/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 index 4e444eca..99d62876 100755 --- a/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 +++ b/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 @@ -62,6 +62,15 @@ iface br-external inet static address {{ ip_settings[inventory_hostname]["external"]["ip"] }} netmask 255.255.255.0 gateway {{ ip_settings[inventory_hostname]["external"]["gw"] }} + offload-sg off + # Create veth pair, don't bomb if already exists + pre-up ip link add external-veth type veth peer name external-nic || true + # Set both ends UP + pre-up ip link set external-veth up + pre-up ip link set external-nic up + # Delete veth pair on DOWN + post-down ip link del external-veth || true + bridge_ports external-veth # OpenStack Networking VXLAN (tunnel/overlay) bridge # @@ -71,11 +80,13 @@ iface br-external inet static # bridge. # auto br-tenant -iface br-tenant inet manual +iface br-tenant inet static bridge_stp off bridge_waitport 0 bridge_fd 0 bridge_ports {{ intf_tenant }} + address {{ ip_settings[inventory_hostname]["tenant"]["ip"] }} + netmask 255.255.255.0 # Storage bridge auto br-storage diff --git a/deploy/adapters/ansible/roles/config-osa/files/chrony.conf.j2 b/deploy/adapters/ansible/roles/config-osa/files/chrony.conf.j2 index 1c2443e0..d58f9115 100644 --- a/deploy/adapters/ansible/roles/config-osa/files/chrony.conf.j2 +++ b/deploy/adapters/ansible/roles/config-osa/files/chrony.conf.j2 @@ -98,7 +98,5 @@ rtconutc # Listen for NTP requests only on local interfaces. port 0 bindcmdaddress 127.0.0.1 -{% if not security_disable_ipv6 | bool %} bindcmdaddress ::1 {% endif %} -{% endif %} diff --git a/deploy/adapters/ansible/roles/config-osa/files/lxc_cache_prestage.patch b/deploy/adapters/ansible/roles/config-osa/files/lxc_cache_prestage.patch new file mode 100644 index 00000000..14f5f5f0 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/lxc_cache_prestage.patch @@ -0,0 +1,11 @@ +--- lxc_cache_prestage.yml 2018-07-24 07:56:22.480369360 +0000 ++++ /tmp/lxc_cache_prestage.yml 2018-07-24 08:17:44.665880308 +0000 +@@ -66,7 +66,7 @@ + --dir=/tmp + --out=rootfs.tar.xz + --check-certificate={{ (lxc_hosts_validate_certs | bool) | lower }} +- {% for server in lxc_image_cache_server_mirrors %}{{ server }}{{ lxc_images[0].split(';')[-1] }}rootfs.tar.xz {% endfor %} ++ http://192.168.137.222/download/rootfs.tar.xz + > /var/log/aria2c-image-prestage.log 2>&1 + args: + warn: no diff --git a/deploy/adapters/ansible/roles/config-osa/files/op-venv-script.sh b/deploy/adapters/ansible/roles/config-osa/files/op-venv-script.sh index fb197555..3fcab155 100644 --- a/deploy/adapters/ansible/roles/config-osa/files/op-venv-script.sh +++ b/deploy/adapters/ansible/roles/config-osa/files/op-venv-script.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #!/usr/local/env bash set -ev diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/fix_pip_version.yml b/deploy/adapters/ansible/roles/config-osa/tasks/fix_pip_version.yml index 61d263b4..6ec8425b 100644 --- a/deploy/adapters/ansible/roles/config-osa/tasks/fix_pip_version.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/fix_pip_version.yml @@ -18,8 +18,15 @@ regexp: '^ - python-ldap' line: ' - python-ldap==2.5.2' -- name: add pkgconfig in gnocchi requires pip packages +- name: add pbr in gnocchi requires pip packages lineinfile: dest: /etc/ansible/roles/repo_build/defaults/main.yml insertafter: "repo_pip_packages:" - line: ' - pkgconfig' + line: ' - pbr' + +- name: create user config file to control pip version + copy: + content: | + pip_packages: + - pip==9.0.1 + dest: /etc/openstack_deploy/user_fixpip.yml diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/fix_rescue.yml b/deploy/adapters/ansible/roles/config-osa/tasks/fix_rescue.yml index ff7d4250..c73aceb7 100644 --- a/deploy/adapters/ansible/roles/config-osa/tasks/fix_rescue.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/fix_rescue.yml @@ -28,7 +28,7 @@ - name: fix rescue problem for lxc-hosts-setup blockinfile: - dest: "/opt/openstack-ansible/playbooks/lxc-hosts-setup.yml" + dest: "/opt/openstack-ansible/playbooks/containers-lxc-host.yml" block: | - hosts: localhost user: root @@ -38,7 +38,7 @@ - name: delete max_fail_percentage for lxc-hosts-setup lineinfile: - dest: "/opt/openstack-ansible/playbooks/lxc-hosts-setup.yml" + dest: "/opt/openstack-ansible/playbooks/containers-lxc-host.yml" regexp: "max_fail_percentage*" state: absent diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml index 74d930e2..ab2714a9 100755 --- a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml @@ -163,7 +163,7 @@ - name: remove repo_build_pip_no_binary lineinfile: - dest: /opt/openstack-ansible/group_vars/repo_all.yml + dest: /opt/openstack-ansible/inventory/group_vars/repo_all.yml state: absent regexp: "{{ item }}" with_items: ['^repo_build_pip_no_binary:', '^ - libvirt-python'] @@ -348,21 +348,89 @@ # insertafter: "^- include: repo_post_build.yml" # line: "- include: repo_fix_pandas.yml" -- include: meters.yml +- include: fix_rescue.yml -# upstream has fix this issue so somments it -# maybe will use in the furture -- include: fix_pip_version.yml +- name: rm command "rm -f /etc/resolv.conf" in cache_prep_commands + lineinfile: + dest: /etc/ansible/roles/lxc_hosts/vars/ubuntu-16.04.yml + regexp: 'rm -f /etc/resolv.conf$' + line: ' echo "ok"' + backrefs: 'yes' -- include: fix_rescue.yml +- name: add command "rm /etc/resolv.conf || true" in cache_prep_commands + lineinfile: + dest: /etc/ansible/roles/lxc_hosts/vars/ubuntu-16.04.yml + insertafter: '^ cache_prep_commands:' + line: ' rm /etc/resolv.conf || true' -- name: include tacker in setup-openstack +- name: fix apt prompt issue lineinfile: - dest: /opt/openstack-ansible/playbooks/setup-openstack.yml - insertafter: "^- include: os-trove" - line: "- include: os-tacker-install.yml" + dest: /etc/ansible/roles/lxc_hosts/vars/ubuntu-16.04.yml + state: absent + regexp: "apt-get upgrade -y" -- name: add variables file of tacker for centos +- name: set pre-staged retry to 120 + replace: + dest: /etc/ansible/roles/lxc_hosts/tasks/lxc_cache_preparation_systemd_new.yml + regexp: '^ retries: 60' + replace: ' retries: 120' + +- name: copy lxc_cache_prestage.patch copy: - src: redhat-7.yml - dest: /etc/ansible/roles/os_tacker/vars/redhat-7.yml + src: lxc_cache_prestage.patch + dest: /etc/ansible/roles/lxc_hosts/tasks/lxc_cache_prestage.patch + when: + - checkresult.rc == 0 + - offline_deployment is defined and offline_deployment == "Disable" + +- name: patch lxc_cache_prestage.yml + shell: + patch -p0 < lxc_cache_prestage.patch + args: + chdir: /etc/ansible/roles/lxc_hosts/tasks/ + when: + - checkresult.rc == 0 + - offline_deployment is defined and offline_deployment == "Disable" + ignore_errors: "true" + +- name: add cache refresh + blockinfile: + dest: /opt/openstack-ansible/playbooks/setup-infrastructure.yml + insertbefore: '^- include: unbound-install.yml' + block: | + - hosts: all + user: root + tasks: + - name: refresh + setup: + +- name: create openstack git directory + file: + path: /opt/git/openstack + state: directory + when: + - checkresult.rc == 0 + - offline_deployment is defined and offline_deployment == "Disable" + +- name: download openstack git package + get_url: + url: "http://192.168.137.222/download/openstack-queens-git.tar.gz" + dest: "/opt/git/openstack" + when: + - checkresult.rc == 0 + - offline_deployment is defined and offline_deployment == "Disable" + +- name: extract openstack git repo + shell: + tar zxf openstack-queens-git.tar.gz + args: + chdir: "/opt/git/openstack" + when: + - checkresult.rc == 0 + - offline_deployment is defined and offline_deployment == "Disable" + +- name: fix keepalived + lineinfile: + dest: /opt/openstack-ansible/inventory/group_vars/haproxy/keepalived.yml + regexp: 'check_script: "/bin/kill -0 `cat /var/run/haproxy.pid`"' + line: ' check_script: "/bin/kill -0 `cat /var/run/haproxy.pid` || true"' diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml b/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml index 2b3bce5f..ca85f440 100644 --- a/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml @@ -9,7 +9,7 @@ --- - name: modify the aodh haproxy config copy: - dest: /opt/openstack-ansible/group_vars/all/haproxy.yml + dest: /opt/openstack-ansible/inventory/group_vars/all/haproxy.yml src: haproxy.yml mode: 0664 diff --git a/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 index 4f1ea8d5..dd45bd1a 100644 --- a/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 +++ b/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 @@ -26,11 +26,16 @@ haproxy_keepalived_internal_vip_cidr: "{{ internal_vip.ip }}/32" haproxy_keepalived_external_interface: br-external haproxy_keepalived_internal_interface: br-mgmt keepalived_ping_address: "{{ ntp_server }}" +lxc_host_machine_volume_size: 16 cinder_cinder_conf_overrides: oslo_middleware: enable_proxy_headers_parsing: True +neutron_neutron_conf_overrides: + oslo_middleware: + enable_proxy_headers_parsing: True + nfs_file_gw: False {% if "openvswitch" == NEUTRON_MECHANISM_DRIVERS[0] or @@ -73,3 +78,4 @@ security_ntp_servers: - {{ ntp_server }} tacker_etc_dir: "/etc/tacker" +nova_spicehtml5_git_repo: https://gitlab.freedesktop.org/spice/spice-html5.git diff --git a/deploy/adapters/ansible/roles/config-osa/vars/main.yml b/deploy/adapters/ansible/roles/config-osa/vars/main.yml index 65f67c18..7daf40c9 100644 --- a/deploy/adapters/ansible/roles/config-osa/vars/main.yml +++ b/deploy/adapters/ansible/roles/config-osa/vars/main.yml @@ -12,5 +12,5 @@ ceph_host: "{{ hostvars[inventory_hostname]['groups']['ceph_osd'][0] }}" repo_dest_path: "/var/www/repo/os-releases/15.1.4/ubuntu-16.04-x86_64/" networking_sfc_version: 4.0.0 # yamllint disable rule:line-length -openstack_release: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}" +openstack_release: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" # yamllint enable rule:line-length diff --git a/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch b/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch new file mode 100644 index 00000000..198ff5be --- /dev/null +++ b/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch @@ -0,0 +1,12 @@ +--- manager.py 2018-11-07 03:51:22.764685289 -0800 ++++ manager.py.new 2018-11-07 03:58:21.014139558 -0800 +@@ -314,8 +314,7 @@ + if self._events is None: + # NOTE(danms): We really should have a more specific error + # here, but this is what we use for our default error case +- raise exception.NovaException('In shutdown, no new events ' +- 'can be scheduled') ++ self._events = {} + + @utils.synchronized(self._lock_name(instance)) + def _create_or_get_event(): diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml index 0bd9aeff..2a63acf0 100644 --- a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml +++ b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml @@ -86,3 +86,7 @@ state: restarted when: - inventory_hostname in groups['horizon'] + +- include: nova_patch.yml + when: + - inventory_hostname in groups['compute'] diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml new file mode 100644 index 00000000..d9cfad9c --- /dev/null +++ b/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright (c) 2016-2018 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +- name: copy manager.py.patch + copy: + src: manager.py.patch + dest: /openstack/venvs/nova-{{ openstack_release }}/lib/python2.7/site-packages/nova/compute + +- name: patch manager.py.patch + shell: + patch -p0 < manager.py.patch + args: + chdir: /openstack/venvs/nova-{{ openstack_release }}/lib/python2.7/site-packages/nova/compute + +- name: restart nova-compute + shell: + systemctl restart nova-compute diff --git a/deploy/adapters/ansible/roles/post-openstack/vars/main.yml b/deploy/adapters/ansible/roles/post-openstack/vars/main.yml index ed64c8db..1fc2cc27 100644 --- a/deploy/adapters/ansible/roles/post-openstack/vars/main.yml +++ b/deploy/adapters/ansible/roles/post-openstack/vars/main.yml @@ -45,5 +45,5 @@ flavors: disk: 160 # yamllint disable rule:line-length -openstack_release: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}" +openstack_release: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" # yamllint enable rule:line-length diff --git a/deploy/adapters/ansible/roles/post-osa/files/sfc.conf b/deploy/adapters/ansible/roles/post-osa/files/sfc.conf index ce42c9e1..b200f254 100755 --- a/deploy/adapters/ansible/roles/post-osa/files/sfc.conf +++ b/deploy/adapters/ansible/roles/post-osa/files/sfc.conf @@ -1,6 +1,6 @@ [DEFAULT] -service_plugins = router,metering,flow_classifier,sfc +service_plugins = router,metering,flow_classifier,sfc,trunk [sfc] drivers = ovs diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml index d5a04e78..684d05cb 100644 --- a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml +++ b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml @@ -2,7 +2,7 @@ - name: install networking-sfc pip: - name: networking-sfc + name: networking-sfc==6.0.0.0rc1 virtualenv: /openstack/venvs/neutron-{{ os_ver }} when: - inventory_hostname in groups['neutron_server'] diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml index fed3842f..e7e4c37d 100644 --- a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml @@ -11,6 +11,7 @@ when: - inventory_hostname in groups['compute'] - ansible_distribution == 'Ubuntu' + - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" # install networking-sfc for non odl scenarios - include: install_networking_sfc.yml @@ -29,3 +30,6 @@ - include: tacker_horizon.yml when: inventory_hostname in groups['horizon_all'] + +- include: novaclient_workaround.yml + when: inventory_hostname in groups['utility'] diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/novaclient_workaround.yml b/deploy/adapters/ansible/roles/post-osa/tasks/novaclient_workaround.yml new file mode 100644 index 00000000..40ec608d --- /dev/null +++ b/deploy/adapters/ansible/roles/post-osa/tasks/novaclient_workaround.yml @@ -0,0 +1,6 @@ +--- + +- name: use python-novaclient version 9.0.0 to replace 10.2.0 + pip: + name: python-novaclient + version: 9.0.0 diff --git a/deploy/adapters/ansible/roles/post-osa/vars/main.yml b/deploy/adapters/ansible/roles/post-osa/vars/main.yml index f5ffa335..7aed0472 100644 --- a/deploy/adapters/ansible/roles/post-osa/vars/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/vars/main.yml @@ -1,9 +1,9 @@ --- # yamllint disable rule:line-length -os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}" +os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" # yamllint enable rule:line-length -os_name: pike +os_name: queens # yamllint disable rule:line-length tacker_horizon_repo: https://github.com/openstack/tacker-horizon.git diff --git a/deploy/adapters/ansible/roles/setup-host/tasks/Ubuntu.yml b/deploy/adapters/ansible/roles/setup-host/tasks/Ubuntu.yml index 00675d9c..5d9cded0 100644 --- a/deploy/adapters/ansible/roles/setup-host/tasks/Ubuntu.yml +++ b/deploy/adapters/ansible/roles/setup-host/tasks/Ubuntu.yml @@ -8,7 +8,7 @@ # ############################################################################# --- - name: setup hosts - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_queens-opnfv2/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible setup-hosts.yml \ @@ -19,7 +19,7 @@ register: failed_container - name: destroy the failed_container - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_queens-opnfv2/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible lxc-containers-destroy.yml \ @@ -30,7 +30,7 @@ ignore_errors: "True" - name: retry to setup failed_container - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_queens-opnfv2/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible setup-hosts.yml --limit {{item}} \ diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/handlers/main.yml b/deploy/adapters/ansible/roles/setup-openvswitch/handlers/main.yml index fb7814b7..58a1710c 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/handlers/main.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/handlers/main.yml @@ -6,6 +6,11 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################ --- +- name: restart network service + service: + name: networking + state: restarted + - name: restart neutron-openvswitch-agent service: name: neutron-openvswitch-agent diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/compute.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/compute.yml index 43c6689f..670eea75 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/compute.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/compute.yml @@ -50,7 +50,7 @@ when: - compute in item["role"] -- name: start neutron-openvswitch-agent +- name: restart neutron-openvswitch-agent service: name: neutron-openvswitch-agent - state: started + state: restarted diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml index 3637d1db..726cb545 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml @@ -50,7 +50,27 @@ when: - controller in item["role"] +- name: configure interfaces ubuntu + template: + src: controller.j2 + dest: /etc/network/interfaces + notify: + - restart network service + - name: start neutron-openvswitch-agent service: name: neutron-openvswitch-agent - state: started + state: restarted + +- name: update keepalived + replace: + dest: /etc/keepalived/keepalived.conf + regexp: 'br-external' + replace: 'br-provider' + +- meta: flush_handlers + +- name: restart keepalived + service: + name: keepalived + state: restarted diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml index 87e508ca..0ad47d3c 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml @@ -10,9 +10,19 @@ - include: controller.yml when: - inventory_hostname not in groups['nova_compute'] - - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or "opendaylight" + - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" - include: compute.yml when: - inventory_hostname in groups['nova_compute'] - - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or "opendaylight" + - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" + +- include_vars: "{{ ansible_os_family }}.yml" + when: + - odl_sfc is not defined or odl_sfc != "Enable" + - NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight" + +- include: odl.yml + when: + - odl_sfc is not defined or odl_sfc != "Enable" + - NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight" diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml new file mode 100644 index 00000000..9c96a46a --- /dev/null +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml @@ -0,0 +1,25 @@ +############################################################################# +# Copyright (c) 2017-2018 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################# +--- +- name: uninstall ovs for odl + apt: + name: "{{ item.name }}" + state: absent + with_items: "{{ ovs_pkgs }}" + +- name: download ovs pkgs + get_url: + url: "{{ item.url }}" + dest: "/tmp/{{ item.package }}" + with_items: "{{ ovs_pkgs }}" + +- name: install ovs pkgs + shell: + dpkg -i "/tmp/{{ item.package }}" + with_items: "{{ ovs_pkgs }}" diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/templates/controller.j2 b/deploy/adapters/ansible/roles/setup-openvswitch/templates/controller.j2 new file mode 100755 index 00000000..bdc4d447 --- /dev/null +++ b/deploy/adapters/ansible/roles/setup-openvswitch/templates/controller.j2 @@ -0,0 +1,90 @@ +# This file describes the network interfaces available on your system +# and how to activate them. For more information, see interfaces(5). + +# The loopback network interface +auto lo +iface lo inet loopback + +# Physical interface +auto eth0 +iface eth0 inet manual + +# external interface +{% set intf_external = contr_sys_mappings["external"]["interface"] %} +{% if contr_sys_mappings["external"]["vlan_tag"] | int %} +{% set intf_external = intf_external + '.' + contr_sys_mappings["external"]["vlan_tag"]|string %} +{% endif %} +auto {{ intf_external }} +iface {{ intf_external }} inet manual +{% if contr_sys_mappings["external"]["vlan_tag"] | int %} + vlan-raw-device {{ intf_external }} +{% endif %} + +# tenant interface +{% set intf_tenant = contr_sys_mappings["tenant"]["interface"] %} +{% if contr_sys_mappings["tenant"]["vlan_tag"] | int %} +{% set intf_tenant = intf_tenant + '.' + contr_sys_mappings["tenant"]["vlan_tag"]|string %} +{% endif %} +auto {{ intf_tenant }} +iface {{ intf_tenant }} inet manual +{% if contr_sys_mappings["tenant"]["vlan_tag"] | int %} + vlan-raw-device {{ intf_tenant }} +{% endif %} + +# storage interface +{% set intf_storage = contr_sys_mappings["storage"]["interface"] %} +{% if contr_sys_mappings["storage"]["vlan_tag"] | int %} +{% set intf_storage = intf_storage + '.' + contr_sys_mappings["storage"]["vlan_tag"]|string %} +{% endif %} +auto {{ intf_storage }} +iface {{ intf_storage }} inet manual +{% if contr_sys_mappings["storage"]["vlan_tag"] | int %} + vlan-raw-device {{ intf_storage }} +{% endif %} + +# Container/Host management bridge +auto br-mgmt +iface br-mgmt inet static + bridge_stp off + bridge_waitport 0 + bridge_fd 0 + bridge_ports eth0 + address {{ ip_settings[inventory_hostname]["mgmt"]["ip"] }} + netmask 255.255.255.0 + +# OpenStack Networking VLAN bridge +auto br-provider +iface br-provider inet static + address {{ ip_settings[inventory_hostname]["external"]["ip"] }} + netmask 255.255.255.0 + gateway {{ ip_settings[inventory_hostname]["external"]["gw"] }} + pre-up ifconfig br-external down || true + pre-up brctl delbr br-external || true + +# OpenStack Networking VXLAN (tunnel/overlay) bridge +# +# Only the COMPUTE and NETWORK nodes must have an IP address +# on this bridge. When used by infrastructure nodes, the +# IP addresses are assigned to containers which use this +# bridge. +# +auto br-tenant +iface br-tenant inet static + bridge_stp off + bridge_waitport 0 + bridge_fd 0 + bridge_ports {{ intf_tenant }} + address {{ ip_settings[inventory_hostname]["tenant"]["ip"] }} + netmask 255.255.255.0 + +# Storage bridge +auto br-storage +iface br-storage inet static + bridge_stp off + bridge_waitport 0 + bridge_fd 0 + bridge_ports {{ intf_storage }} + address {{ ip_settings[inventory_hostname]["storage"]["ip"] }} + netmask 255.255.255.0 + +source /etc/network/interfaces.d/*.cfg diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml b/deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml index b6bd95a8..72c410ca 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml @@ -1,3 +1,16 @@ --- ovs_service: openvswitch-switch + +# yamllint disable rule:line-length +ovs_pkgs: + - openvswitch-common: + name: openvswitch-common + package: openvswitch-common.deb + url: http://archive.ubuntu.com/ubuntu/pool/main/o/openvswitch/openvswitch-common_2.8.0-0ubuntu2_amd64.deb + + - openvswitch-switch: + name: openvswitch-switch + package: openvswitch-switch.deb + url: http://archive.ubuntu.com/ubuntu/pool/main/o/openvswitch/openvswitch-switch_2.8.0-0ubuntu2_amd64.deb +# yamllint enable rule:line-length diff --git a/deploy/adapters/cobbler/kickstarts/default16-aarch64.seed b/deploy/adapters/cobbler/kickstarts/default16-aarch64.seed new file mode 100644 index 00000000..e3e11f36 --- /dev/null +++ b/deploy/adapters/cobbler/kickstarts/default16-aarch64.seed @@ -0,0 +1,177 @@ +# Mostly based on the Ubuntu installation guide +# https://help.ubuntu.com/12.04/installation-guide/ + +## Figure out if we're kickstarting a system or a profile +#if $getVar('system_name','') != '' +#set $what = "system" +#else +#set $what = "profile" +#end if + +# Preseeding only locale sets language, country and locale. +d-i debian-installer/locale string en_US +d-i debian-installer/country string US +d-i debian-installer/language string en + +d-i debian-installer/splash boolean false +d-i debian-installer/quiet boolean false +d-i debian-installer/framebuffer boolean true +d-i hw-detect/load_firmware boolean true + +# Keyboard selection. +# Disable automatic (interactive) keymap detection. +d-i console-setup/ask_detect boolean false +d-i console-setup/layoutcode string us +d-i console-setup/modelcode string SKIP +d-i keyboard-configuration/variantcode string us +d-i keyboard-configuration/layoutcode string us +d-i keyboard-configuration/model select Generic 105-key (Intl) PC +d-i console-keymaps-at/keymap select us +d-i keyboard-configuration/xkb-keymap select us + +d-i preseed/early_command string \ +wget -O- \ +http://$http_server/cblr/svc/op/script/$what/$name/?script=preseed_early_default | /bin/sh -s; \ +debconf-set-selections /tmp/pre_install_network_config + +$SNIPPET('preseed_network_config') + +# Partition disk manually +d-i partman-auto/disk string /dev/sda +d-i partman-auto/method string regular +d-i partman-lvm/device_remove_lvm boolean true +d-i partman-md/device_remove_md boolean true +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + +d-i partman-auto/choose_recipe select efi-root +d-i partman-auto/expert_recipe string \ + efi-root :: \ + 512 512 512 fat32 \ + $primary{ } $lvmignore{ } \ + method{ efi } format{ } \ + . \ + 4096 4096 -1 ext4 \ + method{ format } format{ } \ + use_filesystem{ } filesystem{ ext4 } \ + mountpoint{ / } \ + . + +d-i partman-basicfilesystems/no_swap boolean false + +d-i partman/confirm_write_new_label boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + +# NTP/Time Setup +#if $getVar('timezone', '') != "" +d-i time/zone string $timezone +#else +d-i time/zone string US/Pacific +#end if +d-i clock-setup/utc boolean true +d-i clock-setup/ntp boolean true +#if $getVar('ntp_server', '') == "" +d-i clock-setup/ntp-server string 0.ubuntu.pool.ntp.org +#else +d-i clock-setup/ntp-server string $ntp_server +#end if + +# Setup the installation source +d-i mirror/country string manual +d-i mirror/http/hostname string $http_server +d-i mirror/http/directory string $install_source_directory +d-i mirror/http/proxy string +d-i mirror/http/mirror select $http_server +d-i mirror/protocol select http +d-i mirror/udeb/components multiselect main, restricted + +#set $os_v = $getVar('os_version','') +#if $os_v and $os_v.lower()[0] > 'p' +# Required at least for 12.10+ +d-i live-installer/net-image string http://$http_server/cobbler/ks_mirror/$distro_name/install/filesystem.squashfs +#end if + +# root account and password +#if $getVar('username', 'root') != "root" +d-i passwd/root-login boolean false +d-i passwd/make-user boolean true +d-i user-setup/allow-password-weak boolean true +d-i passwd/root-password password root +d-i passwd/root-password-again password root + #set username = $getVar('username', 'root') +d-i passwd/user-fullname string $username +d-i passwd/username string $username + #if $getVar('password', '') != "" +d-i passwd/user-password-crypted password $password + #else +d-i passwd/user-password password $username +d-i passwd/user-password-again password $username + #end if +#else +d-i passwd/root-login boolean true +d-i passwd/make-user boolean false +d-i user-setup/allow-password-weak boolean true + #if $getVar('password', '') != "" +d-i passwd/root-password-crypted password $password + #else +d-i passwd/root-password password root +d-i passwd/root-password-again password root + #end if +#end if + +$SNIPPET('preseed_apt_repo_config') + +# Individual additional packages to install +# wget is REQUIRED otherwise quite a few things won't work +# later in the build (like late-command scripts) +#if $getVar('tool', '') != '' + #set $preseed_software = "preseed_software_%s" % $tool +$SNIPPET($preseed_software) +#else +d-i pkgsel/include string ntp ssh openssh-server wget vim bridge-utils ifenslave vlan +#end if + +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none +d-i popularity-contest/participate boolean false +d-i lilo-installer/skip boolean true +d-i grub-installer/only_debian boolean true + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +d-i debian-installer/add-kernel-opts string $kernel_options_post +d-i debian-installer/allow_unauthenticated string true + +d-i finish-install/late_command string update-grub +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +d-i cdrom-detect/eject boolean false + +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +# d-i preseed/late_command string [command] +d-i preseed/late_command string \ +in-target sed -i '$a UseDNS no' /etc/ssh/sshd_config; \ +in-target sed -i 's/.*GSSAPIAuthentication.*/GSSAPIAuthentication no/g' /etc/ssh/sshd_config; \ +in-target sed -i '$d' /usr/share/initramfs-tools/scripts/local-top/lvm2; \ +in-target echo "lvm vgchange -ay" >> /usr/share/initramfs-tools/scripts/local-top/lvm2; \ +in-target echo "exit 0" >> /usr/share/initramfs-tools/scripts/local-top/lvm2; \ +in-target touch /etc/initramfs-tools/scripts/local-top/lvm2; \ +in-target chmod 777 /etc/initramfs-tools/scripts/local-top/lvm2; \ +in-target echo "vgchange -a y" >> /etc/initramfs-tools/scripts/local-top/lvm2; \ +wget -O- \ + http://$http_server/cblr/svc/op/script/$what/$name/?script=preseed_late_default | \ + chroot /target /bin/sh -s; cp /target/etc/network/interfaces /etc/network/interfaces; \ +in-target update-initramfs -k `uname -r` -c; \ +in-target update-grub; \ +in-target apt-get install python2.7; \ +in-target ln -s /usr/bin/python2.7 /usr/bin/python diff --git a/deploy/adapters/cobbler/snippets/kickstart_client.rb b/deploy/adapters/cobbler/snippets/kickstart_client.rb index 568ba46a..a890272a 100644 --- a/deploy/adapters/cobbler/snippets/kickstart_client.rb +++ b/deploy/adapters/cobbler/snippets/kickstart_client.rb @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + mkdir -p /etc/chef cat << EOL > /etc/chef/client.rb log_level :info diff --git a/deploy/adapters/cobbler/snippets/kickstart_knife.rb b/deploy/adapters/cobbler/snippets/kickstart_knife.rb index e4ab081b..aca3d5c0 100644 --- a/deploy/adapters/cobbler/snippets/kickstart_knife.rb +++ b/deploy/adapters/cobbler/snippets/kickstart_knife.rb @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + mkdir -p /root/.chef cat << EOL > /root/.chef/knife.rb log_level :info diff --git a/deploy/adapters/cobbler/snippets/preseed_knife.rb b/deploy/adapters/cobbler/snippets/preseed_knife.rb index 32047bbc..fa9a808d 100644 --- a/deploy/adapters/cobbler/snippets/preseed_knife.rb +++ b/deploy/adapters/cobbler/snippets/preseed_knife.rb @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + mkdir -p /root/.chef cat << EOL > /root/.chef/knife.rb log_level :info diff --git a/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config b/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config index 6ea56c56..591313b5 100644 --- a/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config +++ b/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config @@ -29,6 +29,8 @@ $SNIPPET($repos_snippet) #if $arch == "x86_64" #set $rarch = "[arch=amd64]" +#elif $arch == "arm" + #set $rarch = "[arch=arm64]" #else #set $rarch = "[arch=%s]" % $arch #end if diff --git a/deploy/ansible_plugins/lookup/yamlfile.py b/deploy/ansible_plugins/lookup/yamlfile.py index c915adc7..489dccce 100644 --- a/deploy/ansible_plugins/lookup/yamlfile.py +++ b/deploy/ansible_plugins/lookup/yamlfile.py @@ -1,4 +1,13 @@ #!/bin/venv python +############################################################################## +# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import yaml import sys diff --git a/deploy/bonding.py b/deploy/bonding.py index 17b5b205..9116c53b 100644 --- a/deploy/bonding.py +++ b/deploy/bonding.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import os import sys import yaml diff --git a/deploy/client.py b/deploy/client.py index 891e632c..3a9b0dec 100644 --- a/deploy/client.py +++ b/deploy/client.py @@ -79,8 +79,8 @@ opts = [ cfg.BoolOpt('poll_switches', help='if the client polls switches', default=True), - cfg.StrOpt('machines', - help='comma separated mac addresses of machines', + cfg.StrOpt('machine_file', + help='mac addresses and ipmi info of machines', default=''), cfg.StrOpt('subnets', help='comma seperated subnets', @@ -259,6 +259,9 @@ opts = [ cfg.StrOpt('plugins', help='plugin dict', default='{}'), + cfg.StrOpt('cluster_param', + help='cluster dict', + default='{}'), cfg.StrOpt('offline_deployment', help='offline_deployment', default='Disable'), @@ -324,12 +327,12 @@ class CompassClient(object): 'get all machines status: %s, resp: %s', status, resp) raise RuntimeError('failed to get machines') - machines_to_add = list(set([ - machine for machine in CONF.machines.split(',') - if machine - ])) + with open(CONF.machine_file) as fd: + machines_to_add = [str(m["mac"]) for m in yaml.load(fd)] + resp = byteify(resp) machines_db = [str(m["mac"]) for m in resp] + LOG.info( 'machines in db: %s\n to add: %s', machines_db, @@ -803,11 +806,17 @@ class CompassClient(object): package_config['odl_l3_agent'] = "Enable" if CONF.odl_l3_agent == "Enable" else "Disable" # noqa package_config['onos_sfc'] = "Enable" if CONF.onos_sfc == "Enable" else "Disable" # noqa package_config['plugins'] = [] + package_config['cluster_param'] = [] if CONF.plugins: for item in CONF.plugins.split(','): key, value = item.split(':') package_config['plugins'].append({key: value}) + if CONF.cluster_param: + for item in CONF.cluster_param.split(','): + key, value = item.split(':') + package_config['cluster_param'].append({key: value}) + status, resp = self.client.update_cluster_config( cluster_id, package_config=package_config) LOG.info( @@ -974,8 +983,6 @@ class CompassClient(object): ansible_log = "%s/work/deploy/docker/ansible/run/%s-%s/ansible.log" \ % (compass_dir, CONF.adapter_name, CONF.cluster_name) os.system("sudo touch %s" % ansible_log) - os.system("sudo chmod +x -R %s/work/deploy/docker/ansible/run/" - % compass_dir) ansible_print = multiprocessing.Process(target=print_log, args=(ansible_log,)) ansible_print.start() diff --git a/deploy/compass_conf/adapter/ansible_kubernetes.conf b/deploy/compass_conf/adapter/ansible_kubernetes.conf index 70e5564c..e2af8aff 100644 --- a/deploy/compass_conf/adapter/ansible_kubernetes.conf +++ b/deploy/compass_conf/adapter/ansible_kubernetes.conf @@ -3,5 +3,5 @@ DISPLAY_NAME = 'Kubernetes' PARENT = 'general' PACKAGE_INSTALLER = 'ansible_installer_kubernetes' OS_INSTALLER = 'cobbler' -SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04\.3', '(?i)CentOS-7.*17.*', '(?i)CentOS-7.*arm.*'] +SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04\.3', '(?i)CentOS-7.*17.*', '(?i)CentOS-7.*arm.*', '(?i)ubuntu-16.*arm.*'] DEPLOYABLE = True diff --git a/deploy/compass_conf/adapter/ansible_openstack_queens.conf b/deploy/compass_conf/adapter/ansible_openstack_queens.conf new file mode 100755 index 00000000..d8ac426f --- /dev/null +++ b/deploy/compass_conf/adapter/ansible_openstack_queens.conf @@ -0,0 +1,7 @@ +NAME = 'openstack_queens' +DISPLAY_NAME = 'Openstack Queens' +PARENT = 'openstack' +PACKAGE_INSTALLER = 'ansible_installer_queens' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04\.3', '(?i)CentOS-7.*17.*'] +DEPLOYABLE = True diff --git a/deploy/compass_conf/flavor/kubernetes.conf b/deploy/compass_conf/flavor/kubernetes.conf index e7e8ffc8..2e808a83 100755 --- a/deploy/compass_conf/flavor/kubernetes.conf +++ b/deploy/compass_conf/flavor/kubernetes.conf @@ -4,8 +4,6 @@ FLAVORS = [{ 'display_name': 'ansible-kubernetes', 'template': 'ansible-kubernetes.tmpl', 'roles': [ - 'kube_master', 'etcd', 'kube_node', 'ha', 'storage_master', 'storage_node' + 'kube_master', 'etcd', 'kube_node', 'ha', 'storage_master', 'storage_node', 'opencontrail' ], }] - - diff --git a/deploy/compass_conf/flavor/openstack_queens.conf b/deploy/compass_conf/flavor/openstack_queens.conf new file mode 100755 index 00000000..3f2294d4 --- /dev/null +++ b/deploy/compass_conf/flavor/openstack_queens.conf @@ -0,0 +1,32 @@ +ADAPTER_NAME = 'openstack_queens' +FLAVORS = [{ + 'flavor': 'allinone', + 'display_name': 'All-In-One', + 'template': 'allinone.tmpl', + 'roles': ['allinone-compute'], +}, { + 'flavor': 'single-controller', + 'display_name': 'Single Controller', + 'template': 'single-controller.tmpl', + 'roles': [ + 'controller', 'compute', 'network', 'storage', 'odl', 'onos' + ], +}, { + 'flavor': 'multinodes', + 'display_name': 'Multi-nodes', + 'template': 'multinodes.tmpl', + 'roles': [ + 'compute-controller', 'compute-worker', 'network-server', + 'network-worker', 'database', 'messaging', 'image', 'odl', + 'dashboard', 'identity', 'storage-controller', 'storage-volume' + ], +}, { + 'flavor': 'HA-ansible-multinodes-queens', + 'display_name': 'HA-ansible-multinodes-queens', + 'template': 'HA-ansible-multinodes.tmpl', + 'roles': [ + 'controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph', 'ceph-adm', 'ceph-mon', 'ceph-osd', 'ceph-osd-node', 'moon' + ], +}] + + diff --git a/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-queens.conf b/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-queens.conf new file mode 100755 index 00000000..d287bf58 --- /dev/null +++ b/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-queens.conf @@ -0,0 +1,124 @@ +ADAPTER = 'openstack_queens' +FLAVOR = 'HA-ansible-multinodes-queens' +CONFIG_MAPPING = { + "mapped_name": "flavor_config", + "mapped_children": [{ + "security": { + "accordion_heading": "OpenStack Database and Queue Credentials", + "category": "service_credentials", + "data_structure": "table", + "action": "true", + "modifiable_data": ["username", "password"], + "table_display_header": ["Service", "UserName", "Password", "Action"], + "config": { + "rabbitmq": { + "username": "guest", + "password": "" + }, + "compute": { + "username": "nova", + "password": "" + }, + "dashboard": { + "username": "dashboard", + "password": "" + }, + "identity": { + "username": "keystone", + "password": "" + }, + "image": { + "username": "glance", + "password": "" + }, + "metering": { + "username": "ceilometer", + "password": "" + }, + "alarming": { + "username": "aodh", + "password": "" + }, + "network": { + "username": "neutron", + "password": "" + }, + "mysql": { + "username": "root", + "password": "" + }, + "volume": { + "username": "cinder", + "password": "" + }, + "heat": { + "username": "heat", + "password": "" + }, + "policy": { + "username": "congress", + "password": "" + } + } + } + },{ + "security": { + "accordion_heading": "OpenStack Keystone User Credentials", + "category": "console_credentials", + "data_structure": "table", + "action": "true", + "modifiable_data": ["username", "password"], + "table_display_header": ["Service", "UserName", "Password", "Action"], + "config":{ + "admin": { + "username": "admin", + "password": "" + }, + "demo": { + "username": "demo", + "password": "" + }, + "compute": { + "username": "nova", + "password": "" + }, + "dashboard": { + "username": "dashboard", + "password": "" + }, + "identity": { + "username": "keystone", + "password": "" + }, + "image": { + "username": "glance", + "password": "" + }, + "metering": { + "username": "ceilometer", + "password": "" + }, + "alarming": { + "username": "aodh", + "password": "" + }, + "network": { + "username": "quantum", + "password": "" + }, + "object-store": { + "username": "swift", + "password": "" + }, + "heat": { + "username": "heat", + "password": "" + }, + "volume": { + "username": "cinder", + "password": "" + } + } + } + }] +} diff --git a/deploy/compass_conf/flavor_metadata/HA-ansible-multinodes-queens.conf b/deploy/compass_conf/flavor_metadata/HA-ansible-multinodes-queens.conf new file mode 100755 index 00000000..e38292b4 --- /dev/null +++ b/deploy/compass_conf/flavor_metadata/HA-ansible-multinodes-queens.conf @@ -0,0 +1,19 @@ +ADAPTER = 'openstack_queens' +FLAVOR = 'HA-ansible-multinodes-queens' +METADATA = { + 'ha_proxy': { + '_self': { + }, + 'vip': { + '_self': { + 'is_required': True, + 'field': 'general', + 'mapping_to': 'ha_vip' + } + }, + 'test': { + '_self': { + }, + } + } +} diff --git a/deploy/compass_conf/os/centos7.3.aarch64.conf b/deploy/compass_conf/os/centos7.3.aarch64.conf index bd3bce30..e6c9f710 100755 --- a/deploy/compass_conf/os/centos7.3.aarch64.conf +++ b/deploy/compass_conf/os/centos7.3.aarch64.conf @@ -1,3 +1,3 @@ -NAME = 'CentOS-7-Minimal-1611-arm-arm' +NAME = 'CentOS-7-Minimal-1708-arm-arm' PARENT = 'CentOS' DEPLOYABLE = True diff --git a/deploy/compass_conf/package_installer/ansible-queens.conf b/deploy/compass_conf/package_installer/ansible-queens.conf new file mode 100755 index 00000000..191e21d9 --- /dev/null +++ b/deploy/compass_conf/package_installer/ansible-queens.conf @@ -0,0 +1,15 @@ +NAME = 'ansible_installer' +INSTANCE_NAME = 'ansible_installer_queens' +SETTINGS = { + 'ansible_dir': '/var/ansible', + 'ansible_run_dir': '/var/ansible/run', + 'ansible_config': 'ansible.cfg', + 'playbook_file': 'site.yml', + 'inventory_file': 'inventory.py', + 'inventory_json_file': 'inventory.json', + 'inventory_group': ['controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph_adm', 'ceph_mon', 'ceph_osd', 'moon'], + 'group_variable': 'all', + 'etc_hosts_path': 'roles/pre-openstack/templates/hosts', + 'runner_dirs': ['roles','openstack_queens/templates','openstack_queens/roles'] +} + diff --git a/deploy/compass_conf/package_metadata/kubernetes.conf b/deploy/compass_conf/package_metadata/kubernetes.conf index d5e9a50f..c9853d17 100755 --- a/deploy/compass_conf/package_metadata/kubernetes.conf +++ b/deploy/compass_conf/package_metadata/kubernetes.conf @@ -129,6 +129,14 @@ METADATA = { 'default_value': '[]' } }, + 'cluster_param': { + '_self': { + 'mapping_to': 'cluster_param', + 'field': 'general_list', + 'is_required':False, + 'default_value': '[]' + } + }, 'ha_network': { '_self': { 'mapping_to': 'ha_network', diff --git a/deploy/compass_conf/package_metadata/openstack.conf b/deploy/compass_conf/package_metadata/openstack.conf index 6027cb1a..f0e41217 100755 --- a/deploy/compass_conf/package_metadata/openstack.conf +++ b/deploy/compass_conf/package_metadata/openstack.conf @@ -129,6 +129,14 @@ METADATA = { 'default_value': '[]' } }, + 'cluster_param': { + '_self': { + 'mapping_to': 'cluster_param', + 'field': 'general_list', + 'is_required':False, + 'default_value': '[]' + } + }, 'ha_network': { '_self': { 'mapping_to': 'ha_network', @@ -271,13 +279,11 @@ METADATA = { 'tenant_net_info': { '_self': { 'mapping_to': 'tenant_net_info', - 'is_required': True }, 'type': { '_self': { 'mapping_to': 'type', - 'is_required': True, 'field': 'general', 'options': ['vxlan', 'vlan'], } @@ -285,14 +291,12 @@ METADATA = { 'range': { '_self': { 'mapping_to': 'range', - 'is_required': True, 'field': 'general', } }, 'provider_network': { '_self': { 'mapping_to': 'provider_network', - 'is_required': True, 'field': 'general', } } diff --git a/deploy/compass_conf/role/kubernetes_ansible.conf b/deploy/compass_conf/role/kubernetes_ansible.conf index 3e79cbb9..02e10cee 100755 --- a/deploy/compass_conf/role/kubernetes_ansible.conf +++ b/deploy/compass_conf/role/kubernetes_ansible.conf @@ -12,6 +12,11 @@ ROLES = [{ 'display_name': 'kube node', 'description': 'kube Node' }, { + 'role': 'opencontrail', + 'display_name': 'opencontrail node', + 'description': 'opencontrail node', + 'optional': True +},{ 'role': 'ha', 'display_name': 'ha', 'description': 'ha' diff --git a/deploy/compass_conf/role/openstack_queens_ansible.conf b/deploy/compass_conf/role/openstack_queens_ansible.conf new file mode 100755 index 00000000..d46bd401 --- /dev/null +++ b/deploy/compass_conf/role/openstack_queens_ansible.conf @@ -0,0 +1,125 @@ +ADAPTER_NAME = 'openstack_queens' +ROLES = [{ + 'role': 'allinone-compute', + 'display_name': 'all in one', + 'description': 'All in One' +}, { + 'role': 'controller', + 'display_name': 'controller node', + 'description': 'Controller Node' +}, { + 'role': 'compute', + 'display_name': 'compute node', + 'description': 'Compute Node' +}, { + 'role': 'storage', + 'display_name': 'storage node', + 'description': 'Storage Node' +}, { + 'role': 'network', + 'display_name': 'network node', + 'description': 'Network Node' +}, { + 'role': 'compute-worker', + 'display_name': 'Compute worker node', + 'description': 'Compute worker node' +}, { + 'role': 'compute-controller', + 'display_name': 'Compute controller node', + 'description': 'Compute controller node' +}, { + 'role': 'network-server', + 'display_name': 'Network server node', + 'description': 'Network server node' +}, { + 'role': 'database', + 'display_name': 'Database node', + 'description': 'Database node' +}, { + 'role': 'messaging', + 'display_name': 'Messaging queue node', + 'description': 'Messaging queue node' +}, { + 'role': 'image', + 'display': 'Image node', + 'description': 'Image node' +}, { + 'role': 'dashboard', + 'display': 'Dashboard node', + 'description': 'Dashboard node' +}, { + 'role': 'identity', + 'display': 'Identity node', + 'description': 'Identity node' +}, { + 'role': 'storage-controller', + 'display': 'Storage controller node', + 'description': 'Storage controller node' +}, { + 'role': 'storage-volume', + 'display': 'Storage volume node', + 'description': 'Storage volume node' +}, { + 'role': 'network-worker', + 'display': 'Network worker node', + 'description': 'Network worker node' +}, { + 'role': 'odl', + 'display': 'open day light', + 'description': 'odl node', + 'optional': True +}, { + 'role': 'onos', + 'display': 'open network operating system', + 'description': 'onos node', + 'optional': True +}, { + 'role': 'opencontrail', + 'display': 'open contrail', + 'description': 'opencontrail node', + 'optional': True +}, { + 'role': 'ha', + 'display': 'Cluster with HA', + 'description': 'Cluster with HA node' +}, { + 'role': 'ceph-adm', + 'display': 'Ceph Admin Node', + 'description': 'Ceph Admin Node', + 'optional': True +}, { + 'role': 'ceph-mon', + 'display': 'Ceph Monitor Node', + 'description': 'Ceph Monitor Node', + 'optional': True +}, { + 'role': 'ceph-osd', + 'display': 'Ceph Storage Node', + 'description': 'Ceph Storage Node', + 'optional': True +}, { + 'role': 'ceph-osd-node', + 'display': 'Ceph osd install from node', + 'description': '', + 'optional': True +}, { + 'role': 'ceph', + 'display': 'ceph node', + 'description': 'ceph node', + 'optional': True +}, { + 'role': 'sec-patch', + 'display': 'sec-patch node', + 'description': 'Security Patch Node', + 'optional': True +}, { + 'role': 'none', + 'display': 'none node', + 'description': 'Only install OS Node', + 'optional': True +}, { + 'role': 'moon', + 'display': 'moon master or slave node', + 'description': "Moon master/slave Node", + 'optional': True +}] diff --git a/deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl b/deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl index 0d529561..55ef7ae4 100644 --- a/deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl @@ -45,6 +45,10 @@ external_cidr: "{{ ip_settings[inventory_hostname]['external']['cidr'] }}" public_net_info: "{{ network_cfg.public_net_info }}" host_ip_settings: "{{ ip_settings[inventory_hostname] }}" +proxy: $getVar('http_proxy', '') +#set no_proxy = ','.join($getVar('no_proxy', [])) +ignore_proxy: $no_proxy + ntp_server: $ntp_server internal_vip: ip: $network_cfg["internal_vip"]["ip"] @@ -118,6 +122,14 @@ erlang.cookie: DJJVECFMCJPVYQTJTDWG $keys[0]: $values[0] #end for +cluster_param: +#set cluster_param = $getVar('cluster_param', []) +#for item in cluster_param +#set keys = $item.keys() +#set values = $item.values() + $keys[0]: $values[0] +#end for + #set neutron_service_plugins=['router'] #if $getVar('enable_fwaas', True) diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/HA-ansible-multinodes.tmpl new file mode 100755 index 00000000..4d20ff6d --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/HA-ansible-multinodes.tmpl @@ -0,0 +1,12 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_queens-$cluster_name/ansible.log +host_key_checking = False +callback_whitelist = playbook_done, status_callback +callback_plugins = /opt/ansible_plugins/callback +lookup_plugins = /opt/ansible_plugins/lookup +forks=100 + +[ssh_connection] +pipelining=True +retries = 5 diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/allinone.tmpl new file mode 100755 index 00000000..7a947da7 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/allinone.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_queens-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/ansible_callbacks +pipelining=True diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/multinodes.tmpl new file mode 100755 index 00000000..7a947da7 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/multinodes.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_queens-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/ansible_callbacks +pipelining=True diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/single-controller.tmpl new file mode 100755 index 00000000..7a947da7 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/single-controller.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_queens-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/ansible_callbacks +pipelining=True diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/HA-ansible-multinodes.tmpl new file mode 100755 index 00000000..4c98066e --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/HA-ansible-multinodes.tmpl @@ -0,0 +1,31 @@ +#set ip_settings={} +#for k,v in $getVar('ip_settings', {}).items() +#set host_ip_settings={} +#for intf in v +#set $host_ip_settings[$intf["alias"]]=intf +#end for +#set $ip_settings[$k]=$host_ip_settings +#end for + +# localhost +127.0.0.1 localhost +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($compute, list) + #set computes = [$computes] +#end if +# controller +#for worker in $controllers + #set worker_hostname = $worker.hostname + #set worker_ip = $ip_settings[$worker_hostname]["tenant"]["ip"] +$worker_ip $worker_hostname +#end for +# compute +#for worker in $computes + #set worker_hostname = $worker.hostname + #set worker_ip = $ip_settings[$worker_hostname]["tenant"]["ip"] +$worker_ip $worker_hostname +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/allinone.tmpl new file mode 100755 index 00000000..b777815e --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/allinone.tmpl @@ -0,0 +1,10 @@ +#set controllers = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +# allinone +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_ip $controller_hostname +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/multinodes.tmpl new file mode 100755 index 00000000..ca8c793f --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/multinodes.tmpl @@ -0,0 +1,110 @@ +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +# compute-controller +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# database +#for worker in $databases + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# messaging +#for worker in $messagings + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage-controller +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# image +#for worker in $images + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# identity +#for worker in $identities + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network-server +#for worker in $network_servers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# dashboard +#for worker in $dashboards + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage-volume +#for worker in $storage_volumes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network-worker +#for worker in $network_workers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# compute-worker +#for worker in $compute_workers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/single-controller.tmpl new file mode 100755 index 00000000..3ed94694 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/single-controller.tmpl @@ -0,0 +1,40 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set storages = $getVar('storage', []) +#set networks = $getVar('network', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +# controller +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_ip $controller_hostname +#end for +# compute +#for worker in $computes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage +#for worker in $storages + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network +#for worker in $networks + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/HA-ansible-multinodes.tmpl new file mode 100755 index 00000000..7184d21d --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/HA-ansible-multinodes.tmpl @@ -0,0 +1,74 @@ +#set inventory_json = $getVar('inventory_json', []) +#!/usr/bin/env python + +import os +import sys +import copy +import argparse + +try: + import json +except ImportError: + import simplejson as json + +local_inventory='$inventory_json' + +def _byteify(data, ignore_dicts = False): + if isinstance(data, unicode): + return data.encode('utf-8') + if isinstance(data, list): + return [ _byteify(item, ignore_dicts=True) for item in data ] + if isinstance(data, dict) and not ignore_dicts: + return { + _byteify(key, ignore_dicts=True): _byteify(value, ignore_dicts=True) + for key, value in data.iteritems() + } + return data + +def merge_dict(ldict, rdict, overwrite=True): + if not (ldict and rdict): + return + + if not isinstance(ldict, dict): + raise TypeError('ldict type is %s not dict' % type(ldict)) + + if not isinstance(rdict, dict): + raise TypeError('rdict type is %s not dict' % type(rdict)) + + for key, value in rdict.items(): + if isinstance(value, dict) and key in ldict and isinstance(ldict[key], + dict): + merge_dict(ldict[key], value, overwrite) + else: + if overwrite or key not in ldict: + ldict[key] = copy.deepcopy(value) + +def load_inventory(inventory): + if not os.path.exists(inventory): + raise RuntimeError('file: %s not exist' % inventory) + with open(inventory, 'r') as fd: + return json.load(fd, object_hook=_byteify) + +def dump_inventory(inventory, data): + with open(inventory, 'w') as fd: + json.dump(data, fd, indent=4) + +def merge_inventory(linv, rinv): + ldata = load_inventory(linv) + rdata = load_inventory(rinv) + merge_dict(ldata, rdata, overwrite=True) + dump_inventory(linv, ldata) + +def read_cli_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--list', action = 'store_true') + parser.add_argument('--merge', action = 'store') + return parser.parse_args() + +if __name__ == '__main__': + get_args = read_cli_args() + new_inventory = get_args.merge + if get_args.list: + print load_inventory(local_inventory) + elif new_inventory: + merge_inventory(local_inventory, new_inventory) diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/allinone.tmpl new file mode 100755 index 00000000..b320b9c5 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/allinone.tmpl @@ -0,0 +1,47 @@ +#set controllers = $getVar('allinone_compute', []) +#set computes = $getVar('allinone_compute', []) +#set storages = $getVar('allinone_compute', []) +#set networks = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[compute] +#for compute in $computes + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[network] +#for network in $networks + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/multinodes.tmpl new file mode 100755 index 00000000..b342d22f --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/multinodes.tmpl @@ -0,0 +1,123 @@ +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[compute-controller] +#for controller in $compute_controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[compute-worker] +#for compute in $compute_workers + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[network-server] +#for network in $network_servers + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[network-worker] +#for network in $network_workers + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[database] +#for worker in $databases + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[messaging] +#for worker in $messagings + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[image] +#for worker in $images + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[dashboard] +#for worker in $dashboards + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[identity] +#for worker in $identities + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[storage-controller] +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[storage-volume] +#for worker in $storage_volumes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/single-controller.tmpl new file mode 100755 index 00000000..1afb45fa --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/single-controller.tmpl @@ -0,0 +1,67 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set storages = $getVar('storage', []) +#set networks = $getVar('network', []) +#set odls = $getVar('odl', []) +#set onoss = $getVar('onos', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +#if not $isinstance($odls, list) + #set odls = [$odls] +#end if +#if not $isinstance($onoss, list) + #set onoss = [$onoss] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[compute] +#for compute in $computes + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[network] +#for network in $networks + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for +[odl] +#for odl in odls + #set odl_ip = $odl.management.ip + #set odl_hostname = $odl.hostname +$odl_hostname ansible_ssh_host=$odl_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/HA-ansible-multinodes.tmpl new file mode 100755 index 00000000..202f86bb --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/HA-ansible-multinodes.tmpl @@ -0,0 +1,237 @@ +#from random import randint +#set cluster_name = $getVar('name', '') +#set network_cfg = $getVar('network_cfg', {}) +#set ntp_server = $getVar('ntp_server', "") +#set ceph_disk = $getVar('ceph_disk',"") +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set $contr_sys_mappings= {} +#set $compu_sys_mappings= {} +#for $intf_info in $network_cfg.sys_intf_mappings +#if "controller" in $intf_info["role"] +#set $contr_sys_mappings[$intf_info["name"]] = $intf_info +#end if +#if "compute" in $intf_info["role"] +#set $compu_sys_mappings[$intf_info["name"]] = $intf_info +#end if +#end for + +#set ip_settings={} +#for k,v in $getVar('ip_settings', {}).items() +#set host_ip_settings={} +#for intf in v +#set $host_ip_settings[$intf["alias"]]=intf +#end for +#set $ip_settings[$k]=$host_ip_settings +#end for + +#for item in $network_cfg["ip_settings"] +#if $item["name"] == "mgmt" +#set mgmt_cfg = $item +#end if +#if $item["name"] == "external" +#set external_cfg = $item +#end if +#if $item["name"] == "tenant" +#set tenant_cfg = $item +#end if +#if $item["name"] == "storage" +#set storage_cfg = $item +#end if +#end for + +#set provider_net_mappings = $network_cfg["provider_net_mappings"] +#set contr_prv_mappings = {} +#set compu_prv_mappings = {} +#for item in $provider_net_mappings +#if "controller" in $item["role"] +#set $contr_prv_mappings[$item["network"]] = {"bridge":$item["name"],"interface":$item["interface"]} +#end if +#if "compute" in $item["role"] +#set $compu_prv_mappings[$item["network"]] = {"bridge":$item["name"],"interface":$item["interface"]} +#end if +#end for + +#set neutron_cfg = $getVar('neutron_config', {}) +#set ovs_config = $neutron_cfg.openvswitch +#set has = $getVar('ha', []) +#set ha_vip = $getVar('ha_vip', []) + +run_dir: $getVar('run_dir', '') + +enable_secgroup: $getVar('enable_secgroup', True) +enable_fwaas: $getVar('enable_fwaas', True) +enable_vpnaas: $getVar('enable_vpnaas', True) +ha_network: $getVar('ha_network', 'Disable') +onos_nic: $getVar('onos_nic', 'eth2') +onos_sfc: $getVar('onos_sfc', 'Disable') +ip_settings: $ip_settings +network_cfg: $network_cfg + +provider_net_mappings: $network_cfg["provider_net_mappings"] + +contr_sys_mappings: $contr_sys_mappings +compu_sys_mappings: $compu_sys_mappings + +contr_prv_mappings: $contr_prv_mappings +compu_prv_mappings: $compu_prv_mappings + +deploy_type: $getVar('deploy_type', 'virtual') + +mgmt_cidr: $mgmt_cfg["cidr"] +external_cidr: $external_cfg["cidr"] +tenant_cidr: $tenant_cfg["cidr"] +storage_cidr: $storage_cfg["cidr"] + +tenant_net_info: "{{ network_cfg.tenant_net_info }}" +public_net_info: "{{ network_cfg.public_net_info }}" +host_ip_settings: "{{ ip_settings[inventory_hostname] }}" + +ntp_server: $ntp_server + +offline_deployment: $getVar('offline_deployment', 'Disable') +offline_repo_ip: $getVar('compass_ip', '') +offline_repo_port: $getVar('offline_repo_port', '5151') + +internal_vip: + ip: $network_cfg["internal_vip"]["ip"] + netmask: $network_cfg["internal_vip"]["netmask"] +#if "vlan_tag" in $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]] + interface: $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]]["name"] +#else + interface: $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]]["interface"] +#end if + +public_vip: + ip: $network_cfg["public_vip"]["ip"] + netmask: $network_cfg["public_vip"]["netmask"] +#if "vlan_tag" in $contr_sys_mappings[$network_cfg["public_vip"]["interface"]] + interface: $contr_sys_mappings[$network_cfg["public_vip"]["interface"]]["name"] +#else + interface: $contr_sys_mappings[$network_cfg["public_vip"]["interface"]]["interface"] +#end if + +db_host: "{{ internal_vip.ip }}" +rabbit_host: "{{ internal_vip.ip }}" + +internal_ip: "{{ ip_settings[inventory_hostname]['tenant']['ip'] }}" +internal_nic: tenant + +#set random_id = randint(1, 255) +vrouter_id_internal: $random_id +vrouter_id_public: $random_id + +identity_host: "{{ internal_ip }}" +controllers_host: "{{ internal_ip }}" +storage_controller_host: "{{ internal_ip }}" +compute_controller_host: "{{ internal_ip }}" +image_host: "{{ internal_ip }}" +network_server_host: "{{ internal_ip }}" +dashboard_host: "{{ internal_ip }}" + +haproxy_hosts: +#for $item in $has +#set $hostname=$item["hostname"] + $hostname: $ip_settings[$hostname]["tenant"]["ip"] +#end for + +host_index: +#for $index, $item in enumerate($has) + $item["hostname"]: $index +#end for + +ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD + +cluster_name: $cluster_name + +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controllers_host }}" +DB_HOST: "{{ db_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-queens.list +queens_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 +erlang.cookie: DJJVECFMCJPVYQTJTDWG + +#set plugins = $getVar('plugins', []) +#set odl_enable = False +#for item in plugins +#set key = $item.keys()[0] +#set value = $item.values()[0] +#if $key == "opendaylight" and $value == "Enable" +#set odl_enable = True +#end if +$key: $value +#end for + +#set cluster_param = $getVar('cluster_param', []) +#for item in cluster_param +#set key = $item.keys()[0] +#set value = $item.values()[0] +$key: $value +#end for + +#set neutron_service_plugins=['router'] +#if $getVar('enable_fwaas', True) +#neutron_service_plugins.append('firewall') +#end if +#if $getVar('enable_vpnaas', True) +#neutron_service_plugins.append('vpnaas') +#end if + +NEUTRON_SERVICE_PLUGINS: $neutron_service_plugins +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan', 'vlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['$ovs_config["tenant_network_type"]'] +NEUTRON_OVS_BRIDGE_MAPPINGS: $ovs_config['bridge_mappings'] +#if 'vlan_ranges' in $ovs_config +NEUTRON_VLAN_RANGES: $ovs_config['vlan_ranges'] +#else +NEUTRON_VLAN_RANGES: [] +#end if +#if 'tunnel_id_ranges' in $ovs_config +NEUTRON_TUNNEL_ID_RANGES: $ovs_config['tunnel_id_ranges'] +#else +NEUTRON_TUNNEL_ID_RANGES: [] +#end if + +#if odl_enable == True +NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +#else +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +#end if +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +WSREP_SST_USER: wsrep_sst +WSREP_SST_PASS: wsrep_sst_sercet + +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: "{{ internal_ip }}" + +#build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image: http://192.168.121.12:9999/img/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +api_workers: 1 + +physical_device: /dev/sdb + +odl_api_port: 8080 + +odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz +odl_pkg_name: karaf.tar.gz +odl_home: "/opt/opendaylight-0.2.2/" +odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] +odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] +odl_features: "{{ odl_base_features + odl_extra_features }}" +odl_api_port: 8080 + +#set moon_cfg = $getVar('moon_cfg', {}) +moon_master: $moon_cfg.master.flag +moon_slave: $moon_cfg.slave.flag +moon_slave_name: $moon_cfg.slave.name +moon_master_ip: $moon_cfg.slave.master_ip + diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/allinone.tmpl new file mode 100755 index 00000000..2260a08d --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/allinone.tmpl @@ -0,0 +1,65 @@ +#set cluster_name = $getVar('name', '') +#set controllers = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if + +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +controller_host: $controller_ip +#end for +#for network in $controllers + #set network_external_nic = $network.external.interface + #set network_external_subnet = $network.external.subnet + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + + +compute_controller_host: "{{ controller_host }}" +db_host: "{{ controller_host }}" +rabbit_host: "{{ controller_host }}" +storage_controller_host: "{{ controller_host }}" +image_host: "{{ controller_host }}" +identity_host: "{{ controller_host }}" +network_server_host: "{{ controller_host }}" +dashboard_host: "{{ controller_host }}" + +cluster_name: $cluster_name +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controller_host }}" +DB_HOST: "{{ controller_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-queens.list +queens_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" + diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/multinodes.tmpl new file mode 100755 index 00000000..a75a633a --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/multinodes.tmpl @@ -0,0 +1,136 @@ +#set cluster_name = $getVar('name', '') +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip +compute_controller_host: $worker_ip +#end for +#for worker in $databases + #set worker_ip = $worker.management.ip +db_host: $worker_ip +#end for +#for worker in $messagings + #set worker_ip = $worker.management.ip +rabbit_host: $worker_ip +#end for +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip +storage_controller_host: $worker_ip +#end for +#for worker in $images + #set worker_ip = $worker.management.ip +image_host: $worker_ip +#end for +#for worker in $identities + #set worker_ip = $worker.management.ip +identity_host: $worker_ip +#end for +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip +compute_controller_host: $worker_ip +#end for +#for worker in $network_servers + #set worker_ip = $worker.management.ip +network_server_host: $worker_ip +#end for +#for worker in $dashboards + #set worker_ip = $worker.management.ip +dashboard_host: $worker_ip +#end for +#for network in $network_workers + #set network_external_nic = $network.external.interface + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + +cluster_name: $cluster_name + +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ compute_controller_host }}" +DB_HOST: "{{ db_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-queens.list +queens_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" +odl_username: admin +odl_password: admin +odl_api_port: 8080 + +odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz +odl_pkg_name: karaf.tar.gz +odl_home: "/opt/opendaylight-0.2.2/" +odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] +odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] +odl_features: "{{ odl_base_features + odl_extra_features }}" +odl_api_port: 8080 + diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/single-controller.tmpl new file mode 100755 index 00000000..7f021d31 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/single-controller.tmpl @@ -0,0 +1,77 @@ +#set cluster_name = $getVar('name', '') +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set networks = $getVar('network', []) +#set storages = $getVar('storage', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if + +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +controller_host: $controller_ip +#end for +#for network in $networks + #set network_external_nic = $network.external.interface + #set network_external_subnet = $network.external.subnet + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + + +cluster_name: $cluster_name +deploy_type: $getVar('deploy_type', 'virtual') +compute_controller_host: "{{ controller_host }}" +db_host: "{{ controller_host }}" +rabbit_host: "{{ controller_host }}" +storage_controller_host: "{{ controller_host }}" +image_host: "{{ controller_host }}" +identity_host: "{{ controller_host }}" +network_server_host: "{{ controller_host }}" +dashboard_host: "{{ controller_host }}" +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controller_host }}" +DB_HOST: "{{ controller_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-queens.list +queens_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +# EXTERNAL_NETWORK_CIDR: $network_external_subnet +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" diff --git a/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/profile.tmpl b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/profile.tmpl new file mode 100755 index 00000000..cfa89004 --- /dev/null +++ b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/profile.tmpl @@ -0,0 +1,3 @@ +{ + "repos": "$getVar('repo_name', '')" +} diff --git a/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/system.tmpl b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/system.tmpl new file mode 100755 index 00000000..8e4cbbbe --- /dev/null +++ b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/system.tmpl @@ -0,0 +1,76 @@ +{ + "name": "$hostname", + "hostname": "$hostname", + "profile": "$profile", + "gateway": "$gateway", + #import simplejson as json + #set nameservers = json.dumps($nameservers, encoding='utf-8') + "name_servers": $nameservers, + #set search_path = ' '.join($search_path) + "name_servers_search": "$search_path", + "proxy": "$getVar('http_proxy', '')", + "modify_interface": + #set networks = $networks + #set rekeyed = {} + #set promic_nic = "" + #for $nic, $val in $networks.iteritems(): + #set ip_key = '-'.join(('ipaddress', $nic)) + #set netmask_key = '-'.join(('netmask', $nic)) + #set mgmt_key = '-'.join(('management', $nic)) + #set static_key = '-'.join(('static', $nic)) + #set $rekeyed[$ip_key] = $val.ip + #set $rekeyed[$netmask_key] = $val.netmask + #set $rekeyed[$mgmt_key] = $val.is_mgmt + #set $rekeyed[$static_key] = True + + #set dns_key = '-'.join(('dnsname', $nic)) + #if $val.is_mgmt + #set $rekeyed[$dns_key] = $dns + #else + #if '.' in $dns + #set $dns_name, $dns_domain = $dns.split('.', 1) + #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain) + #else + #set $dns_nic = '%s-%s' % ($dns, $nic) + #end if + #set $rekeyed[$dns_key] = $dns_nic + #end if + + #if $val.is_promiscuous: + #set promic_nic = $nic + #end if + #if $val.is_mgmt: + #set mac_key = '-'.join(('macaddress', $nic)) + #set $rekeyed[$mac_key] = $mac + #end if + #end for + #set nic_info = json.dumps($rekeyed, encoding='utf-8') + $nic_info + , + "ksmeta":{ + #set partition_config = '' + #for k, v in $partition.iteritems(): + #set path = '' + #if v['vol_percentage']: + #set $path = k + ' ' + str(v['vol_percentage']) + '%' + #else: + #set $path = k + ' ' + str(v['vol_size']) + #end if + #set partition_config = ';'.join((partition_config, $path)) + #end for + #set partition_config = partition_config[1:] + #import crypt + #set $password = crypt.crypt($server_credentials.password, "az") + #set no_proxy = ','.join($getVar('no_proxy', [])) + "username": "$server_credentials.username", + "password": "$password", + "promisc_nics": "$promic_nic", + "partition": "$partition_config", + "https_proxy": "$getVar('https_proxy', '')", + "ntp_server": "$ntp_server", + "timezone": "$timezone", + "ignore_proxy": "$no_proxy", + "local_repo": "$getVar('local_repo', '')", + "disk_num": "1" + } +} diff --git a/deploy/compass_conf/templates/cobbler/ubuntu-16.04.3-server-x86_64/system.tmpl b/deploy/compass_conf/templates/cobbler/ubuntu-16.04.3-server-x86_64/system.tmpl index cfcc883e..366cbc13 100755 --- a/deploy/compass_conf/templates/cobbler/ubuntu-16.04.3-server-x86_64/system.tmpl +++ b/deploy/compass_conf/templates/cobbler/ubuntu-16.04.3-server-x86_64/system.tmpl @@ -11,36 +11,38 @@ "proxy": "$getVar('http_proxy', '')", "modify_interface": #set networks = $networks + #set mac = $mac #set rekeyed = {} #set promic_nic = "" - #for $nic, $val in $networks.iteritems(): - #set ip_key = '-'.join(('ipaddress', $nic)) - #set netmask_key = '-'.join(('netmask', $nic)) - #set mgmt_key = '-'.join(('management', $nic)) - #set static_key = '-'.join(('static', $nic)) - #set $rekeyed[$ip_key] = $val.ip - #set $rekeyed[$netmask_key] = $val.netmask - #set $rekeyed[$static_key] = True + #for $nic in $mac + #set mac_key = '-'.join(('macaddress', $nic)) + #set $rekeyed[$mac_key] = $mac[$nic] + #if $nic in $networks + #set val = $networks[$nic] + #set ip_key = '-'.join(('ipaddress', $nic)) + #set netmask_key = '-'.join(('netmask', $nic)) + #set mgmt_key = '-'.join(('management', $nic)) + #set static_key = '-'.join(('static', $nic)) + #set $rekeyed[$ip_key] = $val.ip + #set $rekeyed[$netmask_key] = $val.netmask + #set $rekeyed[$static_key] = True - #set dns_key = '-'.join(('dnsname', $nic)) - #if $val.is_mgmt - #set $rekeyed[$dns_key] = $dns - #else - #if '.' in $dns - #set $dns_name, $dns_domain = $dns.split('.', 1) - #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain) + #set dns_key = '-'.join(('dnsname', $nic)) + #if $val.is_mgmt + #set $rekeyed[$dns_key] = $dns #else - #set $dns_nic = '%s-%s' % ($dns, $nic) + #if '.' in $dns + #set $dns_name, $dns_domain = $dns.split('.', 1) + #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain) + #else + #set $dns_nic = '%s-%s' % ($dns, $nic) + #end if + #set $rekeyed[$dns_key] = $dns_nic #end if - #set $rekeyed[$dns_key] = $dns_nic - #end if - #if $val.is_promiscuous: - #set promic_nic = $nic - #end if - #if $val.is_mgmt: - #set mac_key = '-'.join(('macaddress', $nic)) - #set $rekeyed[$mac_key] = $mac + #if $val.is_promiscuous + #set promic_nic = $nic + #end if #end if #end for #set nic_info = json.dumps($rekeyed, encoding='utf-8') @@ -71,5 +73,9 @@ "ignore_proxy": "$no_proxy", "local_repo": "$getVar('local_repo', '')", "disk_num": "1" - } + }, + "power_address": "$power_manage.ip", + "power_user": "$power_manage.username", + "power_pass": "$power_manage.password", + "power_type": "$getVar('power_type', 'ipmilan')" } diff --git a/deploy/compass_vm.sh b/deploy/compass_vm.sh index 17171578..edce626b 100755 --- a/deploy/compass_vm.sh +++ b/deploy/compass_vm.sh @@ -12,15 +12,15 @@ rsa_file=$compass_vm_dir/boot.rsa ssh_args="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $rsa_file" function check_container_alive() { - docker exec -it compass-deck bash -c "exit" 1>/dev/null 2>&1 + sudo docker exec -it compass-deck bash -c "exit" local deck_state=$? - docker exec -it compass-tasks bash -c "exit" 1>/dev/null 2>&1 + sudo docker exec -it compass-tasks bash -c "exit" local tasks_state=$? - docker exec -it compass-cobbler bash -c "exit" 1>/dev/null 2>&1 + sudo docker exec -it compass-cobbler bash -c "exit" local cobbler_state=$? - docker exec -it compass-db bash -c "exit" 1>/dev/null 2>&1 + sudo docker exec -it compass-db bash -c "exit" local db_state=$? - docker exec -it compass-mq bash -c "exit" 1>/dev/null 2>&1 + sudo docker exec -it compass-mq bash -c "exit" local mq_state=$? if [ $((deck_state||tasks_state||cobbler_state||db_state||mq_state)) == 0 ]; then @@ -47,9 +47,7 @@ function install_compass_core() { } function set_compass_machine() { - local config_file=$WORK_DIR/installer/docker-compose/group_vars/all - sed -i '/pxe_boot_macs/d' $config_file - echo "pxe_boot_macs: [${machines}]" >> $config_file + cp $WORK_DIR/script/machine $WORK_DIR/docker/ ansible-playbook $WORK_DIR/installer/docker-compose/add_machine.yml } @@ -181,6 +179,35 @@ function recover_compass() { log_info "launch_compass exit" } +function launch_harbor() { + local harbor_install_dir=$WORK_DIR/installer + + if [[ ! -d $harbor_install_dir ]]; then + mkdir -p $harbor_install_dir + fi + + local harbor_cfg=$harbor_install_dir/harbor/harbor.cfg + local harbor_docker_compose=$harbor_install_dir/harbor/docker-compose.yml + local harbor_tar=$harbor_install_dir/compass_dists/harbor-offline-installer-v$HABOR_VERSION.tgz + rm -f $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz + curl --connect-timeout 10 -o $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz file://$harbor_tar + tar -zxf $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz -C $harbor_install_dir + + sed "s/^hostname = .*/hostname = $INSTALL_IP:8080/g" -i $harbor_cfg + sed "s/80:80/8080:80/g" -i $harbor_docker_compose + sed "s/443:443/8443:443/g" -i $harbor_docker_compose + cd $harbor_install_dir/harbor/ + sudo ./prepare + if [ -n "$(docker-compose -f $harbor_docker_compose ps -q)" ] + then + log_info "stopping existing Harbor instance ..." + docker-compose -f $harbor_docker_compose down -v + log_info "remove the odler harbor images ..." + sudo docker images | grep 'vmware' | awk '{print $3;}' | xargs docker rmi -f + fi + ./install.sh +} + function _check_hosts_reachable() { retry=0 diff --git a/deploy/conf/base.conf b/deploy/conf/base.conf index 274847ae..76eb1491 100644 --- a/deploy/conf/base.conf +++ b/deploy/conf/base.conf @@ -17,8 +17,8 @@ export EXPANSION=${EXPANSION:-"false"} export NETWORK_MAPPING=${NETWORK_MAPPING:-"install=${MANAGEMENT_INTERFACE}"} -export PROXY="" -export IGNORE_PROXY="" +export PROXY=${LOCAL_PROXY:-""} +export IGNORE_PROXY=${LOCAL_NO_PROXY:-""} export SEARCH_PATH="ods.com" export SERVER_CREDENTIAL="root=root" export LOCAL_REPO_URL="" diff --git a/deploy/conf/cluster.conf b/deploy/conf/cluster.conf index 0d947100..6510f3cb 100644 --- a/deploy/conf/cluster.conf +++ b/deploy/conf/cluster.conf @@ -8,8 +8,9 @@ else export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)CentOS-7.*17.*'} fi -# pike -export OPENSTACK_VERSION=${OPENSTACK_VERSION:-"pike"} +export DEPLOY_TOOL=${DEPLOY_TOOL:-"osa"} +# queens +export OPENSTACK_VERSION=${OPENSTACK_VERSION:-"queens"} # don't touch this export ADAPTER_TARGET_SYSTEM_PATTERN="^openstack$" @@ -25,6 +26,7 @@ export ADAPTER_FLAVOR_PATTERN="HA-ansible-multinodes-$OPENSTACK_VERSION" if [[ "x"$KUBERNETES_VERSION != "x" ]]; then unset OPENSTACK_VERSION + export DEPLOY_TOOL="k8s" export ADAPTER_NAME=kubernetes export ADAPTER_FLAVOR_PATTERN=ansible-kubernetes export ADAPTER_TARGET_SYSTEM_PATTERN='^kubernetes$' diff --git a/deploy/conf/compass.conf b/deploy/conf/compass.conf index be5d17c3..b031c035 100644 --- a/deploy/conf/compass.conf +++ b/deploy/conf/compass.conf @@ -16,10 +16,6 @@ export NAMESERVERS=${USER_NAMESERVER:-"$COMPASS_SERVER"} export COMPASS_REPO_PORT="5151" export OFFLINE_DEPLOY=${OFFLINE_DEPLOY:-'Disable'} -if [[ "x"$COMPOSE_IMAGES == "x" && "x"$OPENSTACK_VERSION != "x" ]]; then - export COMPOSE_IMAGES="[compass-db,compass-mq,compass-deck,compass-tasks-osa,compass-cobbler]" -fi - -if [[ "x"$COMPOSE_IMAGES == "x" && "x"$KUBERNETES_VERSION != "x" ]]; then - export COMPOSE_IMAGES="[compass-db,compass-mq,compass-deck,compass-tasks-k8s,compass-cobbler]" +if [[ "x"$COMPOSE_IMAGES == "x" ]]; then + export COMPOSE_IMAGES="[compass-db,compass-mq,compass-deck,compass-tasks-$DEPLOY_TOOL,compass-cobbler]" fi diff --git a/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-nofeature-ha.yml index 2cedcf4d..29ca9ac0 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-nofeature-ha.yml @@ -31,7 +31,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - kube_master @@ -39,10 +39,10 @@ hosts: - ha - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - kube_master diff --git a/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-stor4nfv-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-stor4nfv-ha.yml index 6cf62db7..6efdadc3 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-stor4nfv-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-stor4nfv-ha.yml @@ -34,7 +34,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - kube_master @@ -42,10 +42,10 @@ hosts: - ha - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - kube_master diff --git a/deploy/conf/hardware_environment/huawei-pod1/network.yml b/deploy/conf/hardware_environment/huawei-pod1/network.yml index 77160d69..a5b01145 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/network.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/network_dpdk.yml b/deploy/conf/hardware_environment/huawei-pod1/network_dpdk.yml index 03483629..3e871f98 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/network_dpdk.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/network_odl.yml b/deploy/conf/hardware_environment/huawei-pod1/network_odl.yml new file mode 100644 index 00000000..266fd222 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod1/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.168.10.10" + - "192.168.10.50" + cidr: "192.168.10.0/24" + gw: "192.168.10.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.168.10.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 10 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.168.10.1" + floating_ip_cidr: "192.168.10.0/24" + floating_ip_start: "192.168.10.100" + floating_ip_end: "192.168.10.200" diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-bar-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-bar-ha.yml index 59e7180a..32f561d5 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-bar-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-bar-ha.yml @@ -35,7 +35,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -43,10 +43,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-kvm-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-kvm-ha.yml index 9c00916b..03267ffc 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-kvm-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-kvm-ha.yml @@ -35,7 +35,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -43,10 +43,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml index 6b329be6..7ca9e795 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml @@ -32,7 +32,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -40,10 +40,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-openo-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-openo-ha.yml index 6027bddb..b2440ee4 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-openo-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-openo-ha.yml @@ -40,7 +40,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -48,10 +48,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-stor4nfv-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-stor4nfv-ha.yml new file mode 100644 index 00000000..5ce9b47a --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-stor4nfv-ha.yml @@ -0,0 +1,74 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: baremetal +FLAVOR: cluster +POWER_TOOL: ipmitool + +ipmiUser: root +ipmiVer: '2.0' + +plugins: + - stor4nfv: "Enable" + +hosts: + - name: host1 + mac: 'F8:4A:BF:55:A2:8D' + interfaces: + - eth1: 'F8:4A:BF:55:A2:8E' + ipmiIp: 172.16.130.26 + ipmiPass: Opnfv@pod1 + roles: + - controller + - ha + - ceph-adm + - ceph-mon + + - name: host2 + mac: 'D8:49:0B:DA:5A:B7' + interfaces: + - eth1: 'D8:49:0B:DA:5A:B8' + ipmiIp: 172.16.130.29 + ipmiPass: Opnfv@pod1 + roles: + - controller + - ha + - ceph-mon + + - name: host3 + mac: '70:7B:E8:77:7B:60' + interfaces: + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 + ipmiPass: Opnfv@pod1 + roles: + - controller + - ha + - ceph-mon + + - name: host4 + mac: 'D8:49:0B:DA:5B:5D' + interfaces: + - eth1: 'D8:49:0B:DA:5B:5E' + ipmiIp: 172.16.130.30 + ipmiPass: Opnfv@pod1 + roles: + - compute + - ceph-osd + + - name: host5 + mac: 'D8:49:0B:DA:56:85' + interfaces: + - eth1: 'D8:49:0B:DA:56:86' + ipmiIp: 172.16.130.31 + ipmiPass: Opnfv@pod1 + roles: + - compute + - ceph-osd diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml index 287383b2..bfab0151 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml @@ -33,17 +33,17 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - compute - ceph-osd - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - compute diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl-sfc-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl-sfc-ha.yml index 8095fe03..c5fd84ee 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl-sfc-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl-sfc-ha.yml @@ -38,7 +38,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -47,10 +47,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml index d2447c1d..71b114f2 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml @@ -37,7 +37,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -46,10 +46,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml index 71edf08c..2c2757a6 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml @@ -36,7 +36,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -45,10 +45,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml index 2aaf192f..cc621d76 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,8 @@ POWER_TOOL: ipmitool ipmiUser: root ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" plugins: - opendaylight: "Enable" @@ -37,7 +38,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -46,10 +47,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml index fb4b1788..57d0a2d5 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml @@ -33,7 +33,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -42,10 +42,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml index 1f40241f..c8aee2dc 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml @@ -35,7 +35,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -44,10 +44,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod2/network.yml b/deploy/conf/hardware_environment/huawei-pod2/network.yml index ccf66a47..9e6365ee 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/network.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod2/network_dpdk.yml b/deploy/conf/hardware_environment/huawei-pod2/network_dpdk.yml index b357a6e1..40124467 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/network_dpdk.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod2/network_odl.yml b/deploy/conf/hardware_environment/huawei-pod2/network_odl.yml new file mode 100644 index 00000000..0941939a --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod2/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.168.11.10" + - "192.168.11.50" + cidr: "192.168.11.0/24" + gw: "192.168.11.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.168.11.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 10 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.168.11.1" + floating_ip_cidr: "192.168.11.0/24" + floating_ip_start: "192.168.11.100" + floating_ip_end: "192.168.11.200" diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-nosdn-stor4nfv-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-nosdn-stor4nfv-ha.yml new file mode 100644 index 00000000..f60c08e5 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod2/os-nosdn-stor4nfv-ha.yml @@ -0,0 +1,79 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- + +TYPE: baremetal +FLAVOR: cluster +POWER_TOOL: ipmitool + +ipmiVer: '2.0' + +plugins: + - stor4nfv: "Enable" + +hosts: + - name: host1 + mac: 'EC:38:8F:79:0C:2C' + ipmiUser: root + ipmiPass: Opnfv@pod2 + ipmiIp: 172.16.130.20 + interfaces: + - eth1: 'EC:38:8F:79:0C:2D' + roles: + - controller + - ha + - ceph-adm + - ceph-mon + + - name: host2 + mac: 'EC:38:8F:79:0C:48' + ipmiIp: 172.16.130.19 + ipmiUser: root + ipmiPass: Opnfv@pod2 + interfaces: + - eth1: 'EC:38:8F:79:0C:49' + roles: + - controller + - ha + - ceph-mon + + - name: host3 + mac: 'EC:38:8F:79:10:CC' + ipmiIp: 172.16.130.18 + ipmiUser: root + ipmiPass: Opnfv@pod2 + interfaces: + - eth1: 'EC:38:8F:79:10:CD' + roles: + - controller + - ha + - ceph-mon + + - name: host4 + mac: 'EC:38:8F:79:0C:6C' + ipmiIp: 172.16.130.17 + ipmiUser: root + ipmiPass: Opnfv@pod2 + interfaces: + - eth1: 'EC:38:8F:79:0C:6D' + roles: + - compute + - ceph-osd + + - name: host5 + mac: 'EC:38:8F:7A:E6:ED' + ipmiIp: 172.16.130.16 + ipmiUser: root + ipmiPass: Opnfv@pod2 + interfaces: + - eth1: 'EC:38:8F:7A:E6:EE' + roles: + - compute + - ceph-osd diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml index 5d8ed350..d96ab06d 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,8 @@ POWER_TOOL: ipmitool ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" plugins: - opendaylight: "Enable" diff --git a/deploy/conf/hardware_environment/huawei-pod4/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod4/os-odl_l3-nofeature-ha.yml index 46f7e791..b3ac36c6 100644 --- a/deploy/conf/hardware_environment/huawei-pod4/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod4/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,10 @@ POWER_TOOL: ipmitool ipmiUser: root ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod5/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod5/os-odl_l3-nofeature-ha.yml index 921fe81b..20d24cd0 100644 --- a/deploy/conf/hardware_environment/huawei-pod5/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod5/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,10 @@ POWER_TOOL: ipmitool ipmiUser: root ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod6/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod6/os-odl_l3-nofeature-ha.yml index 8710d420..55161bb4 100644 --- a/deploy/conf/hardware_environment/huawei-pod6/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod6/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,10 @@ POWER_TOOL: ipmitool ipmiUser: root ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod8/network-sriov.yml b/deploy/conf/hardware_environment/huawei-pod8/network-sriov.yml new file mode 100644 index 00000000..a256101b --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod8/network-sriov.yml @@ -0,0 +1,127 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# Copyright (C) 2018, ARM Limited and contributors. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-provider + network: physnet + interface: eth1 + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: sriov + interface: eth1 + type: normal + vlan_tag: 1401 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 1402 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: sriov + ip_ranges: + - - "172.16.1.2" + - "172.16.1.250" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "172.30.14.10" + - "172.30.14.50" + cidr: "172.30.14.0/24" + gw: "172.30.14.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 172.30.14.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 10 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "172.30.14.1" + floating_ip_cidr: "172.30.14.0/24" + floating_ip_start: "172.30.14.100" + floating_ip_end: "172.30.14.200" diff --git a/deploy/conf/hardware_environment/huawei-pod8/network.yml b/deploy/conf/hardware_environment/huawei-pod8/network.yml index 6a75f34d..d6b89d2b 100644 --- a/deploy/conf/hardware_environment/huawei-pod8/network.yml +++ b/deploy/conf/hardware_environment/huawei-pod8/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/intel-pod17/network.yml b/deploy/conf/hardware_environment/intel-pod17/network.yml index bb6f5130..a524c52d 100644 --- a/deploy/conf/hardware_environment/intel-pod17/network.yml +++ b/deploy/conf/hardware_environment/intel-pod17/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/intel-pod17/network_dpdk.yml b/deploy/conf/hardware_environment/intel-pod17/network_dpdk.yml index 7cc421e7..4b35483b 100644 --- a/deploy/conf/hardware_environment/intel-pod17/network_dpdk.yml +++ b/deploy/conf/hardware_environment/intel-pod17/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/network_cfg_dpdk.yaml b/deploy/conf/network_cfg_dpdk.yaml index e196d6f4..def5d308 100644 --- a/deploy/conf/network_cfg_dpdk.yaml +++ b/deploy/conf/network_cfg_dpdk.yaml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/network_cfg_sriov.yaml b/deploy/conf/network_cfg_sriov.yaml index fcde4c95..cb4d9b7f 100644 --- a/deploy/conf/network_cfg_sriov.yaml +++ b/deploy/conf/network_cfg_sriov.yaml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/virtual.conf b/deploy/conf/virtual.conf index dcee7d30..f49f0c6b 100644 --- a/deploy/conf/virtual.conf +++ b/deploy/conf/virtual.conf @@ -1,4 +1,3 @@ -export VIRT_NUMBER=${VIRT_NUMBER:-5} export VIRT_CPUS=${VIRT_CPUS:-8} export VIRT_MEM=${VIRT_MEM:-16384} export VIRT_DISK=${VIRT_DISK:-200G} diff --git a/deploy/conf/vm_environment/huawei-virtual1/network.yml b/deploy/conf/vm_environment/huawei-virtual1/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual1/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual1/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual1/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual1/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual1/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual1/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual1/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual1/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual1/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual2/network.yml b/deploy/conf/vm_environment/huawei-virtual2/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual2/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual2/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual2/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual2/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual2/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual2/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual2/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual2/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual2/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual3/network.yml b/deploy/conf/vm_environment/huawei-virtual3/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual3/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual3/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual3/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual3/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual3/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual3/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual3/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual3/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual3/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual4/network.yml b/deploy/conf/vm_environment/huawei-virtual4/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual4/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual4/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual4/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual4/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual4/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual4/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual4/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual4/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual4/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual5/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual5/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual5/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual7/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual7/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual7/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual8/network.yml b/deploy/conf/vm_environment/huawei-virtual8/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual8/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual8/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual8/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual8/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual8/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual8/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual8/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual8/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual8/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual9/network.yml b/deploy/conf/vm_environment/huawei-virtual9/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual9/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual9/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual9/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual9/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual9/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual9/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual9/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual9/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual9/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/k8-nosdn-onap-noha.yml b/deploy/conf/vm_environment/k8-nosdn-onap-noha.yml new file mode 100644 index 00000000..d7b85a85 --- /dev/null +++ b/deploy/conf/vm_environment/k8-nosdn-onap-noha.yml @@ -0,0 +1,46 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: virtual +FLAVOR: cluster + +plugins: + - onap: "Enable" + +hosts: + - name: host1 + roles: + - kube_master + - etcd + - ha + + - name: host2 + roles: + - kube_node + + - name: host3 + roles: + - kube_node + + - name: host4 + roles: + - kube_node + + - name: host5 + roles: + - kube_node + + - name: host6 + roles: + - kube_node + + - name: host7 + roles: + - kube_node diff --git a/deploy/conf/vm_environment/k8-ocl-nofeature-noha.yml b/deploy/conf/vm_environment/k8-ocl-nofeature-noha.yml new file mode 100644 index 00000000..fd7bfda0 --- /dev/null +++ b/deploy/conf/vm_environment/k8-ocl-nofeature-noha.yml @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: virtual +FLAVOR: cluster + +plugins: + - opencontrail: "Enable" + +hosts: + - name: host1 + roles: + - kube_master + - etcd + - opencontrail + - ha + + - name: host2 + roles: + - kube_node diff --git a/deploy/conf/vm_environment/network.yml b/deploy/conf/vm_environment/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/network.yml +++ b/deploy/conf/vm_environment/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/network_odl.yml b/deploy/conf/vm_environment/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/os-nosdn-stor4nfv-ha.yml b/deploy/conf/vm_environment/os-nosdn-stor4nfv-ha.yml new file mode 100644 index 00000000..1ef4bdd9 --- /dev/null +++ b/deploy/conf/vm_environment/os-nosdn-stor4nfv-ha.yml @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: virtual +FLAVOR: cluster + +plugins: + - stor4nfv: "Enable" + +hosts: + - name: host1 + roles: + - controller + - ha + - ceph-adm + - ceph-mon + + - name: host2 + roles: + - controller + - ha + - ceph-mon + + - name: host3 + roles: + - controller + - ha + - ceph-mon + + - name: host4 + roles: + - compute + - ceph-osd + + - name: host5 + roles: + - compute + - ceph-osd diff --git a/deploy/conf/vm_environment/os-nosdn-stor4nfv-noha.yml b/deploy/conf/vm_environment/os-nosdn-stor4nfv-noha.yml new file mode 100644 index 00000000..e03a4d4d --- /dev/null +++ b/deploy/conf/vm_environment/os-nosdn-stor4nfv-noha.yml @@ -0,0 +1,28 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: virtual +FLAVOR: cluster + +plugins: + - stor4nfv: "Enable" + +hosts: + - name: host1 + roles: + - controller + - ha + - ceph-adm + - ceph-mon + + - name: host2 + roles: + - compute + - ceph-osd diff --git a/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml b/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml index fb530012..1517fffc 100644 --- a/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml @@ -11,7 +11,8 @@ TYPE: virtual FLAVOR: cluster -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" plugins: - opendaylight: "Enable" diff --git a/deploy/conf/vm_environment/os-odl_l3-nofeature-noha.yml b/deploy/conf/vm_environment/os-odl_l3-nofeature-noha.yml index 6e3c0a94..e6491afe 100644 --- a/deploy/conf/vm_environment/os-odl_l3-nofeature-noha.yml +++ b/deploy/conf/vm_environment/os-odl_l3-nofeature-noha.yml @@ -11,7 +11,8 @@ TYPE: virtual FLAVOR: cluster -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" plugins: - opendaylight: "Enable" diff --git a/deploy/config_parse.py b/deploy/config_parse.py index ceaab0f5..88a31e9a 100644 --- a/deploy/config_parse.py +++ b/deploy/config_parse.py @@ -11,27 +11,44 @@ import os import netaddr import yaml import sys +import random from Cheetah.Template import Template -def init(file): +def load_yaml(file): with open(file) as fd: return yaml.safe_load(fd) -def export_env_dict(env_dict, ofile, direct=False): - if not os.path.exists(ofile): - raise IOError("output file: %s not exist" % ofile) +def dump_yaml(data, file): + with open(file, "w") as fd: + yaml.safe_dump(data, fd, default_flow_style=False) + + +def mac_generator(): + def random_hex(): + return random.choice("0123456789ABCDEF") + mac = "00:00" + for i in xrange(4): + mac += ":{0}{1}".format(random_hex(), random_hex()) + return mac + + +def export_env_dict(env_dict, output_path, direct=False): + if not os.path.exists(output_path): + raise IOError("output file: %s not exist" % output_path) if direct: for k, v in env_dict.items(): - os.system("echo 'export %s=\"%s\"' >> %s" % (k, v, ofile)) + os.system("echo 'export %s=\"%s\"' >> %s" % + (k, v, output_path)) else: for k, v in env_dict.items(): - os.system("echo 'export %s=${%s:-%s}' >> %s" % (k, k, v, ofile)) + os.system("echo 'export %s=${%s:-%s}' >> %s" % + (k, k, v, output_path)) def decorator(func): - def wrapter(s, seq): + def wrapter(s, seq=None): host_list = s.get('hosts', []) result = [] for host in host_list: @@ -41,8 +58,10 @@ def decorator(func): result.append(s) if len(result) == 0: return "" - else: + elif seq: return "\"" + seq.join(result) + "\"" + else: + return result return wrapter @@ -57,11 +76,15 @@ def hostroles(s, seq, host=None): @decorator -def hostmacs(s, seq, host=None): - return host.get('mac', '') +def hostmachines(s, seq, host=None): + return {'mac': host.get('interfaces', {}), + 'power_type': host.get('power_type', ''), + 'power_ip': host.get('power_ip', ''), + 'power_user': host.get('power_user', ''), + 'power_pass': host.get('power_pass', '')} -def export_network_file(dha, network, ofile): +def export_network_file(dha, network, output_path): install_network_env = {} host_network_env = {} ip_settings = network['ip_settings'] @@ -79,7 +102,7 @@ def export_network_file(dha, network, ofile): install_network_env.update({'INSTALL_NETMASK': mgmt_netmask}) install_network_env.update({'INSTALL_IP_RANGE': dhcp_ip_range}) install_network_env.update({'VIP': internal_vip}) - export_env_dict(install_network_env, ofile) + export_env_dict(install_network_env, output_path) pxe_nic = os.environ['PXE_NIC'] host_ip_range = mgmt_net['ip_ranges'][0] @@ -94,10 +117,10 @@ def export_network_file(dha, network, ofile): host_network_env.update({'NETWORK_MAPPING': "install=" + pxe_nic}) host_network_env.update({'HOST_NETWORKS': ';'.join(host_networks)}) host_network_env.update({'SUBNETS': ','.join(host_subnets)}) - export_env_dict(host_network_env, ofile, True) + export_env_dict(host_network_env, output_path, True) -def export_dha_file(dha, dha_file, ofile): +def export_dha_file(dha, output_path, machine_path): env = {} env.update(dha) if env.get('hosts', []): @@ -109,21 +132,40 @@ def export_dha_file(dha, dha_file, ofile): plugin_list.append(plugin_str) env.update({'plugins': ','.join(plugin_list)}) + if 'cluster_param' in env: + plugin_list = [] + for item in env.get('cluster_param'): + plugin_str = ':'.join([item.keys()[0], item.values()[0]]) + plugin_list.append(plugin_str) + env.update({'cluster_param': ','.join(plugin_list)}) + env.update({'CLUSTER_NAME': dha.get('NAME', "opnfv")}) env.update({'TYPE': dha.get('TYPE', "virtual")}) env.update({'FLAVOR': dha.get('FLAVOR', "cluster")}) env.update({'HOSTNAMES': hostnames(dha, ',')}) env.update({'HOST_ROLES': hostroles(dha, ';')}) - env.update({'DHA': dha_file}) - value = hostmacs(dha, ',') - if len(value) > 0: - env.update({'HOST_MACS': value}) + machine = [] + if dha.get('TYPE') == "virtual": + virtual_mac = [] + for host in dha.get('hosts'): + mac = mac_generator() + machine.append({"mac": {"eth0": mac}, "power_type": "libvirt"}) + virtual_mac.append(mac) + env.update({'HOST_MACS': ",".join(virtual_mac)}) + else: + value = hostmachines(dha) + for item in value: + machine.append(item) + dump_yaml(machine, machine_path) + + if dha.get('TYPE', "virtual") == "virtual": + env.update({'VIRT_NUMBER': len(dha['hosts'])}) - export_env_dict(env, ofile) + export_env_dict(env, output_path) -def export_reset_file(dha, tmpl_dir, output_dir, ofile): +def export_reset_file(dha, tmpl_dir, output_dir, output_path): tmpl_file_name = dha.get('POWER_TOOL', '') if not tmpl_file_name: return @@ -141,28 +183,31 @@ def export_reset_file(dha, tmpl_dir, output_dir, ofile): f.write(tmpl.respond()) power_manage_env = {'POWER_MANAGE': reset_file_name} - export_env_dict(power_manage_env, ofile, True) + export_env_dict(power_manage_env, output_path, True) if __name__ == "__main__": - if len(sys.argv) != 6: - print("parameter wrong%d %s" % (len(sys.argv), sys.argv)) + if len(sys.argv) != 7: + print("parameter wrong %d %s" % (len(sys.argv), sys.argv)) sys.exit(1) - _, dha_file, network_file, tmpl_dir, output_dir, output_file = sys.argv + _, dha_file, network_file, tmpl_dir, output_dir, output_file,\ + machine_file = sys.argv if not os.path.exists(dha_file): print("%s is not exist" % dha_file) sys.exit(1) - ofile = os.path.join(output_dir, output_file) - os.system("touch %s" % ofile) - os.system("echo \#config file deployment parameter > %s" % ofile) + output_path = os.path.join(output_dir, output_file) + machine_path = os.path.join(output_dir, machine_file) + os.system("touch %s" % output_path) + os.system("echo \#config file deployment parameter > %s" % output_path) + os.system("touch %s" % machine_path) - dha_data = init(dha_file) - network_data = init(network_file) + dha_data = load_yaml(dha_file) + network_data = load_yaml(network_file) - export_dha_file(dha_data, dha_file, ofile) - export_network_file(dha_data, network_data, ofile) - export_reset_file(dha_data, tmpl_dir, output_dir, ofile) + export_dha_file(dha_data, output_path, machine_path) + export_network_file(dha_data, network_data, output_path) + export_reset_file(dha_data, tmpl_dir, output_dir, output_path) sys.exit(0) diff --git a/deploy/deploy_host.sh b/deploy/deploy_host.sh index 512386e5..7a7b5dd5 100755 --- a/deploy/deploy_host.sh +++ b/deploy/deploy_host.sh @@ -43,13 +43,14 @@ function deploy_host(){ --console_credentials="${CONSOLE_CREDENTIALS}" --host_networks="${HOST_NETWORKS}" \ --network_mapping="${NETWORK_MAPPING}" --package_config_json_file="${PACKAGE_CONFIG_FILENAME}" \ --host_roles="${HOST_ROLES}" --default_roles="${DEFAULT_ROLES}" --switch_ips="${SWITCH_IPS}" \ - --machines=${machines//\'} --switch_credential="${SWITCH_CREDENTIAL}" --deploy_type="${TYPE}" \ + --machine_file=${machine_file} --switch_credential="${SWITCH_CREDENTIAL}" --deploy_type="${TYPE}" \ --deployment_timeout="${DEPLOYMENT_TIMEOUT}" --${POLL_SWITCHES_FLAG} --dashboard_url="${DASHBOARD_URL}" \ --cluster_vip="${VIP}" --network_cfg="$NETWORK" --neutron_cfg="$NEUTRON" \ --enable_secgroup="${ENABLE_SECGROUP}" --enable_fwaas="${ENABLE_FWAAS}" --expansion="${EXPANSION}" \ --rsa_file="$rsa_file" --enable_vpnaas="${ENABLE_VPNAAS}" --odl_l3_agent="${odl_l3_agent}" \ - --moon_cfg="${MOON_CFG}" --onos_sfc="${onos_sfc}" --plugins="$plugins" \ - --offline_repo_port="${COMPASS_REPO_PORT}" --offline_deployment="${OFFLINE_DEPLOY}" + --moon_cfg="${MOON_CFG}" --onos_sfc="${onos_sfc}" --plugins="${plugins}" \ + --cluster_param="${cluster_param}" --offline_repo_port="${COMPASS_REPO_PORT}" \ + --offline_deployment="${OFFLINE_DEPLOY}" RET=$? sleep $((AYNC_TIMEOUT+5)) diff --git a/deploy/deploy_parameter.sh b/deploy/deploy_parameter.sh index 78223fcd..d45d4171 100755 --- a/deploy/deploy_parameter.sh +++ b/deploy/deploy_parameter.sh @@ -100,7 +100,7 @@ function process_default_para() "$DHA" "$NETWORK" \ "${COMPASS_DIR}/deploy/template" \ "${WORK_DIR}/script" \ - "deploy_config.sh" + "deploy_config.sh" machine echo ${WORK_DIR}/script/deploy_config.sh } diff --git a/deploy/host_baremetal.sh b/deploy/host_baremetal.sh index 4c63f823..3c303567 100755 --- a/deploy/host_baremetal.sh +++ b/deploy/host_baremetal.sh @@ -15,14 +15,6 @@ function reboot_hosts() { } function get_host_macs() { - if [[ "$EXPANSION" == "false" ]]; then - machines=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` - echo $machines > $WORK_DIR/switch_machines - else - machines_old=`cat $WORK_DIR/switch_machines` - machines_add=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` - echo $machines_add $machines_old > $WORK_DIR/switch_machines - machines=`echo $machines_add $machines_old|sed 's/ /,/g'` - fi + local machines=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` echo $machines } diff --git a/deploy/host_virtual.sh b/deploy/host_virtual.sh index d955b747..c3133cf6 100755 --- a/deploy/host_virtual.sh +++ b/deploy/host_virtual.sh @@ -25,20 +25,21 @@ function tear_down_machines() { } function reboot_hosts() { + echo "reboot" # We do need it for aarch64 - if [ "$COMPASS_ARCH" = "aarch64" ]; then - old_ifs=$IFS - IFS=, - for i in $HOSTNAMES; do - sudo virsh destroy $i - sleep 3 - sudo virsh start $i - sleep 3 - done - IFS=$old_ifs - else - log_warn "reboot_hosts do nothing" - fi +# if [ "$COMPASS_ARCH" = "aarch64" ]; then +# old_ifs=$IFS +# IFS=, +# for i in $HOSTNAMES; do +# sudo virsh destroy $i +# sleep 3 +# sudo virsh start $i +# sleep 3 +# done +# IFS=$old_ifs +# else +# log_warn "reboot_hosts do nothing" +# fi } function launch_host_vms() { @@ -97,37 +98,7 @@ function recover_host_vms() { } function get_host_macs() { - local mac_generator=${COMPASS_DIR}/deploy/mac_generator.sh - local machines= - - if [[ $REDEPLOY_HOST == "true" ]]; then - mac_array=`cat $WORK_DIR/switch_machines` - machines=`echo $mac_array|sed 's/ /,/g'` - else - if [[ -z $HOST_MACS ]]; then - if [[ "$EXPANSION" == "false" ]]; then - chmod +x $mac_generator - mac_array=`$mac_generator $VIRT_NUMBER` - echo $mac_array > $WORK_DIR/switch_machines - machines=`echo $mac_array|sed 's/ /,/g'` - else - machines_old=`cat $WORK_DIR/switch_machines` - chmod +x $mac_generator - machines_add=`$mac_generator $VIRT_NUMBER` - echo $machines_add $machines_old > $WORK_DIR/switch_machines - machines=`echo $machines_add $machines_old|sed 's/ /,/g'` - fi - else - if [[ "$EXPANSION" == "false" ]]; then - machines=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` - else - machines_old=`cat $WORK_DIR/switch_machines` - machines_add=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` - echo $machines_add $machines_old > $WORK_DIR/switch_machines - machines=`echo $machines_add $machines_old|sed 's/ /,/g'` - fi - fi - fi + local machines=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` echo $machines } diff --git a/deploy/launch.sh b/deploy/launch.sh index 76e8f254..b11127ca 100755 --- a/deploy/launch.sh +++ b/deploy/launch.sh @@ -53,6 +53,7 @@ if [[ "$EXPANSION" == "false" ]]; then exit 1 fi + export machine_file=$WORK_DIR/script/machine export machines CONTAINER_ALIVE=$(check_container_alive) @@ -90,6 +91,13 @@ else log_info "deploy host macs: $machines" fi +if [[ "$DEPLOY_HARBOR" == "true" ]]; then + if ! launch_harbor;then + log_error "launch_harbor failed" + exit 1 + fi +fi + if [[ "$REDEPLOY_HOST" != "true" ]]; then if ! set_compass_machine; then log_error "set_compass_machine fail" diff --git a/deploy/network.sh b/deploy/network.sh index eea62277..b74a1b40 100755 --- a/deploy/network.sh +++ b/deploy/network.sh @@ -10,6 +10,10 @@ function clear_forward_rejct_rules() { while sudo iptables -nL FORWARD --line-number|grep -E 'REJECT +all +-- +0.0.0.0/0 +0.0.0.0/0 +reject-with icmp-port-unreachable'|head -1|awk '{print $1}'|xargs sudo iptables -D FORWARD; do :; done + ip_forward=$(cat /proc/sys/net/ipv4/ip_forward) + if [ $ip_forward -eq 0 ]; then + sysctl -w net.ipv4.ip_forward=1 + fi } function setup_bridge_net() @@ -143,7 +147,8 @@ function setup_baremetal_net() { exit 1 fi sudo ifconfig $INSTALL_NIC up - sudo ifconfig $INSTALL_NIC $INSTALL_GW + sudo ifconfig $INSTALL_NIC promisc + sudo ifconfig $INSTALL_NIC $INSTALL_GW netmask $INSTALL_NETMASK } function recover_baremetal_net() { diff --git a/deploy/opera_adapter.py b/deploy/opera_adapter.py deleted file mode 100644 index fbf1b662..00000000 --- a/deploy/opera_adapter.py +++ /dev/null @@ -1,126 +0,0 @@ -############################################################################## -# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -import os -import sys -import yaml -import re -import subprocess -import traceback - - -def load_file(file): - with open(file) as fd: - try: - return yaml.safe_load(fd) - except: - traceback.print_exc() - return None - - -def dump_file(data, file): - with open(file, 'w') as fd: - try: - return yaml.dump(data, fd, default_flow_style=False) - except: - traceback.print_exc() - return None - - -def sync_openo_config(openo_config, dha, network): - """sync opera/conf/open-o.yml according to DHA and Network file""" - deploy_opts = dha.get('deploy_options') - openo_net = network.get('openo_net') - if deploy_opts['orchestrator']['type'] != 'open-o': - print("orchestrator is not openo") - sys.exit(1) - - openo_config['openo_version'] = deploy_opts['orchestrator']['version'] - openo_config['vnf_type'] = deploy_opts['vnf']['type'] - openo_config['openo_net']['openo_ip'] = openo_net['openo_ip'] - - -def sync_admin_openrc(network, admin_openrc_file): - ssh_opts = "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - vip = network['public_vip']['ip'] - cmd = 'sshpass -p"root" ssh %s root@%s "cat /opt/admin-openrc.sh"' \ - % (ssh_opts, vip) - ssh = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - if ssh.stdout is None: - print("fetch openrc fail") - sys.exit(1) - - rcdata = ssh.stdout.readlines() - with open(admin_openrc_file, 'w') as fd: - ip = re.compile("\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}") - for i in rcdata: - if 'OS_AUTH_URL' in i: - i = re.sub(ip, vip, i) - fd.write(i) - - fd.write('export OS_REGION_NAME=RegionOne') - - -if __name__ == "__main__": - if len(sys.argv) != 3: - print("parameter wrong%d %s" % (len(sys.argv), sys.argv)) - sys.exit(1) - - _, dha_file, network_file = sys.argv - compass_dir = os.getenv('COMPASS_DIR') - - if not compass_dir: - print("env var COMPASS_DIR doesn't exist") - sys.exit(1) - - if not os.path.exists(dha_file): - print("DHA file doesn't exist") - sys.exit(1) - if not os.path.exists(network_file): - print("NETWORK file doesn't exist") - sys.exit(1) - - dha = load_file(dha_file) - network = load_file(network_file) - - if not dha: - print('format error in DHA: %s' % dha_file) - sys.exit(1) - if not network: - print('format error in NETWORK: %s' % network_file) - sys.exit(1) - - work_dir = os.path.join(compass_dir, 'work') - opera_dir = os.path.join(work_dir, 'opera') - conf_dir = os.path.join(opera_dir, 'conf') - openo_config_file = os.path.join(conf_dir, 'open-o.yml') - admin_openrc_file = os.path.join(conf_dir, 'admin-openrc.sh') - - p1 = subprocess.Popen( - "git clone https://gerrit.opnfv.org/gerrit/opera", - cwd=work_dir, shell=True) - p1.communicate() - - if not os.path.exists(openo_config_file): - print('file opera/conf/open-o.yml not found') - sys.exit(1) - if not os.path.exists(admin_openrc_file): - print('file opera/conf/admin-openrc.sh not found') - sys.exit(1) - - openo_config = load_file(openo_config_file) - sync_openo_config(openo_config, dha, network) - dump_file(openo_config, openo_config_file) - sync_admin_openrc(network, admin_openrc_file) - - p2 = subprocess.Popen("./opera_launch.sh", cwd=opera_dir, shell=True) - p2.communicate() - if p2.returncode != 0: - print('./opera_launch.sh fail') - sys.exit(1) diff --git a/deploy/prepare.sh b/deploy/prepare.sh index c0a05564..f11ae74c 100755 --- a/deploy/prepare.sh +++ b/deploy/prepare.sh @@ -48,7 +48,14 @@ function extract_tar() function prepare_env() { sudo sed -i -e 's/^#user =.*/user = "root"/g' /etc/libvirt/qemu.conf sudo sed -i -e 's/^#group =.*/group = "root"/g' /etc/libvirt/qemu.conf + sudo sed -i 's/^.\?listen_tls.*/listen_tls = 0/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?listen_tcp.*/listen_tcp = 1/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?tcp_port.*/tcp_port = "16509"/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?listen_addr.*/listen_addr = "0.0.0.0"/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?auth_tcp.*/auth_tcp = "none"/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?libvirtd_opts.*/libvirtd_opts="-d -l"/g' /etc/default/libvirt-bin sudo service libvirt-bin restart + if sudo service openvswitch-switch status|grep stop; then sudo service openvswitch-switch start fi @@ -89,7 +96,7 @@ function _prepare_python_env() { sudo apt-get install -y --force-yes libxslt-dev libxml2-dev libvirt-dev build-essential qemu-utils qemu-kvm libvirt-bin virtinst libmysqld-dev sudo apt-get install -y --force-yes libffi-dev libssl-dev else - sudo yum install -y centos-release-openstack-pike + sudo yum install -y centos-release-openstack-queens sudo yum install -y epel-release sudo yum install openvswitch -y --nogpgcheck sudo yum install -y git python-devel python-pip figlet sshpass mkisofs bc curl ipmitool diff --git a/docs/release/installation/configure-network.rst b/docs/release/installation/configure-network.rst index 2303be45..25dfb76d 100644 --- a/docs/release/installation/configure-network.rst +++ b/docs/release/installation/configure-network.rst @@ -1,3 +1,6 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International Licence. +.. http://creativecommons.org/licenses/by/4.0 + Configure network ================= network_cfg.yaml file describes networks configuration for openstack on hosts. It diff --git a/docs/release/installation/featureTable.rst b/docs/release/installation/featureTable.rst index 2cd74a2b..c810a072 100644 --- a/docs/release/installation/featureTable.rst +++ b/docs/release/installation/featureTable.rst @@ -1,54 +1,57 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International Licence. +.. http://creativecommons.org/licenses/by/4.0 + Features ======== Supported Openstack Version and OS ---------------------------------- -+---------------+----------+-----------+-----------+-----------+-----------+ -| | OS | OpenStack | OpenStack | OpenStack | OpenStack | -| | only | Liberty | Mitaka | Newton | Ocata | -+---------------+----------+-----------+-----------+-----------+-----------+ -| CentOS 7 | yes | yes | yes | yes | no | -+---------------+----------+-----------+-----------+-----------+-----------+ -| Ubuntu trusty | yes | yes | yes | no | no | -+---------------+----------+-----------+-----------+-----------+-----------+ -| Ubuntu xenial | yes | no | yes | yes | yes | -+---------------+----------+-----------+-----------+-----------+-----------+ ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ +| | OS | OpenStack | OpenStack | OpenStack | OpenStack | OpenStack | +| | only | Liberty | Mitaka | Newton | Ocata | Pike | ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ +| CentOS 7 | yes | yes | yes | yes | no | yes | ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ +| Ubuntu trusty | yes | yes | yes | no | no | no | ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ +| Ubuntu xenial | yes | no | yes | yes | yes | yes | ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ Supported Openstack Flavor and Features --------------------------------------- -+---------------+--------------+--------------+---------------+---------------+ -| | OpenStack | OpenStack | OpenStack | OpenStack | -| | Liberty | Mitaka | Newton | Ocata | -+---------------+--------------+--------------+---------------+---------------+ -| Virtual | Yes | Yes | Yes | Yes | -| Deployment | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Baremetal | Yes | Yes | Yes | Yes | -| Deployment | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| HA | Yes | Yes | Yes | Yes | -| | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Ceph | Yes | Yes | Yes | Yes | -| | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| SDN | Yes | Yes | Yes | Yes* | -| ODL/ONOS | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Compute Node | Yes | Yes | Yes | No | -| Expansion | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Multi-Nic | Yes | Yes | Yes | Yes | -| Support | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Boot | Yes | Yes | Yes | Yes | -| Recovery | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| SFC | No | No | Yes | Yes | -| | | | | | -+---------------+--------------+--------------+---------------+---------------+ ++---------------+--------------+--------------+---------------+---------------+---------------+ +| | OpenStack | OpenStack | OpenStack | OpenStack | OpenStack | +| | Liberty | Mitaka | Newton | Ocata | Pike | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Virtual | Yes | Yes | Yes | Yes | Yes | +| Deployment | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Baremetal | Yes | Yes | Yes | Yes | Yes | +| Deployment | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| HA | Yes | Yes | Yes | Yes | Yes | +| | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Ceph | Yes | Yes | Yes | Yes | Yes | +| | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| SDN | Yes | Yes | Yes | Yes* | Yes* | +| ODL/ONOS | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Compute Node | Yes | Yes | Yes | No | No | +| Expansion | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Multi-Nic | Yes | Yes | Yes | Yes | Yes | +| Support | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Boot | Yes | Yes | Yes | Yes | Yes | +| Recovery | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| SFC | No | No | Yes | Yes | Yes | +| | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ * ONOS will not be supported in this release. diff --git a/docs/release/installation/installation.rst b/docs/release/installation/installation.rst index 05c5e2ef..2fb51641 100644 --- a/docs/release/installation/installation.rst +++ b/docs/release/installation/installation.rst @@ -6,7 +6,7 @@ Compass4nfv configuration ========================= This document describes providing guidelines on how to install and -configure the Euphrates release of OPNFV when using Compass4nfv as a +configure the Fraser release of OPNFV when using Compass4nfv as a deployment tool including required software and hardware configurations. @@ -21,7 +21,7 @@ networking and Unix/Linux administration. Preconditions ------------- -Before starting the installation of the Euphrates release of OPNFV, +Before starting the installation of the Fraser release of OPNFV, some planning must be done. @@ -37,10 +37,10 @@ The daily build tarball can be retrieved via OPNFV artifacts repository: http://artifacts.opnfv.org/compass4nfv.html -NOTE: Search the keyword "compass4nfv/Euphrates" to locate the ISO image. +NOTE: Search the keyword "compass4nfv/Fraser" to locate the ISO image. E.g. -compass4nfv/Euphrates/opnfv-2017-09-18_08-15-13.tar.gz +compass4nfv/Fraser/opnfv-2017-09-18_08-15-13.tar.gz The name of tarball includes the time of iso building, you can get the daily ISO according the building time. @@ -57,9 +57,9 @@ To retrieve the repository of Compass4nfv on Jumphost use the following command: NOTE: PLEASE DO NOT GIT CLONE COMPASS4NFV IN ROOT DIRECTORY(INCLUDE SUBFOLDERS). -To get stable /Euphrates release, you can use the following command: +To get stable /Fraser release, you can use the following command: -- git checkout Euphrates.1.0 +- git checkout Fraser.1.0 Setup Requirements ------------------ diff --git a/docs/release/installation/introduction.rst b/docs/release/installation/introduction.rst index 6ffc3d17..5f0b0b28 100644 --- a/docs/release/installation/introduction.rst +++ b/docs/release/installation/introduction.rst @@ -5,7 +5,7 @@ Abstract ======== -This document describes how to install the Euphrates release of OPNFV when +This document describes how to install the Fraser release of OPNFV when using Compass4nfv as a deployment tool covering it's limitations, dependencies and required system resources. diff --git a/docs/release/installation/k8s-deploy-arm.rst b/docs/release/installation/k8s-deploy-arm.rst index b5b54c20..8c809bf6 100644 --- a/docs/release/installation/k8s-deploy-arm.rst +++ b/docs/release/installation/k8s-deploy-arm.rst @@ -5,19 +5,15 @@ Validated platform ================== -================ ========= ================ ======== - Jump server Node ---------------------------- -------------------------- -distro libvirt distro k8s -================ ========= ================ ======== -ubuntu 16.04.3 1.3.1 centos7 1708 1.7.5 -================ ========= ================ ======== +Jump server: Baremetal, Ubuntu 16.04 + +Node: VM / Baremetal, CentOS 7 / Ubuntu 16.04, K8s 1.9.1 Prepare jump server =================== -This document assumes you are using a baremetal Arm server as Compass4NFV jump server. It's possible to deploy jump server inside a virtual machine, this case is not covered here. +A baremetal Arm server is required as Compass4NFV jump server. -#. Install Ubuntu 16.04.3 aarch64 on jump server. +#. Install Ubuntu 16.04 aarch64 on jump server. #. Install required packages. @@ -65,14 +61,14 @@ Clone Compass4NFV code. Run below command to build deployment tarball for Arm. .. code-block:: bash - $ COMPASS_ISO_REPO='http://people.linaro.org/~yibo.cai/compass' ./build.sh + $ ./build.sh It downloads and archives Ubuntu/CentOS installation ISO and Compass core docker images for later deployment. -Deploy K8s in VM -================ -This section introduces the steps to deploy K8s cluster in virtual machines running on jump server. Two VM nodes will be created, one master and one minion, with flannel networking. +Deploy K8s +========== +This section introduces the steps to deploy K8s cluster in VM and baremetal nodes. Clear old Compass core ---------------------- @@ -93,14 +89,28 @@ Run below command to remove running Compass containers for a clean deployment. Deploy OS and K8s ----------------- -To deploy OS and K8s on two virtual nodes, run: +To deploy CentOS and K8s on two virtual nodes, run: .. code-block:: bash $ ADAPTER_OS_PATTERN='(?i)CentOS-7.*arm.*' \ OS_VERSION=centos7 \ - KUBERNETES_VERSION=v1.7.5 \ - DHA=${PWD}/deploy/conf/vm_environment/k8-nosdn-nofeature-noha.yml \ - NETWORK=${PWD}/deploy/conf/vm_environment/network.yml \ + KUBERNETES_VERSION=v1.9.1 \ + DHA=deploy/conf/vm_environment/k8-nosdn-nofeature-noha.yml \ + NETWORK=deploy/conf/vm_environment/network.yml \ VIRT_NUMBER=2 VIRT_CPUS=4 VIRT_MEM=8192 VIRT_DISK=50G \ ./deploy.sh + +To deploy on baremetal nodes, reference below DHA and NETWORK files: + +.. code-block:: bash + + DHA="deploy/conf/hardware_environment/huawei-pod8/k8-nosdn-nofeature-noha.yml" + NETWORK="deploy/conf/hardware_environment/huawei-pod8/network.yml" + +To deploy Ubuntu, set: + +.. code-block:: bash + + ADAPTER_OS_PATTERN='(?i)ubuntu-16.*arm.*' + OS_VERSION=xenial diff --git a/docs/release/installation/k8s-deploy.rst b/docs/release/installation/k8s-deploy.rst index 49025ee3..0c1ffbd0 100644 --- a/docs/release/installation/k8s-deploy.rst +++ b/docs/release/installation/k8s-deploy.rst @@ -20,7 +20,7 @@ If you want to deploy noha with1 controller and 1 compute, run the following com export SCENARIO=k8-nosdn-nofeature-noha.yml export VIRT_NUMBER=2 - curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/euphrates/quickstart_k8s.sh | bash + curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/fraser/quickstart_k8s.sh | bash Installation of K8s on Bare Metal ================================= diff --git a/docs/release/installation/offline-deploy.rst b/docs/release/installation/offline-deploy.rst index d35d7e1b..a3a33a09 100644 --- a/docs/release/installation/offline-deploy.rst +++ b/docs/release/installation/offline-deploy.rst @@ -1,3 +1,5 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International Licence. +.. http://creativecommons.org/licenses/by/4.0 .. two dots create a comment. please leave this logo at the top of each of your rst files. Offline Deploy diff --git a/docs/release/installation/preconditions.rst b/docs/release/installation/preconditions.rst index 3ba42ab6..9264c793 100644 --- a/docs/release/installation/preconditions.rst +++ b/docs/release/installation/preconditions.rst @@ -21,7 +21,7 @@ networking and Unix/Linux administration. Preconditions ------------- -Before starting the installation of the Euphrates release of OPNFV, +Before starting the installation of the Fraser release of OPNFV, some planning must be done. @@ -38,10 +38,10 @@ The daily build tarball can be retrieved via OPNFV artifacts repository: http://artifacts.opnfv.org/compass4nfv.html -NOTE: Search the keyword "compass4nfv/Euphrates" to locate the tarball. +NOTE: Search the keyword "compass4nfv/Fraser" to locate the tarball. E.g. -compass4nfv/euphrates/opnfv-2017-03-29_08-55-09.tar.gz +compass4nfv/fraser/opnfv-2017-03-29_08-55-09.tar.gz The name of tarball includes the time of tarball building, you can get the daily tarball according the building time. @@ -58,9 +58,9 @@ To retrieve the repository of Compass4nfv on Jumphost use the following command: NOTE: PLEASE DO NOT GIT CLONE COMPASS4NFV IN ROOT DIRECTORY(INCLUDE SUBFOLDERS). -To get stable/euphrates release, you can use the following command: +To get stable/fraser release, you can use the following command: -- git checkout Euphrates.1.0 +- git checkout Fraser.1.0 Setup Requirements ------------------ diff --git a/docs/release/installation/vmdeploy.rst b/docs/release/installation/vmdeploy.rst index 5db934be..4f1336c5 100644 --- a/docs/release/installation/vmdeploy.rst +++ b/docs/release/installation/vmdeploy.rst @@ -12,15 +12,14 @@ Only 1 command to try virtual deployment, if you have Internet access. Just Past .. code-block:: bash - curl https://raw.githubusercontent.com/opnfv/compass4nfv/euphrates/quickstart.sh | bash + curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/fraser/quickstart.sh | bash If you want to deploy noha with1 controller and 1 compute, run the following command .. code-block:: bash export SCENARIO=os-nosdn-nofeature-noha.yml - export VIRT_NUMBER=2 - curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/euphrates/quickstart.sh | bash + curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/fraser/quickstart.sh | bash Nodes Configuration (Virtual Deployment) ---------------------------------------- @@ -28,8 +27,6 @@ Nodes Configuration (Virtual Deployment) virtual machine setting ~~~~~~~~~~~~~~~~~~~~~~~ - - VIRT_NUMBER -- the number of nodes for virtual deployment. - - VIRT_CPUS -- the number of CPUs allocated per virtual machine. - VIRT_MEM -- the memory size(MB) allocated per virtual machine. @@ -38,7 +35,6 @@ virtual machine setting .. code-block:: bash - export VIRT_NUMBER=${VIRT_NUMBER:-5} export VIRT_CPUS=${VIRT_CPU:-4} export VIRT_MEM=${VIRT_MEM:-16384} export VIRT_DISK=${VIRT_DISK:-200G} @@ -146,7 +142,7 @@ Start Deployment (Virtual Deployment) 1. Edit deploy.sh 1.1. Set OS version for deployment nodes. - Compass4nfv supports ubuntu and centos based openstack ocata. + Compass4nfv supports ubuntu and centos based openstack pike. E.g. diff --git a/docs/release/release-notes/release-notes.rst b/docs/release/release-notes/release-notes.rst index 73825062..b6096568 100644 --- a/docs/release/release-notes/release-notes.rst +++ b/docs/release/release-notes/release-notes.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Weidong Shao (HUAWEI) and Justin Chi (HUAWEI) -Release Note for the Euphrates release of OPNFV when using Compass4nfv as a deployment tool. +Release Note for the Fraser release of OPNFV when using Compass4nfv as a deployment tool. Abstract ======== @@ -25,16 +25,16 @@ Release Data | **Project** | Compass4nfv | | | | +--------------------------------------+--------------------------------------+ -| **Repo/tag** | Compass4nfv/Euphrates.1.0 | +| **Repo/tag** | Compass4nfv/Fraser.1.0 | | | | +--------------------------------------+--------------------------------------+ -| **Release designation** | Euphrates.1.0 | +| **Release designation** | Fraser.1.0 | | | | +--------------------------------------+--------------------------------------+ -| **Release date** | October 2017 | +| **Release date** | March 2018 | | | | +--------------------------------------+--------------------------------------+ -| **Purpose of the delivery** | OPNFV Euphrates release | +| **Purpose of the delivery** | OPNFV Fraser release | | | | +--------------------------------------+--------------------------------------+ @@ -44,16 +44,16 @@ Deliverables Software deliverables ~~~~~~~~~~~~~~~~~~~~~ - - Compass4nfv/Euphrates.1.0 tarball, please get it from `OPNFV software download page <https://www.opnfv.org/software/>`_ + - Compass4nfv/Fraser.1.0 tarball, please get it from `OPNFV software download page <https://www.opnfv.org/software/>`_ .. _document-label: Documentation deliverables ~~~~~~~~~~~~~~~~~~~~~~~~~~ - - OPNFV(Euphrates) Compass4nfv installation instructions + - OPNFV(Fraser) Compass4nfv installation instructions - - OPNFV(Euphrates) Compass4nfv Release Notes + - OPNFV(Fraser) Compass4nfv Release Notes Version change -------------- @@ -62,16 +62,16 @@ Version change Module version change ~~~~~~~~~~~~~~~~~~~~~ -This is the Euphrates release of compass4nfv as a deployment toolchain in OPNFV, the following +This is the Fraser release of compass4nfv as a deployment toolchain in OPNFV, the following upstream components supported with this release. - - Ubuntu 16.04/Centos 7.3 + - Ubuntu 16.04.3/Centos 7.4 - - Openstack (Ocata release) + - Openstack (Pike release) - - Kubernates (1.7.3) + - Kubernates (1.9) - - Opendaylight (Nitrogen release) + - Opendaylight (Nitrogen SR1 release) Reason for new version @@ -135,27 +135,15 @@ System Limitations Scenario Limitations -------------------- -**ODL SFC:** In the Euphrates1.0, Compass doesn't integrate OpenStack Tacker -Project yet. However, the SFC related test cases in Functest always use Tacker -as NFVO to delivery VNFFG or SFC related requests to ODL via networking-sfc. -So the odl-sfc scenario of Compass cannot pass the SFC testcases in Functest. -But if you want to use verify SFC in the cluster deployed by Compass, you can -use neutron CLI to achieve the same effect. Known issues ------------ -+-----------------------+---------------------------------+-----------------------+ -| **Scenario** | **Issue** | **Workarounds** | -+-----------------------+---------------------------------+-----------------------+ -| Ceph Related Scenario | After a power failure or reboot,| Deploy without Ceph | -| | the cluster cannot heal itself | | -+-----------------------+---------------------------------+-----------------------+ Test Result =========== -The Euphrates release with the Compass4nfv deployment toolchain has undergone QA test +The Fraser release with the Compass4nfv deployment toolchain has undergone QA test runs with the following results: -Functest: http://testresults.opnfv.org/reporting/euphrates/functest/status-compass.html +Functest: http://testresults.opnfv.org/reporting/fraser/functest/status-compass.html diff --git a/docs/release/scenarios/k8s-nosdn-nofeature-ha.rst b/docs/release/scenarios/k8s-nosdn-nofeature-ha.rst index d9925cb7..e52889fa 100644 --- a/docs/release/scenarios/k8s-nosdn-nofeature-ha.rst +++ b/docs/release/scenarios/k8s-nosdn-nofeature-ha.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Justin Chi (HUAWEI),Yifei Xue (HUAWEI)and Xinhui Hu (FIBERHOME) -This document introduces scenario descriptions for Euphrates 1.0 of +This document introduces scenario descriptions for Fraser 1.0 of deployment with no SDN controller and no feature enabled. .. contents:: @@ -35,5 +35,5 @@ Limitations, Issues and Workarounds References ========== -For more information on the OPNFV Euphrates release, please visit -http://www.opnfv.org/euphrates +For more information on the OPNFV Fraser release, please visit +http://www.opnfv.org/fraser diff --git a/docs/release/scenarios/os-nosdn-nofeature-ha.rst b/docs/release/scenarios/os-nosdn-nofeature-ha.rst index 6ff3b85c..5fc3e6d4 100644 --- a/docs/release/scenarios/os-nosdn-nofeature-ha.rst +++ b/docs/release/scenarios/os-nosdn-nofeature-ha.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Justin Chi (HUAWEI) and Yifei Xue (HUAWEI) -This document introduces scenario descriptions for Euphrates 1.0 of +This document introduces scenario descriptions for Fraser 1.0 of deployment with no SDN controller and no feature enabled. .. contents:: @@ -13,8 +13,8 @@ deployment with no SDN controller and no feature enabled. os-nosdn-nofeature-ha ===================== -This scenario is used to deploy an Ocata OpenStack deployment with -Ceph Jewel, and without SDN controller nor any NFV feature enabled. +This scenario is used to deploy a Pike OpenStack deployment with +Ceph Luminous, and without SDN controller nor any NFV feature enabled. Scenario components and composition =================================== @@ -37,5 +37,5 @@ Limitations, Issues and Workarounds References ========== -For more information on the OPNFV Euphrates release, please visit -http://www.opnfv.org/euphrates +For more information on the OPNFV Fraser release, please visit +http://www.opnfv.org/fraser diff --git a/docs/release/scenarios/os-odl-nofeature-ha.rst b/docs/release/scenarios/os-odl-nofeature-ha.rst index 64e74e04..df6cfa6a 100644 --- a/docs/release/scenarios/os-odl-nofeature-ha.rst +++ b/docs/release/scenarios/os-odl-nofeature-ha.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Justin Chi (HUAWEI) and Yifei Xue (HUAWEI) -This document introduces scenario descriptions for Euphrates 1.0 of +This document introduces scenario descriptions for Fraser 1.0 of deployment with the OpenDaylight controller and no feature enabled. .. contents:: @@ -13,8 +13,8 @@ deployment with the OpenDaylight controller and no feature enabled. os-odl-nofeature-ha =================== -This scenario is used to deploy an Ocata OpenStack deployment with -OpenDaylight Nitrogen, Ceph Jewel, and without any NFV feature enabled. +This scenario is used to deploy a Pike OpenStack deployment with +OpenDaylight Nitrogen SR1, Ceph Luminous, and without any NFV feature enabled. Scenario components and composition =================================== @@ -39,5 +39,5 @@ Limitations, Issues and Workarounds References ========== -For more information on the OPNFV Euphrates release, please visit -http://www.opnfv.org/euphrates +For more information on the OPNFV Fraser release, please visit +http://www.opnfv.org/fraser diff --git a/docs/release/scenarios/os-odl-sfc-ha.rst b/docs/release/scenarios/os-odl-sfc-ha.rst index 7dca2417..3be817a2 100644 --- a/docs/release/scenarios/os-odl-sfc-ha.rst +++ b/docs/release/scenarios/os-odl-sfc-ha.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Justin Chi (HUAWEI) and Yifei Xue (HUAWEI) -This document introduces scenario descriptions for Euphrates 1.0 of +This document introduces scenario descriptions for Fraser 1.0 of deployment with the OpenDaylight controller and SFC feature enabled. .. contents:: @@ -13,8 +13,8 @@ deployment with the OpenDaylight controller and SFC feature enabled. os-odl-sfc-ha ============= -This scenario is used to deploy an Ocata OpenStack deployment with -OpenDaylight Nitrogen, Ceph Jewel, and SFC feature enabled. +This scenario is used to deploy a Pike OpenStack deployment with +OpenDaylight Nitrogen SR1, Ceph Luminous, and SFC feature enabled. Scenario components and composition =================================== @@ -41,5 +41,5 @@ Limitations, Issues and Workarounds References ========== -For more information on the OPNFV Euphrates release, please visit -http://www.opnfv.org/euphrates +For more information on the OPNFV Fraser release, please visit +http://www.opnfv.org/fraser diff --git a/plugins/barometer/roles/grafana/files/install_grafana.sh b/plugins/barometer/roles/grafana/files/install_grafana.sh index 0b9f4ec5..43d9a588 100644 --- a/plugins/barometer/roles/grafana/files/install_grafana.sh +++ b/plugins/barometer/roles/grafana/files/install_grafana.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -echo "deb https://packagecloud.io/grafana/stable/debian/ wheezy main" | tee /etc/apt/sources.list.d/grafana.list +echo "deb https://packagecloud.io/grafana/stable/debian/ stretch main" | tee /etc/apt/sources.list.d/grafana.list curl https://packagecloud.io/gpg.key | apt-key add - diff --git a/plugins/odl_cluster/roles/setup-odl/files/odl_pkg.sh b/plugins/odl_cluster/roles/setup-odl/files/odl_pkg.sh index 55639907..a99b1af5 100755 --- a/plugins/odl_cluster/roles/setup-odl/files/odl_pkg.sh +++ b/plugins/odl_cluster/roles/setup-odl/files/odl_pkg.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #!/bin/bash rm -rf /home/networking diff --git a/plugins/odl_cluster/roles/setup-odl/tasks/control-agents-1.yml b/plugins/odl_cluster/roles/setup-odl/tasks/control-agents-1.yml index 13b4c571..ecc67d29 100755 --- a/plugins/odl_cluster/roles/setup-odl/tasks/control-agents-1.yml +++ b/plugins/odl_cluster/roles/setup-odl/tasks/control-agents-1.yml @@ -33,6 +33,8 @@ - name: Stop the Open vSwitch service and clear existing OVSDB shell: > service {{ service_ovs_name }} stop ; + sleep 3; rm -rf /var/log/openvswitch/* ; rm -rf /etc/openvswitch/conf.db ; + sleep 3; service {{ service_ovs_name }} start ; diff --git a/plugins/odl_cluster/roles/setup-odl/tasks/odl-pre.yml b/plugins/odl_cluster/roles/setup-odl/tasks/odl-pre.yml index 64631663..21f0e86b 100755 --- a/plugins/odl_cluster/roles/setup-odl/tasks/odl-pre.yml +++ b/plugins/odl_cluster/roles/setup-odl/tasks/odl-pre.yml @@ -35,9 +35,8 @@ {% set _ = compu_l2_list.append(l2_mapping) %} {% set _ = compu_l3_list.append(l3_mapping) %} {% endfor %} - {% set pub_l3_mapping = pub_l3_mapping[0].replace(pub_intf[0], compu_pub_intf) %} {% set _ = compu_l2_list.append(pub_l2_mapping[0]) %} - {% set _ = compu_l3_list.append(pub_l3_mapping) %} + {% set _ = compu_l3_list.append(pub_l3_mapping[0]) %} public_bridge: "{{ pub_bridge[0] }}" contr_public_intf: "{{ pub_intf[0] }}" contr_l2_mappings: "{{ ','.join(contr_l2_list) }}" diff --git a/plugins/odl_cluster/roles/setup-odl/vars/main.yml b/plugins/odl_cluster/roles/setup-odl/vars/main.yml index 5f4047c9..c4723e9c 100755 --- a/plugins/odl_cluster/roles/setup-odl/vars/main.yml +++ b/plugins/odl_cluster/roles/setup-odl/vars/main.yml @@ -10,9 +10,9 @@ openstack_passwd_file: /etc/openstack_deploy/user_secrets.yml # yamllint disable rule:line-length -os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}" +os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" # yamllint enable rule:line-length -os_name: pike +os_name: queens odl_username: admin diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/files/odl_pkg.sh b/plugins/odl_sfc/roles/setup-odl-sfc/files/odl_pkg.sh index d93da3fd..69f5cd63 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/files/odl_pkg.sh +++ b/plugins/odl_sfc/roles/setup-odl-sfc/files/odl_pkg.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #!/bin/bash rm -rf /home/networking diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml index 8fd1109f..f63edeaa 100644 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml @@ -5,3 +5,9 @@ name: networking-sfc virtualenv: /openstack/venvs/tacker-{{ os_ver }} when: odl_sfc == "Enable" + +- name: stop the other two tacker servers + service: + name: tacker-server + state: stopped + when: inventory_hostname != groups['tacker_all'][0] diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml b/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml index 2ffcac10..bc870277 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml @@ -10,9 +10,9 @@ openstack_passwd_file: /etc/openstack_deploy/user_secrets.yml # yamllint disable rule:line-length -os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}" +os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" # yamllint enable rule:line-length -os_name: pike +os_name: queens odl_username: admin odl_password: admin diff --git a/plugins/onap/roles/tasks/Ubuntu.yml b/plugins/onap/roles/tasks/Ubuntu.yml new file mode 100644 index 00000000..a51e5f17 --- /dev/null +++ b/plugins/onap/roles/tasks/Ubuntu.yml @@ -0,0 +1,117 @@ +--- +- name: download helm + get_url: + url: "{{ helm_url }}" + dest: /tmp/helm.tar.gz + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: prepare helm + shell: + tar -zxf /tmp/helm.tar.gz -C /tmp; + mv /tmp/linux-amd64/helm /usr/local/bin/helm + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: install tiller + shell: > + kubectl create serviceaccount --namespace kube-system tiller; + kubectl create clusterrolebinding tiller-cluster-rule + --clusterrole=cluster-admin + --serviceaccount=kube-system:tiller; + helm init --service-account tiller + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: git clone oom + git: + repo: "{{ oom_repo }}" + dest: "{{ oom_dest }}" + version: "{{ oom_version }}" + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: prepare local repo + shell: + nohup /bin/sh -c "helm serve &" + while true; do curl -s 127.0.0.1:8879 > /dev/null; if [ $? -eq 0 ]; then break; fi; done + helm repo add local http://127.0.0.1:8879 + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: add helm plugin + shell: + cp -rf "{{ oom_dest }}/kubernetes/helm/plugins" ~/.helm/ + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: make + shell: + make all + args: + chdir: "{{ oom_dest }}/kubernetes" + when: inventory_hostname == groups['kube_master'][0] + +- name: install nfs master + apt: + pkg: "nfs-kernel-server" + state: "present" + update_cache: "yes" + when: inventory_hostname == groups['kube_master'][0] + +- name: create /dockerdata-nfs + file: + path: /dockerdata-nfs + owner: nobody + group: nogroup + state: directory + mode: 0777 + when: inventory_hostname == groups['kube_master'][0] + +- name: install nfs slave + apt: + pkg: "nfs-common" + state: "present" + update_cache: "yes" + when: inventory_hostname != groups['kube_master'][0] + +- name: create /dockerdata-nfs + file: + path: /dockerdata-nfs + state: directory + when: inventory_hostname != groups['kube_master'][0] + +- name: render /etc/exports + template: + src: exports.j2 + dest: /etc/exports + when: inventory_hostname == groups['kube_master'][0] + +- name: restart nfs service + shell: + exportfs -a; + systemctl restart nfs-kernel-server + when: inventory_hostname == groups['kube_master'][0] + +- name: register master hostname + debug: + msg: "{{ ip_settings[groups['kube_master'][0]]['external']['ip'] }}" + register: master_ip + +- name: + shell: + mount {{ master_ip.msg }}:/dockerdata-nfs /dockerdata-nfs/ + when: inventory_hostname != groups['kube_master'][0] + +# yamllint disable rule:line-length +- name: add mount info + lineinfile: + path: /etc/fstab + line: "{{ master_ip.msg }}:/dockerdata-nfs /dockerdata-nfs nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0" + when: inventory_hostname != groups['kube_master'][0] +# yamllint enable rule:line-length + +- name: deploy onap + shell: + helm deploy dev local/onap --namespace onap + when: inventory_hostname == groups['kube_master'][0] diff --git a/plugins/onap/roles/tasks/main.yml b/plugins/onap/roles/tasks/main.yml new file mode 100644 index 00000000..c9e80427 --- /dev/null +++ b/plugins/onap/roles/tasks/main.yml @@ -0,0 +1,11 @@ +############################################################################# +# Copyright (c) 2019 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################# +--- +- include: "{{ ansible_distribution }}.yml" + when: onap is defined and onap == "Enable" diff --git a/plugins/onap/roles/templates/exports.j2 b/plugins/onap/roles/templates/exports.j2 new file mode 100644 index 00000000..8f5a3f65 --- /dev/null +++ b/plugins/onap/roles/templates/exports.j2 @@ -0,0 +1 @@ +/dockerdata-nfs{% for host in groups.all %}{% if host != groups.kube_master[0] %} {{ ip_settings[host]['external']['ip'] }}(rw,sync,no_root_squash,no_subtree_check){% endif %}{% endfor %} diff --git a/plugins/onap/roles/vars/main.yml b/plugins/onap/roles/vars/main.yml new file mode 100644 index 00000000..83b591a5 --- /dev/null +++ b/plugins/onap/roles/vars/main.yml @@ -0,0 +1,13 @@ +############################################################################# +# Copyright (c) 2019 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +helm_url: https://storage.googleapis.com/kubernetes-helm/helm-v2.9.1-linux-amd64.tar.gz +oom_repo: https://gerrit.onap.org/r/oom +oom_dest: /home/oom +oom_version: casablanca diff --git a/plugins/opencontrail/plugin.desc b/plugins/opencontrail/plugin.desc new file mode 100644 index 00000000..82ccd5ee --- /dev/null +++ b/plugins/opencontrail/plugin.desc @@ -0,0 +1,43 @@ +# Plugin for opencontrail service for Compass4nfv. +# opencontrail provides a sdn network for k8s. +# +# More details can be found in the development document. +# ############################################################## +--- +plugin: + # plugin name,it is also as the switch to enable/disable plugin in scenario + # files + name: opencontrail + + description: provide a sdn solution for k8s + + maintainers: + + # host os type: centos + os_version: centos + + # true: this plugin is deployed separately on a new node + # false: this plugin is deployed on controller or compute node + independent_hosts: false + + # artifact: package download url for this plugin + artifacts: + url: + + # orchestration + # A plugin can have mutiple components, each component may need to be + # installed on different inventory or have its own configuration. + # due to Compass4nfv currently only supports ansible, so each component + # of the installation and configuration script need to be use ansible. + # cm : congfiguration management tool : only ansible support + # role: each component corresponds to ansible script that locates in the same + # directory as plugin.desc. + # phrase: + # inventory: + orchestration: + cm: ansible + roles: + - role: opencontrail + phrase: post_k8s + inventory: + - localhost diff --git a/plugins/opencontrail/roles/install-k8s-opencontrail/files/bms-instances.yaml b/plugins/opencontrail/roles/install-k8s-opencontrail/files/bms-instances.yaml new file mode 100644 index 00000000..7fb70374 --- /dev/null +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/files/bms-instances.yaml @@ -0,0 +1,32 @@ +--- +provider_config: + bms: + ssh_pwd: root + ssh_user: root + ssh_public_key: /root/.ssh/id_rsa.pub + ssh_private_key: /root/.ssh/id_rsa + domainsuffix: local +instances: + bms1: + provider: bms + roles: + config_database: + config: + control: + analytics_database: + analytics: + webui: + k8s_master: + kubemanager: + ip: 192.16.1.211 + bms2: + provider: bms + roles: + k8s_node: + vrouter: + ip: 192.16.1.212 + +contrail_configuration: + CONTAINER_REGISTRY: opencontrailnightly + CONTRAIL_VERSION: latest + KUBERNETES_CLUSTER_PROJECT: {} diff --git a/plugins/opencontrail/roles/install-k8s-opencontrail/files/kvm-instances.yaml b/plugins/opencontrail/roles/install-k8s-opencontrail/files/kvm-instances.yaml new file mode 100644 index 00000000..b2f9e6dd --- /dev/null +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/files/kvm-instances.yaml @@ -0,0 +1,32 @@ +--- +provider_config: + kvm: + ssh_pwd: root + ssh_user: root + ssh_public_key: /root/.ssh/id_rsa.pub + ssh_private_key: /root/.ssh/id_rsa + domainsuffix: local +instances: + kvm1: + provider: kvm + roles: + config_database: + config: + control: + analytics_database: + analytics: + webui: + k8s_master: + kubemanager: + ip: 10.1.0.50 + kvm2: + provider: kvm + roles: + k8s_node: + vrouter: + ip: 10.1.0.51 + +contrail_configuration: + CONTAINER_REGISTRY: opencontrailnightly + CONTRAIL_VERSION: latest + KUBERNETES_CLUSTER_PROJECT: {} diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors.repo b/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors.repo index 4900db69..4900db69 100644 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors.repo +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors.repo diff --git a/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors_aarch64.repo b/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors_aarch64.repo new file mode 100644 index 00000000..1d622d3c --- /dev/null +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors_aarch64.repo @@ -0,0 +1,22 @@ +[base] +name=CentOS-$releasever - Base +baseurl=http://mirror.centos.org/altarch/$releasever/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 + +#released updates +[updates] +name=CentOS-$releasever - Updates +baseurl=http://mirror.centos.org/altarch/$releasever/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +baseurl=http://mirror.centos.org/altarch/$releasever/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 diff --git a/plugins/opencontrail/roles/install-k8s-opencontrail/tasks/main.yml b/plugins/opencontrail/roles/install-k8s-opencontrail/tasks/main.yml new file mode 100644 index 00000000..712ebfa7 --- /dev/null +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/tasks/main.yml @@ -0,0 +1,92 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +- name: clean local repo conf + file: + path: /etc/yum.repos.d + state: absent + run_once: "True" + when: ansible_os_family == 'RedHat' + +- name: create local repo conf dir + file: + path: /etc/yum.repos.d + state: directory + run_once: "True" + when: ansible_os_family == 'RedHat' + +- name: configure local mirror repo + copy: + src: "{{ item }}" + dest: /etc/yum.repos.d/mirrors.repo + with_first_found: + - mirrors_{{ ansible_architecture }}.repo + - mirrors.repo + run_once: "True" + when: ansible_os_family == 'RedHat' + +- name: clean local pip conf to use official pip repo + file: + path: /root/.pip/pip.conf + state: absent + run_once: "True" + +- name: install dependency for ansible update + yum: + name: "{{ item }}" + state: latest + with_items: + - git + - libffi-devel + - openssl-devel + - python-devel + run_once: "True" + when: ansible_os_family == 'RedHat' + +- name: update python packages + pip: + name: "{{ item }}" + state: latest + with_items: + - netaddr + - jinja2 + +- name: git clone contrail-ansible-deployer repo + shell: | + rm -rf /opt/contrail-ansible-deployer + git clone https://github.com/Juniper/contrail-ansible-deployer.git \ + /opt/contrail-ansible-deployer + +- name: copy overrided variables + copy: + src: "{{ item }}" + dest: /opt/contrail-ansible-deployer/config/instances.yaml + with_first_found: + - kvm-instances.yaml + +- name: do not restart network + shell: | + cd /opt/contrail-ansible-deployer + sed -i '9, 13d' playbooks/roles/configure_instances/tasks/RedHat.yml + +- name: run config playbook + shell: | + cd /opt/contrail-ansible-deployer + ansible-playbook -i inventory/ playbooks/configure_instances.yml \ + -b -v 2>&1 | tee config-contrail.log + tags: + - ansible + +- name: run install playbook + shell: | + cd /opt/contrail-ansible-deployer + ansible-playbook -e orchestrator=kubernetes -i inventory/ playbooks/install_contrail.yml \ + -b -v 2>&1 | tee install-contrail.log + tags: + - ansible diff --git a/plugins/stor4nfv/plugin.desc b/plugins/stor4nfv/plugin.desc index ae589a60..e0a1e690 100644 --- a/plugins/stor4nfv/plugin.desc +++ b/plugins/stor4nfv/plugin.desc @@ -43,3 +43,7 @@ plugin: phrase: post_k8s inventory: - localhost + - role: os-stor4nfv + phrase: post_openstack + inventory: + - localhost diff --git a/plugins/stor4nfv/roles/os-stor4nfv/files/install_ansible.sh b/plugins/stor4nfv/roles/os-stor4nfv/files/install_ansible.sh new file mode 100644 index 00000000..d921d4e2 --- /dev/null +++ b/plugins/stor4nfv/roles/os-stor4nfv/files/install_ansible.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# + +add-apt-repository ppa:ansible/ansible-2.4 + +apt-get update +apt-get install -y ansible +sleep 5 + +ansible --version + diff --git a/plugins/stor4nfv/roles/os-stor4nfv/files/os_configure_vars.sh b/plugins/stor4nfv/roles/os-stor4nfv/files/os_configure_vars.sh new file mode 100644 index 00000000..a081c0bd --- /dev/null +++ b/plugins/stor4nfv/roles/os-stor4nfv/files/os_configure_vars.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# + +cd $HOME/gopath/src/github.com/os-stor4nfv/stor4nfv/ci/ansible + +sed -i '/- osdsdock/s/^/#/g' site.yml + +sed -i '/- dashboard-installer/s/^/#/g' site.yml + +sed -i '/- nbp-installer/s/^/#/g' site.yml + +sed -i '/check_ansible_version/a \ ignore_errors: yes\' roles/common/tasks/main.yml + +# auth +sed -i 's/^opensds_auth_strategy.*/opensds_auth_strategy: noauth/g' group_vars/auth.yml + +# opensds_endpoint +sed -i 's/^opensds_endpoint.*/opensds_endpoint: http:\/\/'"$1"':50040/g' group_vars/common.yml + +# etcd_host +sed -i 's/^etcd_host.*/etcd_host: '"$2"'/g' group_vars/osdsdb.yml diff --git a/plugins/stor4nfv/roles/os-stor4nfv/tasks/main.yml b/plugins/stor4nfv/roles/os-stor4nfv/tasks/main.yml new file mode 100644 index 00000000..dbaa8d6b --- /dev/null +++ b/plugins/stor4nfv/roles/os-stor4nfv/tasks/main.yml @@ -0,0 +1,13 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- +- include: stor4nfv.yml + when: + - ansible_distribution == 'Ubuntu' + - stor4nfv is defined and stor4nfv == "Enable" diff --git a/plugins/stor4nfv/roles/os-stor4nfv/tasks/opensds.yml b/plugins/stor4nfv/roles/os-stor4nfv/tasks/opensds.yml new file mode 100644 index 00000000..fd9756a4 --- /dev/null +++ b/plugins/stor4nfv/roles/os-stor4nfv/tasks/opensds.yml @@ -0,0 +1,72 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- + +- name: install prerequisites package + apt: + name: "{{ item }}" + state: present + with_items: + - git + - gawk + - curl + - wget + - software-properties-common + +- name: copy install_ansible script + remote_user: root + copy: + src: install_ansible.sh + dest: /opt/install_ansible.sh + mode: 0777 + +- name: install ansible + command: su -s /bin/sh -c "/opt/install_ansible.sh" + ignore_errors: "true" + +- name: disable cinder + remote_user: root + shell: | + lxc-stop -n $(lxc-ls --line | grep cinder_api) + lxc-stop -n $(lxc-ls --line | grep cinder_scheduler) + ignore_errors: "true" + +- name: modify haproxy.cfg and restart haproxy + remote_user: root + shell: | + sed -i \ + '/frontend cinder_api-front/,/host1_cinder_api_container/ s/^/#/' /etc/haproxy/haproxy.cfg + systemctl restart haproxy + ignore_errors: "true" + +- name: fetch stor4nfv source code + remote_user: root + shell: | + mkdir -p $HOME/gopath/src/github.com/os-stor4nfv && cd $HOME/gopath/src/github.com/os-stor4nfv; + rm -rf stor4nfv; + git clone https://gerrit.opnfv.org/gerrit/stor4nfv.git + +- name: copy os_configure_vars script + remote_user: root + copy: + src: os_configure_vars.sh + dest: /opt/os_configure_vars.sh + mode: 0777 + +- name: configure variables for opensds + remote_user: root + shell: | + cd /opt; + ./os_configure_vars.sh {{ public_vip.ip }} {{ internal_vip.ip }} + +- name: run playbook + remote_user: root + shell: | + cd $HOME/gopath/src/github.com/os-stor4nfv/stor4nfv/ci/ansible; + ansible-playbook site.yml -i local.hosts | tee /var/log/os-stor4nfv.log diff --git a/plugins/stor4nfv/roles/os-stor4nfv/tasks/post-install.yml b/plugins/stor4nfv/roles/os-stor4nfv/tasks/post-install.yml new file mode 100644 index 00000000..d441f420 --- /dev/null +++ b/plugins/stor4nfv/roles/os-stor4nfv/tasks/post-install.yml @@ -0,0 +1,143 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- + +- name: ensure opensds.conf exists + stat: + path: /etc/opensds/opensds.conf + register: opensds_exists + when: + - inventory_hostname in groups['ceph_adm'] + +- name: configure ceph.yaml, opensds.conf + remote_user: root + shell: | + cd /root/gopath/src/github.com/os-stor4nfv/stor4nfv/ci/ansible + cp group_vars/ceph/ceph.yaml /etc/opensds/driver/ + sed -i 's/^ enabled_backends.*/ enabled_backends: ceph/g' /etc/opensds/opensds.conf + sudo cat >> /etc/opensds/opensds.conf << OPENSDS_GLOABL_CONFIG_DOC + + [ceph] + name = ceph + description = Ceph Test + driver_name = ceph + config_path = /etc/opensds/driver/ceph.yaml + OPENSDS_GLOABL_CONFIG_DOC + when: + - inventory_hostname in groups['ceph_adm'] + +- name: modify osdsdock endpoint + remote_user: root + shell: + _raw_params: | + function _modify_osdsdock_endpoint { + local ip_addr=$((lxc-info -n $(lxc-ls --line | grep ceph-mon) -iH)|grep "10.1") + if [ ! -z "${ip_addr}" ]; then + sed -i 's/api_endpoint = localhost:50050/api_endpoint = '"$ip_addr"':50050/g' \ + /etc/opensds/opensds.conf + fi + } + _modify_osdsdock_endpoint + args: + executable: /bin/bash + become: true + when: + - inventory_hostname in groups['ceph_adm'] + +- name: copy ceph.conf from ceph-mon container + remote_user: root + shell: | + mkdir -p /etc/ceph; + cp /proc/$(lxc-info -n $(lxc-ls --line | grep ceph-mon) -p -H)/root/etc/ceph/ceph.conf \ + /etc/ceph/ceph.conf + when: + - inventory_hostname in groups['ceph_adm'] + +- name: copy osdsdock executable to ceph-mon container + remote_user: root + shell: | + cd /opt; + tar -C opensds-hotpot-linux-amd64 -c . | lxc-attach -n \ + $(lxc-ls --line | grep ceph-mon) -- /bin/sh -c "tar -C /opt/ -vx; chmod 1777 /opt;" + when: + - inventory_hostname in groups['ceph_adm'] + +- name: copy opensds conf files to ceph-mon container + remote_user: root + shell: | + cd /etc; + tar -C opensds -c . | lxc-attach -n \ + $(lxc-ls --line | grep ceph-mon) -- /bin/sh -c "tar -C /tmp/ -vx; chmod 1777 /tmp;" + when: + - inventory_hostname in groups['ceph_adm'] + +- name: ensure opensds driver exists + stat: + path: /tmp/driver + register: opensds_driver_exists + when: + - inventory_hostname in groups['ceph-mon'] + - groups['ceph_adm'][0] in inventory_hostname + +- name: copy opensds conf + remote_user: root + shell: | + mkdir -p /etc/opensds; + cp /tmp/opensds.conf /etc/opensds; + cp /tmp/policy.json /etc/opensds; + cp -r /tmp/driver /etc/opensds; + when: + - inventory_hostname in groups['ceph-mon'] + - groups['ceph_adm'][0] in inventory_hostname + +- name: create ceph pool + remote_user: root + shell: | + ceph osd pool create rbd 24 && ceph osd pool set rbd size 1 + when: + - inventory_hostname in groups['ceph-mon'] + - groups['ceph_adm'][0] in inventory_hostname + +- name: ensure osdsdock exists + stat: + path: /opt/bin/osdsdock + register: opensds_exists + when: + - inventory_hostname in groups['ceph-mon'] + - groups['ceph_adm'][0] in inventory_hostname + +- name: start osdsdock daemon + remote_user: root + shell: | + cd /opt && ./bin/osdsdock -daemon + when: + - inventory_hostname in groups['ceph-mon'] + - groups['ceph_adm'][0] in inventory_hostname + +- name: ensure osdsctl exists + stat: + path: /opt/opensds-hotpot-linux-amd64/bin/osdsctl + register: osdsctl_exists + when: + - inventory_hostname in groups['ceph_adm'] + +- name: run cinder-compatible-api, create opensds default profile + remote_user: root + shell: | + cd $HOME/gopath/src/github.com/os-stor4nfv/stor4nfv/ci/ansible; + export OPENSDS_ENDPOINT=http://{{ public_vip.ip }}:50040; + export CINDER_ENDPOINT=http://{{ internal_vip.ip }}:8776/v3; + chmod +x ../bin/cindercompatibleapi; + ( ( nohup ../bin/cindercompatibleapi > /var/log/cindercompatibleapi.log 2>&1 ) & ); + cp /opt/opensds-hotpot-linux-amd64/bin/osdsctl /usr/local/bin; + export OPENSDS_AUTH_STRATEGY=noauth; + osdsctl profile create '{"name": "default", "description": "default policy"}' + when: + - inventory_hostname in groups['ceph_adm'] + ignore_errors: "true" diff --git a/plugins/stor4nfv/roles/os-stor4nfv/tasks/stor4nfv.yml b/plugins/stor4nfv/roles/os-stor4nfv/tasks/stor4nfv.yml new file mode 100644 index 00000000..05ada67a --- /dev/null +++ b/plugins/stor4nfv/roles/os-stor4nfv/tasks/stor4nfv.yml @@ -0,0 +1,14 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- +- include: opensds.yml + when: + - inventory_hostname in groups['ceph_adm'] + +- include: post-install.yml diff --git a/plugins/stor4nfv/roles/stor4nfv/files/configure_vars.sh b/plugins/stor4nfv/roles/stor4nfv/files/configure_vars.sh index 878f1542..89432135 100644 --- a/plugins/stor4nfv/roles/stor4nfv/files/configure_vars.sh +++ b/plugins/stor4nfv/roles/stor4nfv/files/configure_vars.sh @@ -10,12 +10,14 @@ cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible +sed -i 's/^container_enabled.*/container_enabled: false/g' group_vars/common.yml + +sed -i 's/^nbp_plugin_type.*/nbp_plugin_type: csi/g' group_vars/common.yml + sed -i 's/^workplace.*/workplace: \/root/g' group_vars/common.yml sed -i 's/^enabled_backend.*/enabled_backend: ceph/g' group_vars/osdsdock.yml -sed -i 's/^ceph_pool_name.*/ceph_pool_name: "rbd"/g' group_vars/osdsdock.yml - sed -i 's/^ceph_origin.*/ceph_origin: repository/g' group_vars/ceph/all.yml sed -i 's/^ceph_repository.*/ceph_repository: community/g' group_vars/ceph/all.yml @@ -28,12 +30,31 @@ sed -i 's|^cluster_network.*|cluster_network: '"$2"'|g' group_vars/ceph/all.yml sed -i 's/^monitor_interface.*/monitor_interface: eth0/g' group_vars/ceph/all.yml -sed -i 's/^devices:.*/devices: [\/dev\/loop0, \/dev\/loop1, \/dev\/loop2]/g' group_vars/ceph/osds.yml +sed -i 's/^devices:.*/devices: [\/dev\/loop0, \/dev\/loop1, \/dev\/loop2]/g' group_vars/ceph/all.yml + +sed -i '/dev\/sda/s/^/#/g' group_vars/ceph/all.yml sed -i 's/^osd_scenario.*/osd_scenario: collocated/g' group_vars/ceph/osds.yml sed -i 's/^db_endpoint.*/db_endpoint: localhost:62379,localhost:62380/g' group_vars/osdsdb.yml +sed -i 's/^etcd_host.*/etcd_host: 127.0.0.1/g' group_vars/osdsdb.yml + sed -i 's/^etcd_port.*/etcd_port: 62379/g' group_vars/osdsdb.yml sed -i 's/^etcd_peer_port.*/etcd_peer_port: 62380/g' group_vars/osdsdb.yml + +sed -i 's/^opensds_auth_strategy.*/opensds_auth_strategy: noauth/g' group_vars/auth.yml + +sed -i '/check_ansible_version/a \ ignore_errors: yes\' roles/common/tasks/main.yml + +sed -i '/- dashboard-installer/s/^/#/g' site.yml + +# comment csi create pods in Stor4nfv +sed -i '/kubectl create/s/^/#/g' roles/nbp-installer/scenarios/csi.yml + +sed -i 's/^opensds_endpoint.*/opensds_endpoint: http:\/\/'"$1"':50040/g' group_vars/common.yml + +sed -i '/and service_ceph_osd_status.rc == 0/s/^/#/g' roles/osdsdock/scenarios/ceph.yml +sed -i '/and service_ceph_osd_status.rc == 0/a \ when: service_ceph_mon_status.rc == 0\' \ + roles/osdsdock/scenarios/ceph.yml diff --git a/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh b/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh index b4a3a30a..d921d4e2 100644 --- a/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh +++ b/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh @@ -8,7 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # ############################################################################# -add-apt-repository ppa:ansible/ansible +add-apt-repository ppa:ansible/ansible-2.4 apt-get update apt-get install -y ansible diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml index 89d13f41..dbaa8d6b 100644 --- a/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml +++ b/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml @@ -7,8 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # ############################################################################# --- -- include: opensds.yml -- include: nbp.yml +- include: stor4nfv.yml when: - ansible_distribution == 'Ubuntu' - stor4nfv is defined and stor4nfv == "Enable" diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/nbp.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/nbp.yml deleted file mode 100644 index 5361f5cd..00000000 --- a/plugins/stor4nfv/roles/stor4nfv/tasks/nbp.yml +++ /dev/null @@ -1,27 +0,0 @@ -# ############################################################################# -# Copyright (c) 2018 Intel Corp. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -# ############################################################################# ---- - -- name: render nbp inventory - remote_user: root - template: - src: nbp.hosts.j2 - dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/nbp-ansible/nbp.hosts - -- name: set nbp to csi - remote_user: root - shell: | - cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/nbp-ansible; - sed -i 's/^nbp_plugin_type.*/nbp_plugin_type: csi/g' group_vars/common.yml - -- name: run playbook - remote_user: root - shell: | - cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/nbp-ansible; - ansible-playbook site.yml -i nbp.hosts | tee /var/log/stor4nfv-nbp.log diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml index afd65bc7..e84ce0aa 100644 --- a/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml +++ b/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml @@ -15,6 +15,7 @@ with_items: - make - gcc + - gawk - name: copy install_ansible script remote_user: root @@ -26,12 +27,6 @@ - name: install ansible command: su -s /bin/sh -c "/opt/install_ansible.sh" -- name: install ceph-ansible code - remote_user: root - shell: | - cd /opt; - git clone https://github.com/ceph/ceph-ansible.git - - name: fetch stor4nfv source code remote_user: root shell: | @@ -57,10 +52,10 @@ src: ceph.hosts.j2 dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/group_vars/ceph/ceph.hosts -- name: render opensds inventory +- name: render opensds, nbp inventory remote_user: root template: - src: opensds.hosts.j2 + src: opensds-nbp.hosts.j2 dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/local.hosts - name: force to run the second etcd cluster @@ -75,10 +70,3 @@ shell: | cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible; ansible-playbook site.yml -i local.hosts | tee /var/log/stor4nfv.log - register: stor4nfv_result - -- name: export opensds endpoint - remote_user: root - shell: | - export OPENSDS_ENDPOINT=http://127.0.0.1:50040 - when: stor4nfv_result|succeeded diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml new file mode 100644 index 00000000..501d3baa --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml @@ -0,0 +1,69 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- + +- name: define image architecture + set_fact: + imgarch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" + +- name: ensure ceph-ansible dir exists + stat: + path: /opt/ceph-ansible + ignore_errors: "true" + register: ceph_ansible_exists + +- name: copy post-install.yml to /opt/ceph-ansible + remote_user: root + template: + src: post-install.yml.j2 + dest: /opt/ceph-ansible/post-install.yml + when: + - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists + +- name: run post-install playbook + shell: ansible-playbook post-install.yml -i ceph.hosts + become: true + args: + chdir: /opt/ceph-ansible + ignore_errors: "true" + when: + - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists + +- name: remove post-install.yml + file: + path: /opt/ceph-ansible/post-install.yml + state: absent + when: + - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists + +- name: ensure osdsctl exists + stat: + path: /opt/opensds-hotpot-linux-{{ imgarch }}/bin/osdsctl + ignore_errors: "true" + register: osdsctl_exists + +- name: ensure opensds csi directory exists + stat: + path: /opt/opensds-sushi-linux-{{ imgarch }} + ignore_errors: "true" + register: csi_dir_exists + +- name: create opensds default profile, create csi pods + remote_user: root + shell: | + cp /opt/opensds-hotpot-linux-{{ imgarch }}/bin/osdsctl /usr/local/bin; + export OPENSDS_ENDPOINT=http://{{ public_vip.ip }}:50040; + export OPENSDS_AUTH_STRATEGY=noauth; + osdsctl profile create '{"name": "default", "description": "default policy"}'; + cd /opt/opensds-sushi-linux-{{ imgarch }}; + kubectl create -f csi/deploy/kubernetes + ignore_errors: "true" + when: + - osdsctl_exists.stat.exists is defined and osdsctl_exists.stat.exists + - csi_dir_exists.stat.exists is defined and csi_dir_exists.stat.exists diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/stor4nfv.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/stor4nfv.yml new file mode 100644 index 00000000..57bae793 --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/tasks/stor4nfv.yml @@ -0,0 +1,12 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- +- include: opensds.yml + +- include: post-install.yml diff --git a/plugins/stor4nfv/roles/stor4nfv/templates/nbp.hosts.j2 b/plugins/stor4nfv/roles/stor4nfv/templates/nbp.hosts.j2 deleted file mode 100644 index 0e8fa4c9..00000000 --- a/plugins/stor4nfv/roles/stor4nfv/templates/nbp.hosts.j2 +++ /dev/null @@ -1,4 +0,0 @@ -[worker-nodes] -{% for worker in hostvars[inventory_hostname]['groups']['storage_master'] %} -{{ worker }} ansible_ssh_host={{ hostvars[worker]['ansible_ssh_host'] }} -{% endfor %} diff --git a/plugins/stor4nfv/roles/stor4nfv/templates/opensds.hosts.j2 b/plugins/stor4nfv/roles/stor4nfv/templates/opensds-nbp.hosts.j2 index 97068b90..c93f2b77 100644 --- a/plugins/stor4nfv/roles/stor4nfv/templates/opensds.hosts.j2 +++ b/plugins/stor4nfv/roles/stor4nfv/templates/opensds-nbp.hosts.j2 @@ -7,3 +7,8 @@ {% for dock in hostvars[inventory_hostname]['groups']['storage_master'] %} {{ dock }} ansible_ssh_host={{ hostvars[dock]['ansible_ssh_host'] }} {% endfor %} + +[worker-nodes] +{% for worker in hostvars[inventory_hostname]['groups']['storage_master'] %} +{{ worker }} ansible_ssh_host={{ hostvars[worker]['ansible_ssh_host'] }} +{% endfor %} diff --git a/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2 b/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2 new file mode 100644 index 00000000..662abc34 --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2 @@ -0,0 +1,20 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- + +- hosts: + - mons + - osds + - mgrs + + tasks: + - name: run modprobe rbd + remote_user: root + command: modprobe rbd + ignore_errors: "true" diff --git a/quickstart.sh b/quickstart.sh index db56ee2f..f872abfd 100755 --- a/quickstart.sh +++ b/quickstart.sh @@ -7,6 +7,13 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## + +COMPASS_ARCH=$(uname -m) +if [ "$COMPASS_ARCH" = "aarch64" ]; then + echo "Not support aarch64, please try quickstart_k8s.sh instead" + exit 1 +fi + sudo apt-get update sudo apt-get install -y git diff --git a/quickstart_k8s.sh b/quickstart_k8s.sh index 2745cdb9..49a8432c 100755 --- a/quickstart_k8s.sh +++ b/quickstart_k8s.sh @@ -7,6 +7,15 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## + +COMPASS_ARCH=$(uname -m) +if [ "$COMPASS_ARCH" = "aarch64" ]; then + echo "Running on aarch64 host, make sure your jump host is configured okay" + echo "Please reference docs/release/installation/k8s-deploy-arm.rst" + export ADAPTER_OS_PATTERN='(?i)CentOS-7.*arm.*' + SCENARIO=${SCENARIO:-k8-nosdn-nofeature-noha.yml} +fi + sudo apt-get update sudo apt-get install -y git diff --git a/util/check_valid.py b/util/check_valid.py index e6a72e71..9348d272 100644 --- a/util/check_valid.py +++ b/util/check_valid.py @@ -98,25 +98,19 @@ 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]): + if not is_valid_mac(i['interfaces'].get(j)): err_print('''invalid address: hosts: - name: %s interfaces: - - %s: %s''' % (i['name'], j.keys()[0], j.values()[0])) # noqa: E501 + - %s: %s''' % (i['name'], j, i['interfaces'].get(j))) # noqa: E501 invalid = True - if not is_valid_ip(i['ipmiIp']): + if not is_valid_ip(i['power_ip']): err_print('''invalid address: hosts: - name: %s - ipmiIp: %s''' % (i['name'], i['ipmiIp'])) + power_ip: %s''' % (i['name'], i['power_ip'])) invalid = True if not invalid: diff --git a/util/docker-compose/group_vars/all b/util/docker-compose/group_vars/all index 920589ce..d43d659d 100755 --- a/util/docker-compose/group_vars/all +++ b/util/docker-compose/group_vars/all @@ -29,7 +29,7 @@ distros_x86_64: aliase: "xenial" version: "ubuntu" iso_name: ubuntu-16.04.3-server-amd64 - ppa_name: xenial-pike-ppa + ppa_name: xenial-queens-ppa cobbler_name: ubuntu-16.04.3-server cobbler_arch: x86_64 @@ -39,21 +39,21 @@ distros_x86_64: aliase: "centos7" version: "centos" iso_name: CentOS-7-x86_64-Minimal-1708 - ppa_name: centos7-pike-ppa + ppa_name: centos7-queens-ppa cobbler_name: CentOS-7-Minimal-1708 cobbler_arch: x86_64 distros_aarch64: ubuntu-16.04: breed: "ubuntu" - kickstart: "default16.seed" - kopts: "netcfg/choose_interface=auto console=ttyS0 console=ttyAMA0 console=tty0 net.ifnames=0" - kopts_post: "console=ttyS0 console=ttyAMA0 console=tty0 net.ifnames=0" + kickstart: "default16-aarch64.seed" + kopts: "netcfg/choose_interface=auto console=ttyS0 console=ttyAMA0 net.ifnames=0" + kopts_post: "console=ttyS0 console=ttyAMA0 net.ifnames=0" extra: "--apt-dists=xenial --apt-components=main" aliase: "xenial" version: "ubuntu" iso_name: ubuntu-16.04-server-arm64 - ppa_name: xenial-pike-ppa + ppa_name: xenial-queens-ppa cobbler_name: ubuntu-16.04-server cobbler_arch: arm @@ -62,7 +62,7 @@ distros_aarch64: kickstart: "default-aarch64.ks" aliase: "centos7" version: "centos" - iso_name: CentOS-7-aarch64-Minimal-1611 - ppa_name: centos7-pike-ppa - cobbler_name: CentOS-7-Minimal-1611 + iso_name: CentOS-7-aarch64-Minimal-1708 + ppa_name: centos7-queens-ppa + cobbler_name: CentOS-7-Minimal-1708 cobbler_arch: arm diff --git a/util/docker-compose/roles/cobbler/tasks/main.yml b/util/docker-compose/roles/cobbler/tasks/main.yml index 0a30e0c5..e4e2cf30 100755 --- a/util/docker-compose/roles/cobbler/tasks/main.yml +++ b/util/docker-compose/roles/cobbler/tasks/main.yml @@ -102,7 +102,7 @@ # - ubuntu-16.04-server-arm-arm64-arm # Kickstart meta url name # - http://x.x.x.x/cobbler/ks_mirror/CentOS-7-Minimal-1611-arm - # - http://x.x.x.x/cobbler/ks_mirror/ubuntu-16.04-server-arm-arm64 + # - http://x.x.x.x/cobbler/ks_mirror/ubuntu-16.04-server-arm name="{{ item.value.cobbler_name }}-arm" profiles=`docker exec compass-cobbler bash -c \ "cobbler profile list | grep $name"` @@ -112,7 +112,7 @@ --name $profile_name \ --name-servers '' \ --repos {{ item.value.ppa_name }} \ - --ksmeta \"tree=http://{{ host_ip }}/cobbler/ks_mirror/${profile_name%????}\" \ + --ksmeta \"tree=http://{{ host_ip }}/cobbler/ks_mirror/$name\" \ --kopts \"{{ item.value.kopts | default('') }}\" \ --kopts-post \"{{ item.value.kopts_post | default('') }}\"" done diff --git a/util/docker-compose/roles/compass/files/prepare_ansible.sh b/util/docker-compose/roles/compass/files/prepare_ansible.sh index 031333c8..22b7e905 100755 --- a/util/docker-compose/roles/compass/files/prepare_ansible.sh +++ b/util/docker-compose/roles/compass/files/prepare_ansible.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #!/bin/bash for i in `ls /root/compass4nfv/deploy/adapters/ansible | grep "openstack_"`; do diff --git a/util/docker-compose/roles/compass/files/up_containers.sh b/util/docker-compose/roles/compass/files/up_containers.sh index 9aca591a..6a57282e 100755 --- a/util/docker-compose/roles/compass/files/up_containers.sh +++ b/util/docker-compose/roles/compass/files/up_containers.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #!/bin/bash cd /root/docker_compose docker-compose up diff --git a/util/docker-compose/roles/machines/tasks/main.yml b/util/docker-compose/roles/machines/tasks/main.yml index 365a9d90..7b4a9f18 100755 --- a/util/docker-compose/roles/machines/tasks/main.yml +++ b/util/docker-compose/roles/machines/tasks/main.yml @@ -1,21 +1,15 @@ --- -- name: create switch file if test mode enabled - template: src=switch_machines_file.j2 - dest="{{ docker_compose_dir }}/switch_machines_file" - tags: - - redploy - - name: docker cp switch_machines_file shell: | - docker cp "{{ docker_compose_dir }}/switch_machines_file" \ - compass-deck:/tmp/switch_machines_file + docker cp "{{ docker_compose_dir }}/machine" \ + compass-deck:/tmp/machine tags: - redploy - name: inject switches and mac addresses shell: | docker exec compass-deck bash -c \ - "/opt/compass/bin/manage_db.py set_switch_machines \ - --switch_machines_file /tmp/switch_machines_file" + "/opt/compass/bin/manage_db.py set_machine \ + --machine_file /tmp/machine" tags: - redploy |