diff options
125 files changed, 2983 insertions, 765 deletions
@@ -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 9ecb5f34..72d376e6 100644 --- a/build/build-aarch64.yaml +++ b/build/build-aarch64.yaml @@ -10,6 +10,12 @@ packages: get_method: cached 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 diff --git a/build/build.yaml b/build/build.yaml index 8e922d42..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,13 +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: ramay1/compass-tasks-osa:queens + 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" @@ -44,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(): @@ -19,8 +19,6 @@ #export DEPLOY_HARBOR="true" #export HABOR_VERSION="1.5.0" -# Set url for download the tar file of harbor -#export HABOR_DOWNLOAD_URL=https://storage.googleapis.com/harbor-releases/release-$HABOR_VERSION/harbor-offline-installer-v$HABOR_VERSION.tgz # Set hardware deploy jumpserver PXE NIC # You need to comment out it when virtual deploy. #export INSTALL_NIC=eth1 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/kargo/files/extra-vars-aarch64.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml index 2e31cbdb..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 @@ -14,6 +14,7 @@ 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 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.repo b/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors.repo deleted file mode 100644 index 4900db69..00000000 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors.repo +++ /dev/null @@ -1,32 +0,0 @@ -[base]
-name=CentOS-$releasever - Base
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
-#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
-gpgcheck=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
-
-#released updates
-[updates]
-name=CentOS-$releasever - Updates
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
-#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
-gpgcheck=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
-
-#additional packages that may be useful
-[extras]
-name=CentOS-$releasever - Extras
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
-#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
-gpgcheck=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
-
-#additional packages that extend functionality of existing packages
-[centosplus]
-name=CentOS-$releasever - Plus
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
-#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
-gpgcheck=1
-enabled=0
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
-
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 0e253129..512121e2 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml @@ -7,166 +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: enable http proxy - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/all.yml - regexp: '^#http_proxy:' - line: 'http_proxy: {{ http_proxy }}' - when: http_proxy != '' - -- name: enable https proxy - lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/all.yml - regexp: '^#https_proxy:' - line: 'https_proxy: {{ https_proxy }}' - when: https_proxy !='' - -- 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: @@ -277,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 80490955..af9c9675 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/vars/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/vars/main.yml @@ -1,9 +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/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml index 1c691b8e..d382a5e1 100644 --- a/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml @@ -46,6 +46,15 @@ - 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/"; 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/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 index d6945e07..bea43534 100644 --- a/deploy/adapters/ansible/openstack_queens/README.md +++ b/deploy/adapters/ansible/openstack_queens/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 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 ae654b47..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 # 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/main.yml b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml index 3f9dbe1f..ab2714a9 100755 --- a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml @@ -362,3 +362,75 @@ dest: /etc/ansible/roles/lxc_hosts/vars/ubuntu-16.04.yml insertafter: '^ cache_prep_commands:' line: ' rm /etc/resolv.conf || true' + +- name: fix apt prompt issue + lineinfile: + dest: /etc/ansible/roles/lxc_hosts/vars/ubuntu-16.04.yml + state: absent + regexp: "apt-get upgrade -y" + +- 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: 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/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-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 cf6ba1e3..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 diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml index bb96b736..726cb545 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml @@ -68,6 +68,8 @@ regexp: 'br-external' replace: 'br-provider' +- meta: flush_handlers + - name: restart keepalived service: name: keepalived 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 index f7b9756b..bdc4d447 100755 --- a/deploy/adapters/ansible/roles/setup-openvswitch/templates/controller.j2 +++ b/deploy/adapters/ansible/roles/setup-openvswitch/templates/controller.j2 @@ -26,7 +26,7 @@ iface {{ intf_external }} inet manual {% set intf_tenant = intf_tenant + '.' + contr_sys_mappings["tenant"]["vlan_tag"]|string %} {% endif %} auto {{ intf_tenant }} -iface {{ intf_tenant }} inet static +iface {{ intf_tenant }} inet manual {% if contr_sys_mappings["tenant"]["vlan_tag"] | int %} vlan-raw-device {{ intf_tenant }} {% endif %} @@ -86,3 +86,5 @@ iface br-storage inet static 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/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/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/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 87bbaf56..02e10cee 100755 --- a/deploy/compass_conf/role/kubernetes_ansible.conf +++ b/deploy/compass_conf/role/kubernetes_ansible.conf @@ -14,7 +14,8 @@ ROLES = [{ }, { 'role': 'opencontrail', 'display_name': 'opencontrail node', - 'description': 'opencontrail node' + 'description': 'opencontrail node', + 'optional': True },{ 'role': 'ha', 'display_name': 'ha', 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 669eaca0..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 @@ -122,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/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/HA-ansible-multinodes.tmpl index 8ae9bdba..202f86bb 100755 --- 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 @@ -62,7 +62,6 @@ run_dir: $getVar('run_dir', '') enable_secgroup: $getVar('enable_secgroup', True) enable_fwaas: $getVar('enable_fwaas', True) enable_vpnaas: $getVar('enable_vpnaas', True) -odl_l3_agent: $getVar('odl_l3_agent', 'Disable') ha_network: $getVar('ha_network', 'Disable') onos_nic: $getVar('onos_nic', 'eth2') onos_sfc: $getVar('onos_sfc', 'Disable') @@ -160,10 +159,21 @@ CEILOMETER_TOKEN: c095d479023a0fd58a54 erlang.cookie: DJJVECFMCJPVYQTJTDWG #set plugins = $getVar('plugins', []) +#set odl_enable = False #for item in plugins -#set keys = $item.keys() -#set values = $item.values() -$keys[0]: $values[0] +#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'] @@ -189,8 +199,11 @@ NEUTRON_TUNNEL_ID_RANGES: $ovs_config['tunnel_id_ranges'] NEUTRON_TUNNEL_ID_RANGES: [] #end if -#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +#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 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 2f909b60..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 } @@ -190,11 +188,12 @@ function launch_harbor() { 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 $HABOR_DOWNLOAD_URL + 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/g" -i $harbor_cfg + 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/ 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_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_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/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_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_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_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_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_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_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/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 8a009003..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) 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 38d98e1d..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 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 1239aa4d..c810a072 100644 --- a/docs/release/installation/featureTable.rst +++ b/docs/release/installation/featureTable.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 + Features ======== 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/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/vmdeploy.rst b/docs/release/installation/vmdeploy.rst index 63c3cc5e..4f1336c5 100644 --- a/docs/release/installation/vmdeploy.rst +++ b/docs/release/installation/vmdeploy.rst @@ -19,7 +19,6 @@ If you want to deploy noha with1 controller and 1 compute, run the following com .. code-block:: bash export SCENARIO=os-nosdn-nofeature-noha.yml - export VIRT_NUMBER=2 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} 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_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/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/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 a4fe44ea..89432135 100644 --- a/plugins/stor4nfv/roles/stor4nfv/files/configure_vars.sh +++ b/plugins/stor4nfv/roles/stor4nfv/files/configure_vars.sh @@ -10,10 +10,6 @@ cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible -sed -i 's/^opensds_release.*/opensds_release: v0.1.5/g' group_vars/common.yml - -sed -i 's/^nbp_release.*/nbp_release: v0.1.0/g' group_vars/common.yml - 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 @@ -34,7 +30,9 @@ 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 @@ -45,3 +43,18 @@ 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/tasks/main.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml index 060c9cf1..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: post-install.yml +- include: stor4nfv.yml when: - ansible_distribution == 'Ubuntu' - stor4nfv is defined and stor4nfv == "Enable" diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml index 3252fefb..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,13 +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; - [ -f ceph-ansible/requirements.txt ] && pip install -r ceph-ansible/requirements.txt - - name: fetch stor4nfv source code remote_user: root shell: | diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml index 182c0a68..501d3baa 100644 --- a/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml +++ b/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml @@ -31,6 +31,7 @@ become: true args: chdir: /opt/ceph-ansible + ignore_errors: "true" when: - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists @@ -43,25 +44,25 @@ - name: ensure osdsctl exists stat: - path: /opt/opensds-v0.1.5-linux-{{ imgarch }}/bin/osdsctl + path: /opt/opensds-hotpot-linux-{{ imgarch }}/bin/osdsctl ignore_errors: "true" register: osdsctl_exists - name: ensure opensds csi directory exists stat: - path: /opt/opensds-k8s-v0.1.0-linux-{{ imgarch }} + path: /opt/opensds-sushi-linux-{{ imgarch }} ignore_errors: "true" register: csi_dir_exists -- name: create opensds default profile, csi pods +- name: create opensds default profile, create csi pods remote_user: root shell: | - cp /opt/opensds-v0.1.5-linux-{{ imgarch }}/bin/osdsctl /usr/local/bin; + 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-k8s-v0.1.0-linux-{{ imgarch }}; - kubectl create -f csi/deploy/kubernetes; + 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 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/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/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 |