diff options
344 files changed, 9838 insertions, 1539 deletions
@@ -1,29 +0,0 @@ -Project Name: Compass4nfv -Repo name: compass4nfv -Project Category: Integration and testing -Lifecycle State: Proposal approved -Primary Contact: Justin chi(chigang@huawei.com) -Project Lead: Justin chi -Jira Project Name: Compass4nfv -Jira Project Prefix: COMPASS -mailing list tag [COMPASS] -IRC: Server:freenode.net Channel:#opnfv-compass4nfv - -Committers: -Weidong shao (weidong.shao@huawei.com) -Prakash Ramchandran (Prakash.Ramchandran@huawei.com) -Justin chi (chigang@huawei.com) -Chenshuai (chenshuai@huawei.com) -Ashlee Young (ashlee@yunify.com) -Yifei Xue (xueyifei@huawei.com) -Xinhui Hu (xinhui_hu@foxmail.com) - -Link to TSC approval: http://ircbot.wl.linuxfoundation.org/meetings/opnfv-meeting/2015/opnfv-meeting.2015-07-21-14.02.html - -Link to approval of new PTL: -https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2017-January/014591.html -https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2017-January/014601.html -https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2017-January/014709.html -https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2017-January/014726.html - -Link to approval of additional submitters: diff --git a/INFO.yaml b/INFO.yaml new file mode 100644 index 00000000..6f777320 --- /dev/null +++ b/INFO.yaml @@ -0,0 +1,65 @@ +--- +project: 'Compass4nfv' +project_creation_date: '' +project_category: 'Integration and testing' +lifecycle_state: 'Proposal approved' +project_lead: &opnfv_compass4nfv_ptl + name: 'Harry Huang' + email: 'huangxiangyu5@huawei.com' + id: 'huangxiangyu' + company: 'huawei.com' + timezone: 'UTC+8' +primary_contact: *opnfv_compass4nfv_ptl +issue_tracking: + type: 'jira' + url: 'https://jira.opnfv.org/projects/COMPASS' + key: 'COMPASS' +mailing_list: + type: 'mailman2' + url: 'opnfv-tech-discuss@lists.opnfv.org' + tag: '[compass4nfv]' +realtime_discussion: + type: irc + server: 'freenode.net' + channel: '#opnfv-compass4nfv' +meetings: + - type: 'zoom+irc' + agenda: 'https://wiki.opnfv.org/display/meetings/Compass4NFV+Integration+Discuss+Meeting' + url: 'https://zoom.us/j/5014627785' + server: 'freenode.net' + channel: '#opnfv-compass4nfv' + repeats: 'weekly' + time: '01:00 UTC' +repositories: + - 'compass4nfv' + - 'compass-containers' +committers: + - <<: *opnfv_compass4nfv_ptl + - name: 'Yifei Xue' + email: 'xueyifei@huawei.com' + company: 'huawei.com' + id: 'xueyifei1988' + - name: 'HU Xinhui' + email: 'xinhui_hu@foxmail.com' + company: 'foxmail.com' + id: 'huxinhui' + - name: 'Ramamani yeleswarapu' + email: 'ramamani.yeleswarapu@intel.com' + company: 'intel.com' + id: 'ramay' + - name: 'Yibo Cai' + email: 'yibo.cai@arm.com' + company: 'arm.com' + id: 'yibocai' + - name: 'Tianwei Wu' + email: 'wutianwei1@huawei.com' + company: 'huawei.com' + id: 'wutianwei' + - name: 'Justin chi' + email: 'chigang@huawei.com' + company: 'huawei.com' + id: 'chigang' +tsc: + # yamllint disable rule:line-length + approval: 'http//ircbot.wl.linuxfoundation.org/meetings/opnfv-meeting/2015/opnfv-meeting.2015-07-21-14.02.html' + # yamllint enable rule:line-length @@ -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 - } @@ -142,3 +142,4 @@ process_param $* prepare_env download_packages build_tar + diff --git a/build/build-aarch64.yaml b/build/build-aarch64.yaml index 47bd0eb1..72d376e6 100644 --- a/build/build-aarch64.yaml +++ b/build/build-aarch64.yaml @@ -1,41 +1,42 @@ --- packages: - - name: CentOS-7-aarch64-Minimal-1611.iso + - name: CentOS-7-aarch64-Minimal-1708.iso description: "Centos ISO of each host for provisioning" get_method: cached - url: $COMPASS_ISO_REPO/CentOS-7-aarch64-Minimal-1611.iso + url: http://artifacts.opnfv.org/compass4nfv/package/master/CentOS-7-aarch64-Minimal-1708.iso - name: ubuntu-16.04-server-arm64.iso description: "Ubuntu ISO of each host for provisioning" get_method: cached - url: $COMPASS_ISO_REPO/ubuntu-16.04-server-arm64.iso + url: http://artifacts.opnfv.org/compass4nfv/package/master/ubuntu-16.04-server-arm64.iso + + # XXX: For now, it's only an empty file to satisfy build.sh + - name: harbor-empty.tgz + description: "The package of harbor offline installer" + get_method: cached + url: http://people.linaro.org/~yibo.cai/compass/harbor-empty.tgz - name: compass-deck description: "RESTful API and DB Handlers for Compass" get_method: docker - url: $COMPASS_DOCKER_REPO/compass-deck:latest + url: opnfv/compass-deck:latest - name: compass-tasks-k8s description: "compass task container for kubernets deployment via kargo" get_method: docker - url: $COMPASS_DOCKER_REPO/compass-tasks-k8s:latest + url: opnfv/compass-tasks-k8s:latest - name: compass-cobbler description: "cobbler container for compass" get_method: docker - url: $COMPASS_DOCKER_REPO/compass-cobbler:latest + url: opnfv/compass-cobbler:latest - name: compass-db description: "datebase container for compass" get_method: docker - url: $COMPASS_DOCKER_REPO/compass-db:latest + url: opnfv/compass-db:latest - name: compass-mq description: "message queue container for compass" get_method: docker - url: $COMPASS_DOCKER_REPO/compass-mq:latest - - - name: compass-docker-compose - description: "containerized compass compose ansible" - get_method: git - url: $COMPASS_GIT_REPO/compass-docker-compose + url: rabbitmq:3.6.12 diff --git a/build/build.yaml b/build/build.yaml index 4719c2c7..75faa280 100644 --- a/build/build.yaml +++ b/build/build.yaml @@ -3,22 +3,38 @@ 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" get_method: docker url: opnfv/compass-deck:latest - - name: compass-tasks - description: "compass task container integrated with openstack-ansible and kubespray" + - name: compass-tasks-osa + description: "compass task container integrated with openstack-ansible" + get_method: docker + url: opnfv/compass-tasks-osa:latest + + - name: compass-tasks-k8s + description: "compass task container integrated with kubespray" get_method: docker - url: opnfv/compass-tasks:latest + url: huxinhui/compass-tasks-k8s:7.0.1 - name: compass-cobbler description: "cobbler container for compass" @@ -38,7 +54,7 @@ packages: - name: yardstick description: "yardstick container for compass" get_method: docker - url: opnfv/yardstick:latest + url: opnfv/yardstick:stable - name: compass-repo-osa-ubuntu description: "compass repo container for deployment" diff --git a/build/parser.py b/build/parser.py index b80709cb..971d2844 100644 --- a/build/parser.py +++ b/build/parser.py @@ -18,65 +18,73 @@ def load_env(): return cache_dir +def exec_command(cmd, ignore_error=False): + rc = os.system(cmd) + if not ignore_error and rc != 0: + sys.exit(1) + else: + return rc + + def get_from_cache(cache, package): filename = package.get("name") - remotefile = package.get("url") + remotefile = list(package.get("url")) localfile = cache + "/" + filename localmd5file = localfile + ".md5" - remotemd5file = remotefile + ".md5" print "removing local md5 file...." cmd = "rm -f " + localmd5file - os.system(cmd) + exec_command(cmd) print "downloading remote md5 file to local...." - cmd = "curl --connect-timeout 10 -o " + localmd5file + " " + remotemd5file - os.system(cmd) - if os.path.exists(localmd5file): - print "calculate md5sum of local file" - cmd = "md5sum " + localfile + "|cut -d ' ' -f 1" - localmd5sum = os.popen(cmd).readlines() - cmd = "cat " + localmd5file + "|cut -d ' ' -f 1" - remotemd5sum = os.popen(cmd).readlines() - print "md5 local %s remote %s" % (localmd5sum, remotemd5sum) - if (remotemd5sum == localmd5sum): - print "Same with remote, no need to download...." - return + for file in remotefile: + remotemd5file = file + ".md5" + cmd = "curl --connect-timeout 10 -o {0} {1}".format( + localmd5file, remotemd5file) + rc = exec_command(cmd, True) + if os.path.exists(localfile): + print "calculate md5sum of local file" + cmd = "md5sum " + localfile + "|cut -d ' ' -f 1" + localmd5sum = os.popen(cmd).readlines() + cmd = "cat " + localmd5file + "|cut -d ' ' -f 1" + remotemd5sum = os.popen(cmd).readlines() + print "md5 local %s remote %s" % (localmd5sum, remotemd5sum) + if (remotemd5sum == localmd5sum): + print "Same with remote, no need to download...." + return + if rc == 0: + break print "downloading remote file to local...." - cmd = "curl --connect-timeout 10 -o " + localfile + " " + remotefile + cmd = "aria2c --max-tries 1 --max-connection-per-server=4 \ + --allow-overwrite=true --dir={0} --out={1} {2}".format( + cache, filename, " ".join(remotefile)) print cmd - rc = os.system(cmd) - if rc != 0: - sys.exit(1) + exec_command(cmd) def get_from_git(cache, package): localfile = cache + "/" + package.get("name") cmd = "rm -rf " + localfile print cmd - os.system(cmd) + exec_command(cmd) cmd = "git clone " + package.get("url") + " " + localfile print cmd - rc = os.system(cmd) - if rc != 0: - sys.exit(1) + exec_command(cmd) def get_from_docker(cache, package): + package_ouput = cache+"/"+package.get("name")+".tar" cmd = "sudo docker pull "+package.get("url") - os.system(cmd) - cmd = "sudo docker save "+package.get("url")+" -o "+cache+"/" - cmd += package.get("name")+".tar" - rc = os.system(cmd) - if rc != 0: - sys.exit(1) + exec_command(cmd) + cmd = "sudo docker save "+package.get("url")+" -o "+package_ouput + exec_command(cmd) + cmd = "user=$(whoami); sudo chown -R $user:$user "+package_ouput + exec_command(cmd) def get_from_curl(cache, package): cmd = "curl --connect-timeout 10 -o " + cache + "/" cmd += package.get("name") + " " + package.get("url") print cmd - rc = os.system(cmd) - if rc != 0: - sys.exit(1) + exec_command(cmd) def usage(): diff --git a/ci/deploy_ci.sh b/ci/deploy_ci.sh index bd5adcc7..028a8c9d 100755 --- a/ci/deploy_ci.sh +++ b/ci/deploy_ci.sh @@ -18,12 +18,13 @@ case $DEPLOY_SCENARIO in echo "os-onos-sfc-ha scenario supports mitaka only" exit 1 ;; - k8-nosdn-nofeature-ha) - export COMPASS_OS_VERSION=centos7 - export KUBERNETES_VERSION="v1.7.3" - ;; esac +if [[ "$DEPLOY_SCENARIO" =~ "k8-" ]]; then + export KUBERNETES_VERSION="v1.7.3" +fi + + if [[ "$NODE_NAME" =~ "intel-pod17" ]]; then export USER_NAMESERVER=8.8.8.8 fi @@ -31,7 +32,7 @@ fi if [[ $ROOT_BUILD_CAUSE == MANUALTRIGGER ]]; then # For manual ci trigger build, directly use the value pass from CI export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-xenial} - export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-pike} + export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-queens} else # For daily build or verify build, adjust COMPASS_OS_VERSION and OPENSTACK_VERSION @@ -39,10 +40,10 @@ else if [[ $COMPASS_OS_VERSION == centos7 ]]; then export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-centos7} - export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-pike} + export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-queens} else export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-xenial} - export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-pike} + export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-queens} fi fi @@ -16,6 +16,9 @@ # export TAR_URL=file:///home/compass/compass4nfv.iso #export TAR_URL= +#export DEPLOY_HARBOR="true" +#export HABOR_VERSION="1.5.0" + # Set hardware deploy jumpserver PXE NIC # You need to comment out it when virtual deploy. #export INSTALL_NIC=eth1 @@ -30,7 +33,7 @@ #export OPENSTACK_VERSION=${OPENSTACK_VERSION:-ocata} -export OPENSTACK_VERSION=pike +export OPENSTACK_VERSION=queens export COMPASS_ARCH=$(uname -m) diff --git a/deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml b/deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml index 9f20cdbc..094c6488 100644..100755 --- a/deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml +++ b/deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml @@ -25,8 +25,36 @@ roles: - install-k8s-dependence +- hosts: ha + remote_user: root + max_fail_percentage: 0 + roles: + - ha + - hosts: localhost remote_user: root max_fail_percentage: 0 roles: - - kargo + - role: kargo + when: opencontrail is not defined + - role: install-k8s-opencontrail + when: opencontrail is defined and opencontrail == "Enable" + +- hosts: kube_master + remote_user: root + max_fail_percentage: 0 + roles: + - post-k8s + +- hosts: kube_node + remote_user: root + max_fail_percentage: 0 + roles: + - role: storage + when: stor4nfv is defined and stor4nfv == "Enable" + +- hosts: storage_master + remote_user: root + max_fail_percentage: 0 + roles: + - stor4nfv diff --git a/deploy/adapters/ansible/kubernetes/roles/2flannel-apps/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/2flannel-apps/tasks/main.yml new file mode 100644 index 00000000..a7ff10e2 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/2flannel-apps/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- name: "2Flannel | Create ServiceAccount ClusterRole and ClusterRoleBinding" + command: "{{ bin_dir }}/kubectl apply -f {{ kube_config_dir }}/cni-2flannel-rbac.yml" + run_once: true + when: rbac_enabled and two_flannel_rbac_manifest.changed + +- name: 2Flannel | Start Resources + kube: + name: "kube-2flannel" + kubectl: "{{ bin_dir }}/kubectl" + filename: "{{ kube_config_dir }}/cni-2flannel.yml" + resource: "ds" + namespace: "{{system_namespace}}" + state: "{{ item | ternary('latest','present') }}" + with_items: "{{ two_flannel_manifest.changed }}" + when: inventory_hostname == groups['kube-master'][0] + +- name: 2Flannel | Wait for flannel subnet.env file presence + wait_for: + path: /run/2flannel/networks/subnet1.env + delay: 5 + timeout: 600 diff --git a/deploy/adapters/ansible/kubernetes/roles/2flannel/defaults/main.yml b/deploy/adapters/ansible/kubernetes/roles/2flannel/defaults/main.yml new file mode 100644 index 00000000..f9e61eda --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/2flannel/defaults/main.yml @@ -0,0 +1,21 @@ +--- +# Flannel public IP +# The address that flannel should advertise as how to access the system +# Disabled until https://github.com/coreos/flannel/issues/712 is fixed +# flannel_public_ip: "{{ access_ip|default(ip|default(ansible_default_ipv4.address)) }}" + +## interface that should be used for flannel operations +## This is actually an inventory node-level item +# flannel_interface: + +# You can choose what type of flannel backend to use +# please refer to flannel's docs : https://github.com/coreos/flannel/blob/master/README.md + +# Limits for apps +flannel_memory_limit: 500M +flannel_cpu_limit: 300m +flannel_memory_requests: 64M +flannel_cpu_requests: 150m + +two_flannel_network1: "{{ kube_pods_subnet }}" +two_flannel_network2: "10.235.64.0/18" diff --git a/deploy/adapters/ansible/kubernetes/roles/2flannel/handlers/main.yml b/deploy/adapters/ansible/kubernetes/roles/2flannel/handlers/main.yml new file mode 100644 index 00000000..44ead00e --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/2flannel/handlers/main.yml @@ -0,0 +1,61 @@ +--- +- name: 2Flannel | delete default docker bridge + command: ip link delete docker0 + failed_when: false + notify: 2Flannel | restart docker + +- name: 2Flannel | delete 2flannel interface + command: ip link delete flannel0 && ip link delete flannel1 + failed_when: false + +# special cases for atomic because it defaults to live-restore: true +# So we disable live-restore to pickup the new flannel IP. After +# we enable it, we have to restart docker again to pickup the new +# setting and restore the original behavior +- name: 2Flannel | restart docker + command: /bin/true + notify: + - 2Flannel | reload systemd + - 2Flannel | reload docker.socket + - 2Flannel | configure docker live-restore true (atomic) + - 2Flannel | reload docker + - 2Flannel | pause while Docker restarts + - 2Flannel | wait for docker + +- name: 2Flannel | reload systemd + shell: systemctl daemon-reload + +- name: 2Flannel | reload docker.socket + service: + name: docker.socket + state: restarted + when: ansible_os_family in ['CoreOS', 'Container Linux by CoreOS'] + +- name: 2Flannel | configure docker live-restore true (atomic) + replace: + name: /etc/docker/daemon.json + regexp: '"live-restore":.*true' + replace: '"live-restore": false' + when: is_atomic + +- name: 2Flannel | reload docker + service: + name: docker + state: restarted + +- name: 2Flannel | pause while Docker restarts + pause: + seconds: 10 + prompt: "Waiting for docker restart" + +- name: 2Flannel | wait for docker + command: "{{ docker_bin_dir }}/docker images" + register: docker_ready + retries: 10 + delay: 5 + until: docker_ready.rc == 0 + +- name: 2Flannel | reload kubelet + service: + name: kubelet + state: restarted diff --git a/deploy/adapters/ansible/kubernetes/roles/2flannel/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/2flannel/tasks/main.yml new file mode 100644 index 00000000..e7adeefe --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/2flannel/tasks/main.yml @@ -0,0 +1,73 @@ +--- +- include: pre-upgrade.yml + +- name: 2Flannel | Verify if br_netfilter module exists + shell: "modinfo br_netfilter" + register: modinfo_br_netfilter + failed_when: modinfo_br_netfilter.rc not in [0, 1] + changed_when: false + +- name: 2Flannel | Enable br_netfilter module + modprobe: + name: br_netfilter + state: present + when: modinfo_br_netfilter.rc == 0 + +# kube-proxy needs net.bridge.bridge-nf-call-iptables enabled when found +# if br_netfilter is not a module +- name: 2Flannel | Check if bridge-nf-call-iptables key exists + command: "sysctl net.bridge.bridge-nf-call-iptables" + failed_when: false + changed_when: false + register: sysctl_bridge_nf_call_iptables + +- name: 2Flannel | Enable bridge-nf-call tables + sysctl: + name: "{{ item }}" + state: present + value: 1 + reload: "yes" + when: modinfo_br_netfilter.rc == 1 and sysctl_bridge_nf_call_iptables.rc == 0 + with_items: + - net.bridge.bridge-nf-call-iptables + - net.bridge.bridge-nf-call-arptables + - net.bridge.bridge-nf-call-ip6tables + +- name: 2Flannel | Install Multus CNI + shell: |- + /usr/bin/docker run --rm --network=host -v /opt/cni/bin/:/opt/cni/bin/ golang:1.9 \ + bash -c \ + "git clone https://github.com/Intel-Corp/multus-cni && \ + cd multus-cni && ./build && cp bin/multus /opt/cni/bin" + +- name: 2Flannel | Create cni-flannel-rbac manifest + template: + src: cni-2flannel-rbac.yml.j2 + dest: "{{ kube_config_dir }}/cni-2flannel-rbac.yml" + register: two_flannel_rbac_manifest + when: inventory_hostname == groups['kube-master'][0] and rbac_enabled + +- name: 2Flannel | Create cni-flannel manifest + template: + src: cni-2flannel.yml.j2 + dest: "{{ kube_config_dir }}/cni-2flannel.yml" + register: two_flannel_manifest + when: inventory_hostname == groups['kube-master'][0] + +- name: 2Flannel | Set 2Flannel etcd configuration + shell: |- + ETCDCTL_CA_FILE=/etc/ssl/etcd/ssl/ca.pem \ + ETCDCTL_CERT_FILE=/etc/ssl/etcd/ssl/node-{{ ansible_hostname }}.pem \ + ETCDCTL_KEY_FILE=/etc/ssl/etcd/ssl/node-{{ ansible_hostname }}-key.pem \ + {{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} \ + set /{{ cluster_name }}/{{ item.config }}/network/config \ + '{ "Network": "{{ item.network }}", "Backend": {"Type":"udp", "Port":{{ item.port}} }}' + with_items: + - {config: "2flannel.1", + network: "{{ two_flannel_network1 }}", + port: 8285} + - {config: "2flannel.2", + network: "{{ two_flannel_network2 }}", + port: 8286} + delegate_to: "{{groups['etcd'][0]}}" + run_once: true diff --git a/deploy/adapters/ansible/kubernetes/roles/2flannel/tasks/pre-upgrade.yml b/deploy/adapters/ansible/kubernetes/roles/2flannel/tasks/pre-upgrade.yml new file mode 100644 index 00000000..a49002fe --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/2flannel/tasks/pre-upgrade.yml @@ -0,0 +1,14 @@ +--- +- name: 2Flannel pre-upgrade | Purge legacy flannel systemd unit file + file: + path: "/etc/systemd/system/docker.service.d/flannel-options.conf" + state: absent + notify: + - 2Flannel | delete default docker bridge + +- name: 2Flannel pre-upgrade | Purge legacy Flannel static pod manifest + file: + path: "{{ kube_manifest_dir }}/flannel-pod.manifest" + state: absent + notify: + - 2Flannel | delete flannel interface diff --git a/deploy/adapters/ansible/kubernetes/roles/2flannel/templates/cni-2flannel-rbac.yml.j2 b/deploy/adapters/ansible/kubernetes/roles/2flannel/templates/cni-2flannel-rbac.yml.j2 new file mode 100644 index 00000000..b4d1be11 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/2flannel/templates/cni-2flannel-rbac.yml.j2 @@ -0,0 +1,44 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: 2flannel + namespace: "{{system_namespace}}" +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: 2flannel +rules: + - apiGroups: + - "" + resources: + - pods + verbs: + - get + - apiGroups: + - "" + resources: + - nodes + verbs: + - list + - watch + - apiGroups: + - "" + resources: + - nodes/status + verbs: + - patch +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: 2flannel +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: 2flannel +subjects: +- kind: ServiceAccount + name: 2flannel + namespace: "{{system_namespace}}" diff --git a/deploy/adapters/ansible/kubernetes/roles/2flannel/templates/cni-2flannel.yml.j2 b/deploy/adapters/ansible/kubernetes/roles/2flannel/templates/cni-2flannel.yml.j2 new file mode 100644 index 00000000..9c159d37 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/2flannel/templates/cni-2flannel.yml.j2 @@ -0,0 +1,211 @@ +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: kube-2flannel-cfg1 + namespace: "{{system_namespace}}" + labels: + tier: node + app: 2flannel +data: + cni-conf.json: | + { + "name": "2flannel-networks", + "type": "multus", + "delegates": [ + { + "type": "flannel", + "name": "flannel1", + "subnetFile": "/run/2flannel/networks/subnet2.env", + "dataDir": "/var/lib/cni/flannel/2", + "delegate": { + "bridge": "kbr1", + "isDefaultGateway": false + } + }, + { + "type": "flannel", + "name": "flannel0", + "subnetFile": "/run/2flannel/networks/subnet1.env", + "dataDir": "/var/lib/cni/flannel/1", + "masterplugin": true, + "delegate": { + "bridge": "kbr0", + "isDefaultGateway": true + } + } + ] + } + net-conf.json: | + { + "Network": {{ two_flannel_network1 }}, + "Backend": { + "Type": "udp", + "Port": 8285 + } + } +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: kube-2flannel-cfg2 + namespace: "{{system_namespace}}" + labels: + tier: node + app: 2flannel +data: + net-conf.json: | + { + "Network": {{ two_flannel_network2 }}, + "Backend": { + "Type": "udp", + "Port": 8286 + } + } +--- +apiVersion: extensions/v1beta1 +kind: DaemonSet +metadata: + name: kube-2flannel + namespace: "{{system_namespace}}" + labels: + tier: node + k8s-app: 2flannel +spec: + template: + metadata: + labels: + tier: node + k8s-app: 2flannel + spec: +{% if rbac_enabled %} + serviceAccountName: 2flannel +{% endif %} + containers: + - name: kube-2flannel-1 + image: {{ flannel_image_repo }}:{{ flannel_image_tag }} + imagePullPolicy: {{ k8s_image_pull_policy }} + resources: + limits: + cpu: {{ flannel_cpu_limit }} + memory: {{ flannel_memory_limit }} + requests: + cpu: {{ flannel_cpu_requests }} + memory: {{ flannel_memory_requests }} + command: [ "/opt/bin/flanneld", "--ip-masq", + "-etcd-endpoints={{ etcd_access_addresses }}", + "-etcd-prefix=/{{ cluster_name }}/2flannel.1/network", + "-etcd-cafile=/etc/ssl/etcd/ssl/ca.pem", + "-etcd-certfile=/etc/ssl/etcd/ssl/node-$(NODE_NAME).pem", + "-etcd-keyfile=/etc/ssl/etcd/ssl/node-$(NODE_NAME)-key.pem", + "-subnet-file=/run/2flannel/networks/subnet1.env" ] + securityContext: + privileged: true + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + volumeMounts: + - name: run + mountPath: /run + - name: cni + mountPath: /etc/cni/net.d + - name: ssl + mountPath: /etc/ssl/etcd/ssl/ + - name: 2flannel-cfg1 + mountPath: /etc/kube-flannel/ + - name: kube-2flannel-2 + image: {{ flannel_image_repo }}:{{ flannel_image_tag }} + imagePullPolicy: {{ k8s_image_pull_policy }} + resources: + limits: + cpu: {{ flannel_cpu_limit }} + memory: {{ flannel_memory_limit }} + requests: + cpu: {{ flannel_cpu_requests }} + memory: {{ flannel_memory_requests }} + command: [ "/opt/bin/flanneld", "--ip-masq", + "-etcd-endpoints={{ etcd_access_addresses }}", + "-etcd-prefix=/{{ cluster_name }}/2flannel.2/network", + "-etcd-cafile=/etc/ssl/etcd/ssl/ca.pem", + "-etcd-certfile=/etc/ssl/etcd/ssl/node-$(NODE_NAME).pem", + "-etcd-keyfile=/etc/ssl/etcd/ssl/node-$(NODE_NAME)-key.pem", + "-subnet-file=/run/2flannel/networks/subnet2.env" ] + securityContext: + privileged: true + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + volumeMounts: + - name: run + mountPath: /run + - name: cni + mountPath: /etc/cni/net.d + - name: ssl + mountPath: /etc/ssl/etcd/ssl/ + - name: 2flannel-cfg2 + mountPath: /etc/kube-flannel/ + - name: install-cni + image: {{ flannel_cni_image_repo }}:{{ flannel_cni_image_tag }} + command: ["/install-cni.sh"] + env: + # The CNI network config to install on each node. + - name: CNI_NETWORK_CONFIG + valueFrom: + configMapKeyRef: + name: kube-2flannel-cfg1 + key: cni-conf.json + - name: CNI_CONF_NAME + value: "10-multus-2flannel.conf" + volumeMounts: + - name: cni + mountPath: /host/etc/cni/net.d + - name: host-cni-bin + mountPath: /host/opt/cni/bin/ + hostNetwork: true + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + volumes: + - name: run + hostPath: + path: /run + - name: cni + hostPath: + path: /etc/cni/net.d + - name: ssl + hostPath: + path: /etc/ssl/etcd/ssl/ + - name: 2flannel-cfg1 + configMap: + name: kube-2flannel-cfg1 + - name: 2flannel-cfg2 + configMap: + name: kube-2flannel-cfg2 + - name: host-cni-bin + hostPath: + path: /opt/cni/bin + updateStrategy: + rollingUpdate: + maxUnavailable: {{ serial | default('20%') }} + type: RollingUpdate 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 new file mode 100644 index 00000000..db44246a --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/ha/files/chk_k8s_master.sh @@ -0,0 +1,18 @@ +############################################################################## +# 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` + +if [ $count = 0 ]; then + exit 1 +else + exit 0 +fi diff --git a/deploy/adapters/ansible/kubernetes/roles/ha/handlers/main.yml b/deploy/adapters/ansible/kubernetes/roles/ha/handlers/main.yml new file mode 100644 index 00000000..03ed82ec --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/ha/handlers/main.yml @@ -0,0 +1,14 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +- name: restart haproxy + service: name=haproxy state=restarted enabled=yes + +- name: restart keepalived + service: name=keepalived state=restarted enabled=yes diff --git a/deploy/adapters/ansible/kubernetes/roles/ha/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/ha/tasks/main.yml new file mode 100644 index 00000000..c7e58376 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/ha/tasks/main.yml @@ -0,0 +1,83 @@ +############################################################################## +# 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 +############################################################################## +--- +- include_vars: "{{ ansible_os_family }}.yml" + +- name: install keepalived haproxy + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + with_items: "{{ packages | union(packages_noarch) }}" + +- name: generate ha service list + lineinfile: dest=/opt/service create=yes line= '{{ item }}' + with_items: "{{ services | union(services_noarch) }}" + +- name: install pexpect + pip: name=pexpect state=present extra_args='--pre' + +- name: activate ip_nonlocal_bind + sysctl: name=net.ipv4.ip_nonlocal_bind value=1 + state=present reload=yes + +- name: set net.ipv4.tcp_keepalive_intvl + sysctl: name=net.ipv4.tcp_keepalive_intvl value=1 + state=present reload=yes + +- name: set net.ipv4.tcp_keepalive_probes + sysctl: name=net.ipv4.tcp_keepalive_probes value=5 + state=present reload=yes + +- name: set net.ipv4.tcp_keepalive_time + sysctl: name=net.ipv4.tcp_keepalive_time value=5 + state=present reload=yes + +- name: update haproxy cfg + template: src=haproxy.cfg dest=/etc/haproxy/haproxy.cfg + notify: restart haproxy + +- name: set haproxy enable flag + lineinfile: dest=/etc/default/haproxy state=present + regexp="ENABLED=*" + line="ENABLED=1" + notify: restart haproxy + when: ansible_os_family == "Debian" + +- name: set haproxy log + lineinfile: dest=/etc/rsyslog.conf state=present + regexp="local0.* /var/log/haproxy.log" + line="local0.* /var/log/haproxy.log" + +- name: set rsyslog udp module + lineinfile: dest=/etc/rsyslog.conf state=present + regexp="^#$ModLoad imudp" + line="$ModLoad imudp" + +- name: set rsyslog udp port + lineinfile: dest=/etc/rsyslog.conf state=present + regexp="^#$UDPServerRun 514" + line="$UDPServerRun 514" + +- name: set keepalived start param + lineinfile: dest=/etc/default/keepalived state=present + regexp="^DAEMON_ARGS=*" + line="DAEMON_ARGS=\"-D -d -S 1\"" + when: ansible_os_family == "Debian" + +- name: set keepalived log + lineinfile: dest=/etc/rsyslog.conf state=present + regexp="local1.* /var/log/keepalived.log" + line="local1.* /var/log/keepalived.log" + +- name: update keepalived info + template: src=keepalived.conf dest=/etc/keepalived/keepalived.conf + notify: restart keepalived + +- name: restart rsyslog + shell: service rsyslog restart + +- meta: flush_handlers diff --git a/deploy/adapters/ansible/kubernetes/roles/ha/templates/haproxy.cfg b/deploy/adapters/ansible/kubernetes/roles/ha/templates/haproxy.cfg new file mode 100644 index 00000000..5cd240c0 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/ha/templates/haproxy.cfg @@ -0,0 +1,48 @@ + +global + #chroot /var/run/haproxy + daemon + user haproxy + group haproxy + maxconn 4000 + pidfile /var/run/haproxy/haproxy.pid + #log 127.0.0.1 local0 + tune.bufsize 1000000 + stats socket /var/run/haproxy.sock + stats timeout 2m + +defaults + log global + maxconn 8000 + option redispatch + option dontlognull + option splice-auto + timeout http-request 10s + timeout queue 1m + timeout connect 10s + timeout client 50s + timeout server 50s + timeout check 10s + retries 3 + +listen kubernetes-apiserver-https + bind {{ public_vip.ip }}:8383 + option ssl-hello-chk + mode tcp + option tcpka + option tcplog + timeout client 3h + timeout server 3h + balance roundrobin +{% for host,ip in haproxy_hosts.items() %} + server {{ host }} {{ ip }}:6443 weight 1 check inter 2000 rise 2 fall 5 +{% endfor %} + +listen stats + mode http + bind 0.0.0.0:9999 + stats enable + stats refresh 30s + stats uri / + stats realm Global\ statistics + stats auth admin:admin diff --git a/deploy/adapters/ansible/kubernetes/roles/ha/templates/keepalived.conf b/deploy/adapters/ansible/kubernetes/roles/ha/templates/keepalived.conf new file mode 100644 index 00000000..c649bed5 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/ha/templates/keepalived.conf @@ -0,0 +1,49 @@ +global_defs { + router_id {{ inventory_hostname }} +} + +vrrp_sync_group VG1 { + group { + internal_vip + public_vip + } +} + +vrrp_instance internal_vip { + interface {{ sys_intf_mappings.mgmt.interface }} + virtual_router_id {{ vrouter_id_internal }} + state BACKUP + nopreempt + advert_int 1 + priority {{ 50 + (host_index[inventory_hostname] * 50) }} + + authentication { + auth_type PASS + auth_pass 1234 + } + + + virtual_ipaddress { + {{ internal_vip.ip }}/{{ internal_vip.netmask }} dev {{ sys_intf_mappings.mgmt.interface }} + } +} + +vrrp_instance public_vip { + interface {{ sys_intf_mappings.external.interface }} + virtual_router_id {{ vrouter_id_public }} + state BACKUP + nopreempt + advert_int 1 + priority {{ 50 + (host_index[inventory_hostname] * 50) }} + + authentication { + auth_type PASS + auth_pass 4321 + } + + virtual_ipaddress { + {{ network_cfg.public_vip.ip }}/{{ network_cfg.public_vip.netmask }} dev {{ sys_intf_mappings.external.interface }} + } + +} + diff --git a/deploy/adapters/ansible/kubernetes/roles/ha/vars/Debian.yml b/deploy/adapters/ansible/kubernetes/roles/ha/vars/Debian.yml new file mode 100644 index 00000000..b9f46bdf --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/ha/vars/Debian.yml @@ -0,0 +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 +############################################################################## +--- +services: [] +packages: [] diff --git a/deploy/adapters/ansible/kubernetes/roles/ha/vars/RedHat.yml b/deploy/adapters/ansible/kubernetes/roles/ha/vars/RedHat.yml new file mode 100644 index 00000000..b9f46bdf --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/ha/vars/RedHat.yml @@ -0,0 +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 +############################################################################## +--- +services: [] +packages: [] diff --git a/deploy/adapters/ansible/kubernetes/roles/ha/vars/main.yml b/deploy/adapters/ansible/kubernetes/roles/ha/vars/main.yml new file mode 100644 index 00000000..77735d1e --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/ha/vars/main.yml @@ -0,0 +1,16 @@ +############################################################################## +# 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 +############################################################################## +--- +packages_noarch: + - keepalived + - haproxy + +services_noarch: + - keepalived + - haproxy diff --git a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/tasks/main.yml index 6487e4ef..af234415 100644 --- a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/tasks/main.yml @@ -9,6 +9,10 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: Install yum epel-release + command: yum -y install epel-release + when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' + - name: Install yum packages yum: pkg: "{{ item }}" @@ -20,5 +24,6 @@ apt: pkg: "{{ item }}" state: "present" - with_items: "{{ packages }}" + update_cache: 'yes' + with_items: "{{ vars['packages_' + ansible_architecture] }}" when: ansible_os_family == 'Debian' diff --git a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/Debian.yml b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/Debian.yml index e016b855..6be9e06f 100644 --- a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/Debian.yml +++ b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/Debian.yml @@ -1,13 +1,26 @@ --- -packages: +packages_x86_64: - ubuntu-cloud-keyring - python-dev + - python-pip - openvswitch-switch - openvswitch-switch-dpdk - python-memcache - python-iniparse - python-lxml - python-crypto + - git + +packages_aarch64: + - ubuntu-cloud-keyring + - python-dev + - python-pip + - openvswitch-switch + - python-memcache + - python-iniparse + - python-lxml + - python-crypto + - git pip_packages: - crudini diff --git a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/RedHat.yml b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/RedHat.yml index 3ec18e7f..1adf1dfc 100644 --- a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/RedHat.yml +++ b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/RedHat.yml @@ -1,6 +1,7 @@ --- packages: - python-devel + - python-pip - gcc - redhat-lsb-core - python-crypto @@ -10,7 +11,7 @@ packages: - lsof - strace - net-tools - + - git pip_packages: - crudini diff --git a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/main.yml b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/main.yml index 713b6b5f..7158325a 100644 --- a/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/install-k8s-dependence/vars/main.yml @@ -8,7 +8,6 @@ ############################################################################## --- packages_noarch: - - python-pip - ntp services_noarch: [] diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml index 26e3fa75..ae3dce76 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml @@ -3,7 +3,7 @@ # roles/download/defaults/main.yml etcd_version: v3.2.4-arm64 -flannel_version: "v0.8.0-arm64" +flannel_version: "v0.9.1-arm64" flannel_cni_image_repo: "linaro/flannel-cni-arm64" hyperkube_image_repo: "gcr.io/google-containers/hyperkube-arm64" hyperkube_image_tag: "{{ kube_version }}" @@ -14,20 +14,8 @@ dnsmasq_nanny_image_repo: "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-arm64" dnsmasq_sidecar_image_repo: "gcr.io/google_containers/k8s-dns-sidecar-arm64" kubednsautoscaler_image_repo: "gcr.io/google_containers/\ cluster-proportional-autoscaler-arm64" +dashboard_image_repo: "gcr.io/google_containers/kubernetes-dashboard-arm64" # inventory/group_vars/k8s-cluster.yml kube_network_plugin: flannel helm_enabled: false -docker_options: "--insecure-registry={{ kube_service_addresses }} \ ---graph={{ docker_daemon_graph }} {{ docker_log_opts }} \ ---add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \ ---default-runtime=docker-runc \ ---exec-opt native.cgroupdriver=systemd \ ---userland-proxy-path=/usr/libexec/docker/docker-proxy-current \ ---signature-verification=false" - -# roles/docker/vars/redhat.yml -docker_package_info: - pkg_mgr: yum - pkgs: - - name: docker diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml deleted file mode 100644 index e13e33ca..00000000 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Override default kubespray variables - -# Just a placeholder to satisfy ansible -dummy_var: 0 - -# helm_enabled: true diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/generate_inventories.py b/deploy/adapters/ansible/kubernetes/roles/kargo/files/generate_inventories.py deleted file mode 100755 index 2ffb4cae..00000000 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/generate_inventories.py +++ /dev/null @@ -1,86 +0,0 @@ -import yaml
-import sys
-import os
-from jinja2 import Environment
-try:
- import json
-except ImportError:
- import simplejson as json
-
-INVENTORY_TEMPLATE = """
-[all]
-{% for host, vales in hostvars.iteritems() %}
-{{ host }} ansible_ssh_host={{ vales['ansible_ssh_host'] }} \
-ansible_ssh_pass=root ansible_user=root
-{% endfor %}
-[kube-master]
-{% for host in kube_master %}
-{{ host }}
-{% endfor %}
-
-[etcd]
-{% for host in etcd %}
-{{ host }}
-{% endfor %}
-
-[kube-node]
-{% for host in kube_node %}
-{{ host }}
-{% endfor %}
-
-[k8s-cluster:children]
-kube-node
-kube-master
-
-[calico-rr]
-[vault]
-"""
-
-
-def _byteify(data, ignore_dicts=False):
-
- if isinstance(data, unicode):
- return data.encode('utf-8')
- if isinstance(data, list):
- return [_byteify(item, ignore_dicts=True) for item in data]
- if isinstance(data, dict) and not ignore_dicts:
- return {
- _byteify(key, ignore_dicts=True):
- _byteify(value, ignore_dicts=True)
- for key, value in data.iteritems()
- }
- return data
-
-
-def load_inventory(inventory):
- if not os.path.exists(inventory):
- raise RuntimeError('file: %s not exist' % inventory)
- with open(inventory, 'r') as fd:
- return json.load(fd, object_hook=_byteify)
-
-
-def create_inventory_file(inventories_path,
- hostvars, kube_master, etcd, kube_node):
- content = Environment().from_string(INVENTORY_TEMPLATE).render(
- hostvars=hostvars, kube_master=kube_master,
- etcd=etcd, kube_node=kube_node)
- with open(inventories_path, 'w+') as f:
- f.write(content)
-
-
-def main(inventories_path, local_inventory):
- inventory_data = load_inventory(local_inventory)
- hostvars = inventory_data['_meta']['hostvars']
- kube_node = inventory_data['kube_node']['hosts']
- kube_master = inventory_data['kube_master']['hosts']
- etcd = inventory_data['etcd']['hosts']
-
- create_inventory_file(inventories_path,
- hostvars, kube_master, etcd, kube_node)
-
-
-if __name__ == "__main__":
- path = yaml.load(sys.argv[1])
- local_inventory = yaml.load(sys.argv[2])
-
- main(path, local_inventory)
diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo b/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo index 1d622d3c..1d622d3c 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml index 2763e53e..512121e2 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml @@ -7,107 +7,165 @@ # 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: 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: copy inventories generate script - copy: - src: generate_inventories.py - dest: /tmp/generate_inventories.py +- name: generate kubespray inventory configure file + template: + src: "inventory.j2" + dest: "/opt/kargo_k8s/inventory/inventory.cfg" tags: - ansible -- name: copy inventoriy.json file +- name: copy overrided variables for arm architecture copy: - src: /var/ansible/run/kubernetes-opnfv2/inventories/inventory.json - dest: /tmp/inventory.json - tags: - - ansible + src: "{{ item }}" + dest: /opt/kargo_k8s/extra-vars.yml + with_first_found: + - extra-vars-{{ ansible_architecture }}.yml + - extra-vars.yml + - skip: true -- name: generate kargo inventories - shell: > - python /tmp/generate_inventories.py \ - "/opt/kargo_k8s/inventory/inventory.cfg" \ - "/tmp/inventory.json" +- 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: 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: copy 2flannel playbook to kargo + copy: + src: "{{ run_dir }}/roles/2flannel" + dest: /opt/kargo_k8s/roles/network_plugin + +- name: copy 2flannel-apps playbook to kargo + copy: + src: "{{ run_dir }}/roles/2flannel-apps/" + dest: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/2flannel -- name: enable helm +- name: append 2flannel to network plugin + blockinfile: + path: /opt/kargo_k8s/roles/network_plugin/meta/main.yml + block: " - role: network_plugin/2flannel\n \ + when: kube_network_plugin == '2flannel'\n tags: 2flannel\n" + +- name: append 2flannel apps to network plugin + blockinfile: + path: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/meta/main.yml + block: " - role: kubernetes-apps/network_plugin/2flannel\n \ + when: kube_network_plugin == '2flannel'\n tags: 2flannel\n" + +- name: append 2flannel to valid kube_network_plugin list + replace: + path: "/opt/kargo_k8s/roles/kubernetes/{{ item.path }}" + regexp: "{{ item.regexp }}" + replace: "{{ item.replace }}" + with_items: + - {path: 'master/templates/manifests/kube-controller-manager.manifest.j2', + regexp: '"cloud", "flannel"', + replace: '"cloud", "flannel", "2flannel"'} + - {path: 'node/templates/kubelet.kubeadm.env.j2', + regexp: '"calico", "canal", "flannel", "weave"', + replace: '"calico", "canal", "flannel", "weave", "2flannel"'} + - {path: 'node/templates/kubelet.standard.env.j2', + regexp: '"calico", "canal", "flannel", "weave"', + replace: '"calico", "canal", "flannel", "weave", "2flannel"'} + - {path: 'node/templates/kubelet.rkt.service.j2', + regexp: '"calico", "weave", "canal", "flannel"', + replace: '"calico", "weave", "canal", "flannel", "2flannel"'} + - {path: 'preinstall/tasks/main.yml', + regexp: '"calico", "weave", "canal", "flannel"', + replace: '"calico", "weave", "canal", "flannel", "2flannel"'} + +# yamllint disable rule:line-length +- name: enable CSI plugin feature + lineinfile: + dest: "/opt/kargo_k8s/roles/kubespray-defaults/defaults/main.yaml" + regexp: "^kube_feature_gates:" + line: "{% raw %}kube_feature_gates: ['Initializers={{ istio_enabled|string }}', 'PersistentLocalVolumes={{ local_volumes_enabled|string }}', 'CSIPersistentVolume=True', 'MountPropagation=True']{% endraw %}" + when: + - stor4nfv is defined and stor4nfv == "Enable" +# yamllint enable rule:line-length + +- name: enable CSI plugin runtime_config lineinfile: - dest: /opt/kargo_k8s/inventory/group_vars/k8s-cluster.yml - regexp: '^helm_enabled:' - line: 'helm_enabled: {{ helm_flag }}' + dest: /opt/kargo_k8s/roles/kubernetes/master/defaults/main.yml + insertafter: '^ - admissionregistration.k8s.io/v1alpha1' + line: ' - storage.k8s.io/v1alpha1' + when: + - stor4nfv is defined and stor4nfv == "Enable" -- name: copy overrided variables +- name: copy sriov playbook to kargo copy: - src: "{{ item }}" - dest: /opt/kargo_k8s/extra-vars.yml - with_first_found: - - extra-vars-{{ ansible_architecture }}.yml - - extra-vars.yml + src: "{{ run_dir }}/roles/sriov" + dest: /opt/kargo_k8s/roles/network_plugin + +- name: copy sriov-apps playbook to kargo + copy: + src: "{{ run_dir }}/roles/sriov-apps/" + dest: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/sriov + +- name: append sriov to network plugin + blockinfile: + path: /opt/kargo_k8s/roles/network_plugin/meta/main.yml + block: " - role: network_plugin/sriov\n when: kube_network_plugin == 'sriov'\n \ + tags: sriov\n" + +- name: append sriov apps to network plugin + blockinfile: + path: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/meta/main.yml + block: " - role: kubernetes-apps/network_plugin/sriov\n \ + when: kube_network_plugin == 'sriov'\n tags: sriov\n" + +- name: append sriov to valid kube_network_plugin list + replace: + path: "{{ item.path }}" + regexp: "{{ item.regexp }}" + replace: "{{ item.replace }}" + with_items: + - {path: "/opt/kargo_k8s/roles/kubernetes/master/templates/manifests/\ +kube-controller-manager.manifest.j2", + regexp: '"cloud", "flannel"', + replace: '"cloud", "flannel", "sriov"'} + - {path: '/opt/kargo_k8s/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2', + regexp: '"calico", "canal", "flannel", "weave"', + replace: '"calico", "canal", "flannel", "weave", "sriov"'} + - {path: '/opt/kargo_k8s/roles/kubernetes/node/templates/kubelet.standard.env.j2', + regexp: '"calico", "canal", "flannel", "weave"', + replace: '"calico", "canal", "flannel", "weave", "sriov"'} + - {path: '/opt/kargo_k8s/roles/kubernetes/node/templates/kubelet.rkt.service.j2', + regexp: '"calico", "weave", "canal", "flannel"', + replace: '"calico", "weave", "canal", "flannel", "sriov"'} + - {path: '/opt/kargo_k8s/roles/kubernetes/preinstall/tasks/main.yml', + regexp: '"calico", "weave", "canal", "flannel"', + replace: '"calico", "weave", "canal", "flannel", "sriov"'} - 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 2d396d06..af9c9675 100644..100755 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/vars/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/vars/main.yml @@ -1,2 +1,3 @@ --- -helm_flag: true +http_proxy: "{{ proxy }}" +https_proxy: "{{ proxy }}" diff --git a/deploy/adapters/ansible/kubernetes/roles/post-k8s/defaults/main.yml b/deploy/adapters/ansible/kubernetes/roles/post-k8s/defaults/main.yml new file mode 100644 index 00000000..aa9fd8a0 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/post-k8s/defaults/main.yml @@ -0,0 +1,11 @@ +--- + +local_release_dir: "/tmp/releases" +heapster_enable: true +retry_stagger: 5 +heapster: + enabled: true + owner: "root" + mode: "0755" + version: "1.5.2" +heapster_download_url: https://github.com/kubernetes/heapster/archive/v{{ heapster.version }}.tar.gz diff --git a/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml new file mode 100644 index 00000000..d382a5e1 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml @@ -0,0 +1,64 @@ +############################################################################## +# 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 +############################################################################## +--- + +- name: fetch admin.conf + fetch: + src: /etc/kubernetes/admin.conf + dest: /opt/admin.conf + flat: "yes" + when: inventory_hostname == groups['kube_master'][0] + +- name: Create heapster dest directory + file: + path: "{{local_release_dir}}/heapster" + state: directory + recurse: "yes" + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] + +- name: get the package of heapster + get_url: + url: "{{heapster_download_url}}" + dest: "{{local_release_dir}}/heapster" + owner: "{{ heapster.owner|default(omit) }}" + mode: "{{ heapster.mode|default(omit) }}" + register: get_url_result + until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg" + retries: 4 + delay: "{{ retry_stagger | random + 3 }}" + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] + +- name: untar the file of heapster + shell: | + cd "{{ local_release_dir }}/heapster"; + tar zxvf "heapster-{{ heapster.version }}.tar.gz" + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] + +- name: replace the cpu architecture for aarch64 + shell: | + cd "{{ local_release_dir }}/heapster/heapster-{{ heapster.version }}/deploy/"; + find ./kube-config -name "*.yaml" -exec sed -i "s/amd64/arm64/g" {} \; + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] + - ansible_architecture == "aarch64" + +- name: install the heapster + shell: | + cd "{{ local_release_dir }}/heapster/heapster-{{ heapster.version }}/deploy/"; + ./kube.sh start + when: + - heapster.enabled + - inventory_hostname == groups['kube_master'][0] diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/sources.list.official.aarch64 b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/sources.list.official.aarch64 new file mode 100644 index 00000000..f4a3f5e9 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/sources.list.official.aarch64 @@ -0,0 +1,54 @@ +# deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial main restricted + +# deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted +# deb http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial main restricted +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial universe +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial universe +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates universe +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial multiverse +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial multiverse +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates multiverse +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://us.ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted universe multiverse +deb-src http://us.ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu xenial partner +# deb-src http://archive.canonical.com/ubuntu xenial partner + +deb http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted +deb http://ports.ubuntu.com/ubuntu-ports xenial-security universe +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security universe +deb http://ports.ubuntu.com/ubuntu-ports xenial-security multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security multiverse diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/Ubuntu.yml b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/Ubuntu.yml index 8054267d..b4ef9278 100644 --- a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/Ubuntu.yml +++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/Ubuntu.yml @@ -62,13 +62,17 @@ - name: remove the space end of the line in the resolv.conf shell: "sed -i 's/ *$//' /etc/resolv.conf" +- name: remove estuary overlay and update apt cache + shell: rm -f /etc/apt/sources.list.d/estuary.list && apt-get update + when: ansible_architecture == "aarch64" + - name: change sources list copy: - src: sources.list.official + src: "{{ item }}" dest: /etc/apt/sources.list - -- name: update apt cache - apt: update_cache=yes + with_first_found: + - sources.list.official.{{ ansible_architecture }} + - sources.list.official - name: restart ntp service shell: "service ntp restart" diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/main.yml index 76203440..844d76a3 100644 --- a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/main.yml @@ -12,3 +12,9 @@ - include: "{{ ansible_os_family }}.yml" when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' + +- name: close the swap partition + shell: | + systemctl disable swap.target + systemctl mask swap.target + swapoff -a diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/vars/main.yml b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/vars/main.yml index b196bd25..6d6ecf44 100644 --- a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/vars/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/vars/main.yml @@ -1,21 +1,21 @@ --- aptpackages: -- bridge-utils -- debootstrap -- ifenslave -- ifenslave-2.6 -- lsof -- lvm2 -- ntp -- ntpdate -- sudo -- vlan -- tcpdump + - bridge-utils + - debootstrap + - ifenslave + - ifenslave-2.6 + - lsof + - lvm2 + - ntp + - ntpdate + - sudo + - vlan + - tcpdump yumpackages: -- bridge-utils -- iputils -- lvm2 -- ntp -- tcpdump -- vim + - bridge-utils + - iputils + - lvm2 + - ntp + - tcpdump + - vim diff --git a/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/tasks/RedHat.yml b/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/tasks/RedHat.yml index c59fdfc5..d32cf238 100644 --- a/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/tasks/RedHat.yml +++ b/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/tasks/RedHat.yml @@ -36,6 +36,17 @@ src: ifcfg-eth.j2 dest: /etc/sysconfig/network-scripts/ifcfg-{{sys_intf_mappings["external"]["interface"]}} +- name: generate ifcfg-sriov + template: + src: ifcfg-sriov.j2 + dest: /etc/sysconfig/network-scripts/ifcfg-{{ intf_sriov }} + when: intf_sriov|length > 0 + +- name: remove ifcfg-br-sriov script + file: + path: /etc/sysconfig/network-scripts/ifcfg-br-sriov + state: absent + - name: remove defualt gw lineinfile: dest: /etc/sysconfig/network @@ -45,6 +56,9 @@ - name: restart the network shell: systemctl restart network +- name: install python lib + shell: yum install -y python-yaml python-netaddr + - name: make sure python lib exist action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: diff --git a/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/templates/ifcfg-sriov.j2 b/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/templates/ifcfg-sriov.j2 new file mode 100644 index 00000000..c4005854 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/templates/ifcfg-sriov.j2 @@ -0,0 +1,12 @@ +DEVICE={{ intf_sriov }} +BOOTPROTO=none +ONBOOT=yes +IPADDR={{ ip_settings[inventory_hostname]["tenant"]["ip"] }} +NETMASK=255.255.255.0 +DEFROUTE="no" +{% if sys_intf_mappings["tenant"]["vlan_tag"] | int %} +{% set intf_vlan = "yes" %} +{% else %} +{% set intf_vlan = "no" %} +{% endif %} +VLAN={{ intf_vlan }} diff --git a/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/vars/main.yml b/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/vars/main.yml new file mode 100644 index 00000000..e525bf5c --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/setup-k8s-network/vars/main.yml @@ -0,0 +1,7 @@ +--- +intf_sriov: |- + {%- set intf_sriov = sys_intf_mappings["tenant"]["interface"] %} + {%- if sys_intf_mappings["tenant"]["vlan_tag"] | int %} + {%- set intf_sriov = intf_sriov + '.' + sys_intf_mappings["tenant"]["vlan_tag"]|string %} + {%- endif %} + {{- intf_sriov }} diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov-apps/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/sriov-apps/tasks/main.yml new file mode 100644 index 00000000..662fa7bf --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/sriov-apps/tasks/main.yml @@ -0,0 +1,20 @@ +# Copyright (C) 2018, ARM Limited and contributors. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +--- +- name: "Sriov | Create ServiceAccount ClusterRole and ClusterRoleBinding" + command: "{{ bin_dir }}/kubectl apply -f {{ kube_config_dir }}/cni-sriov-rbac.yml" + run_once: true + when: rbac_enabled and sriov_rbac_manifest.changed + +- name: Sriov | Create Network Resources + kube: + name: "kube-sriov" + kubectl: "{{ bin_dir }}/kubectl" + filename: "{{ kube_config_dir }}/cni-sriov.yml" + namespace: "{{system_namespace}}" + state: "{{ item | ternary('latest','present') }}" + with_items: "{{ sriov_manifest.changed }}" + when: inventory_hostname == groups['kube-master'][0] diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov/defaults/main.yml b/deploy/adapters/ansible/kubernetes/roles/sriov/defaults/main.yml new file mode 100644 index 00000000..44263956 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/sriov/defaults/main.yml @@ -0,0 +1,7 @@ +# Copyright (C) 2018, ARM Limited and contributors. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +--- +# Limits for apps diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov/handlers/main.yml b/deploy/adapters/ansible/kubernetes/roles/sriov/handlers/main.yml new file mode 100644 index 00000000..221279b1 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/sriov/handlers/main.yml @@ -0,0 +1,62 @@ +# Copyright (C) 2018, ARM Limited and contributors. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +--- +- name: Sriov | delete default docker bridge + command: ip link delete docker0 + failed_when: false + notify: Sriov | restart docker + +# special cases for atomic because it defaults to live-restore: true +# So we disable live-restore to pickup the new flannel IP. After +# we enable it, we have to restart docker again to pickup the new +# setting and restore the original behavior +- name: Sriov | restart docker + command: /bin/true + notify: + - Sriov | reload systemd + - Sriov | reload docker.socket + - Sriov | configure docker live-restore true (atomic) + - Sriov | reload docker + - Sriov | pause while Docker restarts + - Sriov | wait for docker + +- name: Sriov | reload systemd + shell: systemctl daemon-reload + +- name: Sriov | reload docker.socket + service: + name: docker.socket + state: restarted + when: ansible_os_family in ['CoreOS', 'Container Linux by CoreOS'] + +- name: Sriov | configure docker live-restore true (atomic) + replace: + name: /etc/docker/daemon.json + regexp: '"live-restore":.*true' + replace: '"live-restore": false' + when: is_atomic + +- name: Sriov | reload docker + service: + name: docker + state: restarted + +- name: Sriov | pause while Docker restarts + pause: + seconds: 10 + prompt: "Waiting for docker restart" + +- name: Sriov | wait for docker + command: "{{ docker_bin_dir }}/docker images" + register: docker_ready + retries: 10 + delay: 5 + until: docker_ready.rc == 0 + +- name: Sriov | reload kubelet + service: + name: kubelet + state: restarted diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/sriov/tasks/main.yml new file mode 100644 index 00000000..0e3e2f6d --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/sriov/tasks/main.yml @@ -0,0 +1,106 @@ +# Copyright (C) 2018, ARM Limited and contributors. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +--- +- name: Sriov | Verify if br_netfilter module exists + shell: "modinfo br_netfilter" + register: modinfo_br_netfilter + failed_when: modinfo_br_netfilter.rc not in [0, 1] + changed_when: false + +- name: Sriov | Enable br_netfilter module + modprobe: + name: br_netfilter + state: present + when: modinfo_br_netfilter.rc == 0 + +# kube-proxy needs net.bridge.bridge-nf-call-iptables enabled +# when found if br_netfilter is not a module +- name: Sriov | Check if bridge-nf-call-iptables key exists + command: "sysctl net.bridge.bridge-nf-call-iptables" + failed_when: false + changed_when: false + register: sysctl_bridge_nf_call_iptables + +- name: Sriov | Enable bridge-nf-call tables + sysctl: + name: "{{ item }}" + state: present + value: 1 + reload: "yes" + when: modinfo_br_netfilter.rc == 1 and sysctl_bridge_nf_call_iptables.rc == 0 + with_items: + - net.bridge.bridge-nf-call-iptables + - net.bridge.bridge-nf-call-arptables + - net.bridge.bridge-nf-call-ip6tables + +- name: Sriov | Install Multus CNI + shell: |- + /usr/bin/docker run --rm --network=host -v /opt/cni/bin/:/opt/cni/bin/ golang:1.9 \ + bash -c "git clone https://github.com/Intel-Corp/multus-cni && cd multus-cni \ + && ./build && cp bin/multus /opt/cni/bin" + +- name: Sriov | Install Sriov CNI + shell: |- + /usr/bin/docker run --rm --network=host -v /opt/cni/bin/:/opt/cni/bin/ golang:1.9 \ + bash -c "git clone https://github.com/hustcat/sriov-cni && cd sriov-cni \ + && ./build && cp bin/sriov /opt/cni/bin" + +- name: Sriov | Install Flannel CNI + shell: |- + /usr/bin/docker run --rm --network=host -v /opt/cni/bin/:/host/opt/cni/bin/ \ + {{ flannel_cni_image_repo }}:{{ flannel_cni_image_tag }} \ + sh -c "cp /opt/cni/bin/* /host/opt/cni/bin/" + +- name: Sriov | Remove all file in /etc/cni/net.d + shell: |- + rm -rf /etc/cni/net.d/ + mkdir -p /etc/cni/net.d/ + +- name: Sriov | Generate Sriov CNI Conf + copy: + content: | + { + "name": "minion-cni-network", + "type": "multus", + "kubeconfig": "/etc/kubernetes/node-kubeconfig.yaml", + "delegates": [ + { + "type": "flannel", + "masterplugin": true, + "delegate": { + "isDefaultGateway": true + } + } + ] + } + dest: "/etc/cni/net.d/multus-cni.conf" + owner: root + group: root + mode: 0644 + +- name: Sriov | Enable DHCP CNI + shell: /opt/cni/bin/dhcp daemon & + + +- name: Sriov | Create cni-sriov-rbac manifest + template: + src: cni-sriov-rbac.yml.j2 + dest: "{{ kube_config_dir }}/cni-sriov-rbac.yml" + register: sriov_rbac_manifest + when: inventory_hostname == groups['kube-master'][0] and rbac_enabled + +- name: Sriov | Create cni-sriov manifest + template: + src: cni-sriov.yml.j2 + dest: "{{ kube_config_dir }}/cni-sriov.yml" + register: sriov_manifest + when: inventory_hostname == groups['kube-master'][0] + +- name: Sriov | Sriov tests manifest + template: + src: sriov-test-pod.yml + dest: "{{ kube_config_dir }}/sriov-test-pod.yml" + when: inventory_hostname == groups['kube-master'][0] diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov-rbac.yml.j2 b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov-rbac.yml.j2 new file mode 100644 index 00000000..0ce663b1 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov-rbac.yml.j2 @@ -0,0 +1,49 @@ +# Copyright (C) 2018, ARM Limited and contributors. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: sriov + namespace: "{{system_namespace}}" +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: sriov +rules: + - apiGroups: + - "" + resources: + - pods + verbs: + - get + - apiGroups: + - "" + resources: + - nodes + verbs: + - list + - watch + - apiGroups: + - "" + resources: + - nodes/status + verbs: + - patch +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: sriov +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: sriov +subjects: +- kind: ServiceAccount + name: sriov + namespace: "{{system_namespace}}" diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov.yml.j2 b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov.yml.j2 new file mode 100644 index 00000000..3a9e819b --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/cni-sriov.yml.j2 @@ -0,0 +1,166 @@ +# Copyright (C) 2018, ARM Limited and contributors. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: network.kubernetes.com +spec: + group: kubernetes.com + version: v1 + scope: Namespaced + names: + plural: networks + singular: network + kind: Network + shortNames: + - net +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: flannel + namespace: {{system_namespace}} +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: kube-flannel-cfg + namespace: {{system_namespace}} + labels: + tier: node + app: flannel +data: + cni-conf.json: | + { + "name": "cbr0", + "type": "flannel", + "delegate": { + "isDefaultGateway": true + } + } + net-conf.json: | + { + "Network": "10.244.0.0/16", + "Backend": { + "Type": "udp" + } + } +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: kube-flannel-ds + namespace: {{system_namespace}} + labels: + tier: node + app: flannel +spec: + template: + metadata: + labels: + tier: node + app: flannel + spec: + hostNetwork: true + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + serviceAccountName: flannel + containers: + - name: kube-flannel + image: {{ flannel_image_repo }}:{{ flannel_image_tag }} + imagePullPolicy: {{ k8s_image_pull_policy }} + command: [ "/opt/bin/flanneld", "--ip-masq", "--kube-subnet-mgr" ] + securityContext: + privileged: true + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + volumeMounts: + - name: run + mountPath: /run + - name: flannel-cfg + mountPath: /etc/kube-flannel/ + volumes: + - name: run + hostPath: + path: /run + - name: flannel-cfg + configMap: + name: kube-flannel-cfg +--- +apiVersion: "kubernetes.com/v1" +kind: Network +metadata: + name: flannel-conf + namespace: default +plugin: flannel +args: '[ + { + "masterplugin": true, + "delegate": { + "isDefaultGateway": true + } + } +]' +--- +apiVersion: "kubernetes.com/v1" +kind: Network +metadata: + name: sriov-conf1 + namespace: default +plugin: sriov +args: '[ + { + "master": "eth1.101", + "pfOnly": true, + "ipam": { + "type": "host-local", + "subnet": "192.168.123.0/24", + "rangeStart": "192.168.123.11", + "rangeEnd": "192.168.123.21", + "routes": [ + { + "dst": "0.0.0.0/0" + } + ], + "gateway": "192.168.123.1" + } + } +]' +--- +apiVersion: "kubernetes.com/v1" +kind: Network +metadata: + name: sriov-conf2 + namespace: default +plugin: sriov +args: '[ + { + "master": "eth1.101", + "pfOnly": true, + "ipam": { + "type": "host-local", + "subnet": "192.168.123.0/24", + "rangeStart": "192.168.123.31", + "rangeEnd": "192.168.123.41", + "routes": [ + { + "dst": "0.0.0.0/0" + } + ], + "gateway": "192.168.123.1" + } + } +]' diff --git a/deploy/adapters/ansible/kubernetes/roles/sriov/templates/sriov-test-pod.yml b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/sriov-test-pod.yml new file mode 100644 index 00000000..849aca85 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/sriov/templates/sriov-test-pod.yml @@ -0,0 +1,51 @@ +# Copyright (C) 2018, ARM Limited and contributors. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +--- +apiVersion: v1 +kind: Pod +metadata: + name: multus-test1 + annotations: + networks: '[ + { "name": "flannel-conf" }, + { "name": "sriov-conf1" } + ]' +spec: + containers: + - name: multus-test + image: "busybox" + command: ["top"] + stdin: true + tty: true + nodeSelector: + kubernetes.io/hostname: "host1" + tolerations: + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoSchedule" +--- +apiVersion: v1 +kind: Pod +metadata: + name: multus-test2 + annotations: + networks: '[ + { "name": "flannel-conf" }, + { "name": "sriov-conf2" } + ]' +spec: + containers: + - name: multus-test + image: "busybox" + command: ["top"] + stdin: true + tty: true + nodeSelector: + kubernetes.io/hostname: "host2" + tolerations: + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoSchedule" diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index f923d0d3..152a7dc0 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -45,6 +45,8 @@ - compute - utility - neutron_server + - ceilometer_all + - horizon_all remote_user: root roles: - post-osa @@ -56,6 +58,13 @@ - collectd - hosts: + - controller + remote_user: root + roles: + - influxdb + - grafana + +- hosts: - neutron_openvswitch_agent - compute remote_user: root @@ -97,6 +106,8 @@ - hosts: - utility_all[0] - network_hosts[0] + - horizon + - compute remote_user: root roles: - post-openstack @@ -110,3 +121,10 @@ remote_user: root roles: - moon + +- hosts: + - ceph_adm + - ceph-mon + remote_user: root + roles: + - os-stor4nfv diff --git a/deploy/adapters/ansible/openstack_pike/README.md b/deploy/adapters/ansible/openstack_pike/README.md index 7682d325..8a5b5765 100644 --- a/deploy/adapters/ansible/openstack_pike/README.md +++ b/deploy/adapters/ansible/openstack_pike/README.md @@ -1 +1,10 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # keep for openstack pike diff --git a/deploy/adapters/ansible/openstack_queens/README.md b/deploy/adapters/ansible/openstack_queens/README.md new file mode 100644 index 00000000..bea43534 --- /dev/null +++ b/deploy/adapters/ansible/openstack_queens/README.md @@ -0,0 +1,10 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# keep for openstack queens diff --git a/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 b/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 index b23550f9..e7b79436 100644 --- a/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 +++ b/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 @@ -64,13 +64,13 @@ iface br-external inet static gateway {{ ip_settings[inventory_hostname]["external"]["gw"] }} offload-sg off # Create veth pair, don't bomb if already exists - pre-up ip link add br-vlan-veth type veth peer name eth12 || true + pre-up ip link add external-veth type veth peer name external-nic || true # Set both ends UP - pre-up ip link set br-vlan-veth up - pre-up ip link set eth12 up + pre-up ip link set external-veth up + pre-up ip link set external-nic up # Delete veth pair on DOWN - post-down ip link del br-vlan-veth || true - bridge_ports br-vlan-veth + post-down ip link del external-veth || true + bridge_ports external-veth # VXLAN (tunnel/overlay) bridge config auto br-tenant diff --git a/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 b/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 index 4e444eca..99d62876 100755 --- a/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 +++ b/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 @@ -62,6 +62,15 @@ iface br-external inet static address {{ ip_settings[inventory_hostname]["external"]["ip"] }} netmask 255.255.255.0 gateway {{ ip_settings[inventory_hostname]["external"]["gw"] }} + offload-sg off + # Create veth pair, don't bomb if already exists + pre-up ip link add external-veth type veth peer name external-nic || true + # Set both ends UP + pre-up ip link set external-veth up + pre-up ip link set external-nic up + # Delete veth pair on DOWN + post-down ip link del external-veth || true + bridge_ports external-veth # OpenStack Networking VXLAN (tunnel/overlay) bridge # @@ -71,11 +80,13 @@ iface br-external inet static # bridge. # auto br-tenant -iface br-tenant inet manual +iface br-tenant inet static bridge_stp off bridge_waitport 0 bridge_fd 0 bridge_ports {{ intf_tenant }} + address {{ ip_settings[inventory_hostname]["tenant"]["ip"] }} + netmask 255.255.255.0 # Storage bridge auto br-storage diff --git a/deploy/adapters/ansible/roles/config-osa/files/chrony.conf.j2 b/deploy/adapters/ansible/roles/config-osa/files/chrony.conf.j2 index 1c2443e0..d58f9115 100644 --- a/deploy/adapters/ansible/roles/config-osa/files/chrony.conf.j2 +++ b/deploy/adapters/ansible/roles/config-osa/files/chrony.conf.j2 @@ -98,7 +98,5 @@ rtconutc # Listen for NTP requests only on local interfaces. port 0 bindcmdaddress 127.0.0.1 -{% if not security_disable_ipv6 | bool %} bindcmdaddress ::1 {% endif %} -{% endif %} diff --git a/deploy/adapters/ansible/roles/config-osa/files/collect-log.sh b/deploy/adapters/ansible/roles/config-osa/files/collect-log.sh new file mode 100755 index 00000000..7f51a2c3 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/collect-log.sh @@ -0,0 +1,17 @@ +#!/bin/bash +############################################################################## +# 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 +############################################################################## + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_PATH="$(dirname $(realpath ${BASH_SOURCE[0]}))" + +openstack-ansible $SCRIPT_PATH/collect-log.yml diff --git a/deploy/adapters/ansible/roles/config-osa/files/collect-log.yml b/deploy/adapters/ansible/roles/config-osa/files/collect-log.yml new file mode 100644 index 00000000..6e6f9e5a --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/collect-log.yml @@ -0,0 +1,32 @@ +--- +############################################################################## +# 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 +############################################################################## + +- name: Collect log + hosts: rsyslog[0] + user: root + tasks: + - name: ensure log directory exist + stat: + path: /var/log/log-storage + register: log_dir + + - name: compress log directory + archive: + path: "{{ log_dir.stat.path }}" + dest: "{{ log_dir.stat.path }}/log.tar.gz" + format: gz + when: log_dir.stat.exists is defined and log_dir.stat.exists + + - name: fetch the log tarball + fetch: + src: "{{ log_dir.stat.path }}/log.tar.gz" + dest: /opt/log.tar.gz + flat: "yes" + when: log_dir.stat.exists is defined and log_dir.stat.exists diff --git a/deploy/adapters/ansible/roles/config-osa/files/haproxy.yml b/deploy/adapters/ansible/roles/config-osa/files/haproxy.yml index 3085f6aa..a0a09e49 100644 --- a/deploy/adapters/ansible/roles/config-osa/files/haproxy.yml +++ b/deploy/adapters/ansible/roles/config-osa/files/haproxy.yml @@ -261,3 +261,14 @@ haproxy_default_services: haproxy_backend_options: - "httpchk GET /" haproxy_whitelist_networks: "{{ haproxy_octavia_whitelist_networks }}" + + - service: + haproxy_service_name: tacker + haproxy_backend_nodes: "{{ groups['tacker_all'] | default([]) }}" + haproxy_ssl: "{{ haproxy_ssl }}" + haproxy_port: 9890 + haproxy_balance_type: http + haproxy_backend_options: + - "forwardfor" + - "httpchk" + - "httplog" 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/files/polling.yaml b/deploy/adapters/ansible/roles/config-osa/files/polling.yaml new file mode 100644 index 00000000..631e3687 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/polling.yaml @@ -0,0 +1,6 @@ +--- +sources: + - name: all_pollsters + interval: 300 + meters: + - "*" diff --git a/deploy/adapters/ansible/roles/config-osa/files/redhat-7.yml b/deploy/adapters/ansible/roles/config-osa/files/redhat-7.yml new file mode 100644 index 00000000..ccfe7da2 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/redhat-7.yml @@ -0,0 +1,5 @@ +--- + +tacker_distro_packages: + - rsync + - git-core diff --git a/deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml b/deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml index 9d5f13a9..6daa1436 100644 --- a/deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml +++ b/deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml @@ -14,3 +14,13 @@ cinder_backends: rbd_user: cinder rbd_secret_uuid: "{{ cinder_ceph_client_uuid }}" report_discard_supported: true + +gnocchi_storage_driver: ceph +gnocchi_ceph_pool: "metrics" +ceph_extra_components: + - component: gnocchi_api + package: + - "{{ python_ceph_package }}" + client: + - '{{ gnocchi_ceph_client }}' + service: '{{ ceph_gnocchi_service_names }}' diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/fix_pip_version.yml b/deploy/adapters/ansible/roles/config-osa/tasks/fix_pip_version.yml index 61d263b4..6ec8425b 100644 --- a/deploy/adapters/ansible/roles/config-osa/tasks/fix_pip_version.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/fix_pip_version.yml @@ -18,8 +18,15 @@ regexp: '^ - python-ldap' line: ' - python-ldap==2.5.2' -- name: add pkgconfig in gnocchi requires pip packages +- name: add pbr in gnocchi requires pip packages lineinfile: dest: /etc/ansible/roles/repo_build/defaults/main.yml insertafter: "repo_pip_packages:" - line: ' - pkgconfig' + line: ' - pbr' + +- name: create user config file to control pip version + copy: + content: | + pip_packages: + - pip==9.0.1 + dest: /etc/openstack_deploy/user_fixpip.yml diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/fix_rescue.yml b/deploy/adapters/ansible/roles/config-osa/tasks/fix_rescue.yml index ff7d4250..c73aceb7 100644 --- a/deploy/adapters/ansible/roles/config-osa/tasks/fix_rescue.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/fix_rescue.yml @@ -28,7 +28,7 @@ - name: fix rescue problem for lxc-hosts-setup blockinfile: - dest: "/opt/openstack-ansible/playbooks/lxc-hosts-setup.yml" + dest: "/opt/openstack-ansible/playbooks/containers-lxc-host.yml" block: | - hosts: localhost user: root @@ -38,7 +38,7 @@ - name: delete max_fail_percentage for lxc-hosts-setup lineinfile: - dest: "/opt/openstack-ansible/playbooks/lxc-hosts-setup.yml" + dest: "/opt/openstack-ansible/playbooks/containers-lxc-host.yml" regexp: "max_fail_percentage*" state: absent diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml index f9eef749..ab2714a9 100755 --- a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml @@ -163,7 +163,7 @@ - name: remove repo_build_pip_no_binary lineinfile: - dest: /opt/openstack-ansible/group_vars/repo_all.yml + dest: /opt/openstack-ansible/inventory/group_vars/repo_all.yml state: absent regexp: "{{ item }}" with_items: ['^repo_build_pip_no_binary:', '^ - libvirt-python'] @@ -332,16 +332,105 @@ when: - "{{ hostvars[inventory_hostname]['groups']['controller'] | length < 2 }}" +- name: copy collect-log.sh to /opt + copy: + src: collect-log.sh + dest: /opt/collect-log.sh + +- name: copy collect-log.yml to /opt + copy: + src: collect-log.yml + dest: /opt/collect-log.yml + # - name: change repore build # lineinfile: # dest: /etc/ansible/roles/repo_build/tasks/main.yml # insertafter: "^- include: repo_post_build.yml" # line: "- include: repo_fix_pandas.yml" -- include: meters.yml +- include: fix_rescue.yml -# upstream has fix this issue so somments it -# maybe will use in the furture -- include: fix_pip_version.yml +- name: rm command "rm -f /etc/resolv.conf" in cache_prep_commands + lineinfile: + dest: /etc/ansible/roles/lxc_hosts/vars/ubuntu-16.04.yml + regexp: 'rm -f /etc/resolv.conf$' + line: ' echo "ok"' + backrefs: 'yes' -- include: fix_rescue.yml +- name: add command "rm /etc/resolv.conf || true" in cache_prep_commands + lineinfile: + dest: /etc/ansible/roles/lxc_hosts/vars/ubuntu-16.04.yml + insertafter: '^ cache_prep_commands:' + line: ' rm /etc/resolv.conf || true' + +- name: 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/config-osa/tasks/meters.yml b/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml index 8f06a884..ca85f440 100644 --- a/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml @@ -9,7 +9,7 @@ --- - name: modify the aodh haproxy config copy: - dest: /opt/openstack-ansible/group_vars/all/haproxy.yml + dest: /opt/openstack-ansible/inventory/group_vars/all/haproxy.yml src: haproxy.yml mode: 0664 @@ -69,3 +69,15 @@ [database]{% raw %} connection = mysql+pymysql://{{ ceilometer_galera_user }}:{{ ceilometer_container_db_password }}@{{ceilometer_galera_address }}/{{ ceilometer_galera_database }}?charset=utf86{% endraw %} # yamllint enable rule:line-length + +- name: make sure the directory exist + file: + dest: /etc/openstack_deploy/ceilometer + state: directory + mode: 0755 + +- name: copy the polling.yml + copy: + dest: /etc/openstack_deploy/ceilometer/polling.yaml + src: polling.yaml + mode: 0644 diff --git a/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 index 130b5ad1..dd45bd1a 100644 --- a/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 +++ b/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 @@ -26,11 +26,16 @@ haproxy_keepalived_internal_vip_cidr: "{{ internal_vip.ip }}/32" haproxy_keepalived_external_interface: br-external haproxy_keepalived_internal_interface: br-mgmt keepalived_ping_address: "{{ ntp_server }}" +lxc_host_machine_volume_size: 16 cinder_cinder_conf_overrides: oslo_middleware: enable_proxy_headers_parsing: True +neutron_neutron_conf_overrides: + oslo_middleware: + enable_proxy_headers_parsing: True + nfs_file_gw: False {% if "openvswitch" == NEUTRON_MECHANISM_DRIVERS[0] or @@ -45,6 +50,11 @@ neutron_plugin_type: ml2.ovs neutron_ml2_drivers_type: "local,flat,{{ tenant_net_info['type'] }}" +neutron_plugin_base: + - router + - metering + - trunk + neutron_provider_networks: network_flat_networks: "*" network_types: "{{ tenant_net_info['type'] }}" @@ -66,3 +76,6 @@ security_sshd_permit_root_login: yes security_ntp_servers: - {{ ntp_server }} + +tacker_etc_dir: "/etc/tacker" +nova_spicehtml5_git_repo: https://gitlab.freedesktop.org/spice/spice-html5.git diff --git a/deploy/adapters/ansible/roles/config-osa/vars/main.yml b/deploy/adapters/ansible/roles/config-osa/vars/main.yml index 0b3b0c1e..7daf40c9 100644 --- a/deploy/adapters/ansible/roles/config-osa/vars/main.yml +++ b/deploy/adapters/ansible/roles/config-osa/vars/main.yml @@ -11,3 +11,6 @@ LOCAL_REPOSITORY_IP: "192.168.137.222" ceph_host: "{{ hostvars[inventory_hostname]['groups']['ceph_osd'][0] }}" repo_dest_path: "/var/www/repo/os-releases/15.1.4/ubuntu-16.04-x86_64/" networking_sfc_version: 4.0.0 +# yamllint disable rule:line-length +openstack_release: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" +# yamllint enable rule:line-length diff --git a/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch b/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch new file mode 100644 index 00000000..198ff5be --- /dev/null +++ b/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch @@ -0,0 +1,12 @@ +--- manager.py 2018-11-07 03:51:22.764685289 -0800 ++++ manager.py.new 2018-11-07 03:58:21.014139558 -0800 +@@ -314,8 +314,7 @@ + if self._events is None: + # NOTE(danms): We really should have a more specific error + # here, but this is what we use for our default error case +- raise exception.NovaException('In shutdown, no new events ' +- 'can be scheduled') ++ self._events = {} + + @utils.synchronized(self._lock_name(instance)) + def _create_or_get_event(): diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml index 7022a4b5..2a63acf0 100644 --- a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml +++ b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml @@ -40,6 +40,7 @@ --subnet-range "{{ public_net_info.floating_ip_cidr }}" \ "{{ public_net_info.subnet }}" when: + - public_net_info.enable == "True" - inventory_hostname == groups['utility_all'][0] - name: create openstack flavors @@ -68,3 +69,24 @@ flat: "yes" when: - inventory_hostname == groups['network_hosts'][0] + +# yamllint disable rule:line-length +- name: fix horizon upload image issue + lineinfile: + dest: "/openstack/venvs/horizon-{{ openstack_release }}/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py" + regexp: "^HORIZON_IMAGES_UPLOAD_MODE" + line: "HORIZON_IMAGES_UPLOAD_MODE = 'legacy'" + when: + - inventory_hostname in groups['horizon'] +# yamllint enable rule:line-length + +- name: restart apache2 + service: + name: apache2 + state: restarted + when: + - inventory_hostname in groups['horizon'] + +- include: nova_patch.yml + when: + - inventory_hostname in groups['compute'] diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml new file mode 100644 index 00000000..d9cfad9c --- /dev/null +++ b/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml @@ -0,0 +1,23 @@ +############################################################################## +# Copyright (c) 2016-2018 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +- name: copy manager.py.patch + copy: + src: manager.py.patch + dest: /openstack/venvs/nova-{{ openstack_release }}/lib/python2.7/site-packages/nova/compute + +- name: patch manager.py.patch + shell: + patch -p0 < manager.py.patch + args: + chdir: /openstack/venvs/nova-{{ openstack_release }}/lib/python2.7/site-packages/nova/compute + +- name: restart nova-compute + shell: + systemctl restart nova-compute diff --git a/deploy/adapters/ansible/roles/post-openstack/vars/main.yml b/deploy/adapters/ansible/roles/post-openstack/vars/main.yml index d9c36d42..1fc2cc27 100644 --- a/deploy/adapters/ansible/roles/post-openstack/vars/main.yml +++ b/deploy/adapters/ansible/roles/post-openstack/vars/main.yml @@ -43,3 +43,7 @@ flavors: vcpus: 8 ram: 16384 disk: 160 + +# yamllint disable rule:line-length +openstack_release: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" +# yamllint enable rule:line-length diff --git a/deploy/adapters/ansible/roles/post-osa/files/sfc.conf b/deploy/adapters/ansible/roles/post-osa/files/sfc.conf index ce42c9e1..b200f254 100755 --- a/deploy/adapters/ansible/roles/post-osa/files/sfc.conf +++ b/deploy/adapters/ansible/roles/post-osa/files/sfc.conf @@ -1,6 +1,6 @@ [DEFAULT] -service_plugins = router,metering,flow_classifier,sfc +service_plugins = router,metering,flow_classifier,sfc,trunk [sfc] drivers = ovs diff --git a/deploy/adapters/ansible/roles/post-osa/handlers/main.yml b/deploy/adapters/ansible/roles/post-osa/handlers/main.yml index 3d979e6a..d685edca 100755 --- a/deploy/adapters/ansible/roles/post-osa/handlers/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/handlers/main.yml @@ -9,3 +9,17 @@ - name: restart network service shell: "/sbin/ifconfig eth0 0 &&/sbin/ifdown -a && \ /sbin/ifup --ignore-errors -a" + +- name: Restart ceilometer services + service: + name: "{{ item.0.service_name }}" + enabled: "yes" + state: "restarted" + with_subelements: + - "{{ ceilometer_services }}" + - group + when: inventory_hostname in groups[item.1] + register: _restart + until: _restart | success + retries: 5 + delay: 2 diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml b/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml new file mode 100755 index 00000000..3d991b74 --- /dev/null +++ b/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml @@ -0,0 +1,28 @@ +############################################################################# +# 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 +############################################################################## +--- +- name: check for gnocchi resource file + stat: + path: "/etc/ceilometer/gnocchi_resources.yaml" + register: gnocchi_resource_file + +- name: get the path of ceilometer-upgrade + shell: "find / -name ceilometer-upgrade 2>/dev/null || true" + register: ceilometer_upgrade_path + +- name: Initialize Gnocchi database by creating ceilometer resources + command: "{{ ceilometer_upgrade_path.stdout }} --skip-metering-database" + become: "yes" + when: gnocchi_resource_file.stat.exists + register: _upgrade + until: _upgrade | success + retries: 10 + delay: 2 + notify: + - Restart ceilometer services 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 fbed5815..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,8 +2,8 @@ - name: install networking-sfc pip: - name: networking-sfc - virtualenv: /openstack/venvs/neutron-15.1.4 + name: networking-sfc==6.0.0.0rc1 + virtualenv: /openstack/venvs/neutron-{{ os_ver }} when: - inventory_hostname in groups['neutron_server'] @@ -11,14 +11,12 @@ package: name: crudini state: latest - when: - - inventory_hostname in groups['neutron_server'] - name: Install networking-sfc for CLI pip: name: networking-sfc when: - - inventory_hostname in groups['utility'] + - inventory_hostname not in groups['neutron_server'] - name: turn off neutron-server on control node service: name=neutron-server state=stopped @@ -35,13 +33,18 @@ shell: crudini --merge /etc/neutron/neutron.conf < /opt/sfc.conf when: inventory_hostname in groups['neutron_server'] +- name: Configure SFC extension on compute nodes + shell: crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini \ + agent extensions sfc; + when: inventory_hostname in groups['compute'] + - name: delete sfc.conf shell: rm -rf {{ sfc_plugins.dst }} when: inventory_hostname in groups['neutron_server'] - name: Perform a Neutron DB online upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade --expand @@ -51,7 +54,7 @@ - name: Perform a Neutron DB offline upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade --contract @@ -61,7 +64,7 @@ - name: SFC DB upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --subproject networking-sfc upgrade head become: "yes" diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml index bd83b50f..e7e4c37d 100644 --- a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml @@ -11,15 +11,25 @@ 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 -# when: -# - odl_sfc is not defined or odl_sfc == "Disable" -# - inventory_hostname not in groups['compute'] -# when: ansible_distribution == 'Ubuntu' +- include: install_networking_sfc.yml + when: + - opendaylight is not defined or opendaylight == "Disable" + - inventory_hostname not in groups['horizon_all'] - include: "{{ ansible_os_family }}.yml" when: - ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' - inventory_hostname in groups['compute'] + +- include: ceilometer-upgrade.yml + when: + - inventory_hostname in groups['ceilometer_all'] + +- include: tacker_horizon.yml + when: inventory_hostname in groups['horizon_all'] + +- include: novaclient_workaround.yml + when: inventory_hostname in groups['utility'] diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/novaclient_workaround.yml b/deploy/adapters/ansible/roles/post-osa/tasks/novaclient_workaround.yml new file mode 100644 index 00000000..40ec608d --- /dev/null +++ b/deploy/adapters/ansible/roles/post-osa/tasks/novaclient_workaround.yml @@ -0,0 +1,6 @@ +--- + +- name: use python-novaclient version 9.0.0 to replace 10.2.0 + pip: + name: python-novaclient + version: 9.0.0 diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml b/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml new file mode 100644 index 00000000..2c1d2d87 --- /dev/null +++ b/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml @@ -0,0 +1,33 @@ +--- + +- name: remove tacker-horizon directory + file: + path: "{{ tacker_horizon_dir }}" + state: absent + +- name: get tacker horizon (online) + git: + repo: "{{ tacker_horizon_repo }}" + dest: "{{ tacker_horizon_dir }}" + version: "{{ tacker_horizon_branch }}" + when: offline_deployment is defined and offline_deployment == "Disable" + +- name: copy installation script (offline) + get_url: + url: "http://{{ offline_repo_ip }}:{{ offline_repo_port }}/tacker-horizon.tar.gz" + dest: "/opt/" + when: offline_deployment is defined and offline_deployment == "Enable" + +- name: untar tacker-horizon tarball + command: su -s /bin/sh -c "tar xzf /opt/tacker-horizon.tar.gz -C /opt/" + when: offline_deployment is defined and offline_deployment == "Enable" + +- name: install tacker-horizon + shell: | + cd /opt/tacker-horizon/; + pip install -r requirements.txt; + sleep 30; + python setup.py install; + cp tacker_horizon/enabled/* \ + {{ tacker_horizon_enable_path }}/; + service apache2 restart diff --git a/deploy/adapters/ansible/roles/post-osa/vars/main.yml b/deploy/adapters/ansible/roles/post-osa/vars/main.yml index da886028..7aed0472 100644 --- a/deploy/adapters/ansible/roles/post-osa/vars/main.yml +++ b/deploy/adapters/ansible/roles/post-osa/vars/main.yml @@ -1,5 +1,19 @@ --- +# yamllint disable rule:line-length +os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" +# yamllint enable rule:line-length +os_name: queens + +# yamllint disable rule:line-length +tacker_horizon_repo: https://github.com/openstack/tacker-horizon.git +tacker_horizon_dir: /opt/tacker-horizon +tacker_horizon_branch: "stable/{{ os_name }}" +openstack_release: "{{ os_ver }}" +tacker_horizon_venv: "/openstack/venvs/horizon-{{ openstack_release }}" +tacker_horizon_enable_path: "{{ tacker_horizon_venv }}/lib/python2.7/site-packages/openstack_dashboard/enabled" +# yamllint enable rule:line-length + sfc_plugins: src: sfc.conf dst: /opt/sfc.conf @@ -24,3 +38,14 @@ intf_storage: |- {%- set intf_storage = intf_storage + '.' + compu_sys_mappings["storage"]["vlan_tag"]|string %} {%- endif %} {{- intf_storage }} + +ceilometer_services: + ceilometer-agent-notification: + group: + - ceilometer_agent_notification + service_name: ceilometer-agent-notification + ceilometer-polling: + group: + - ceilometer_agent_central + - ceilometer_agent_compute + service_name: ceilometer-polling diff --git a/deploy/adapters/ansible/roles/process-openrc/tasks/main.yml b/deploy/adapters/ansible/roles/process-openrc/tasks/main.yml index aed68b88..d8de1b2d 100644 --- a/deploy/adapters/ansible/roles/process-openrc/tasks/main.yml +++ b/deploy/adapters/ansible/roles/process-openrc/tasks/main.yml @@ -24,3 +24,9 @@ dest: /opt/openrc regexp: "internalURL" replace: "publicURL" + +- name: add the IP of SDN controller + lineinfile: + dest: /opt/openrc + state: present + line: "export SDN_CONTROLLER_IP={{ public_vip['ip'] }}" diff --git a/deploy/adapters/ansible/roles/setup-host/tasks/Ubuntu.yml b/deploy/adapters/ansible/roles/setup-host/tasks/Ubuntu.yml index 00675d9c..5d9cded0 100644 --- a/deploy/adapters/ansible/roles/setup-host/tasks/Ubuntu.yml +++ b/deploy/adapters/ansible/roles/setup-host/tasks/Ubuntu.yml @@ -8,7 +8,7 @@ # ############################################################################# --- - name: setup hosts - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_queens-opnfv2/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible setup-hosts.yml \ @@ -19,7 +19,7 @@ register: failed_container - name: destroy the failed_container - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_queens-opnfv2/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible lxc-containers-destroy.yml \ @@ -30,7 +30,7 @@ ignore_errors: "True" - name: retry to setup failed_container - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_queens-opnfv2/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible setup-hosts.yml --limit {{item}} \ diff --git a/deploy/adapters/ansible/roles/setup-host/tasks/main.yml b/deploy/adapters/ansible/roles/setup-host/tasks/main.yml index 4eba3d00..0a63f7f5 100644 --- a/deploy/adapters/ansible/roles/setup-host/tasks/main.yml +++ b/deploy/adapters/ansible/roles/setup-host/tasks/main.yml @@ -10,7 +10,7 @@ --- - name: openstack-hosts-setup - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH={{ run_dir }}/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible openstack-hosts-setup.yml \ @@ -25,7 +25,7 @@ when: openstack_hosts_setup_result.stdout.find('Mark openstack-hosts-setup completed') == -1 - name: security-hardening - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH={{ run_dir }}/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible security-hardening.yml \ @@ -40,7 +40,7 @@ when: security_hardening_result.stdout.find('Mark security-hardening completed') == -1 - name: lxc-hosts-setup - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH={{ run_dir }}/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible lxc-hosts-setup.yml \ @@ -55,7 +55,7 @@ when: lxc_hosts_setup_result.stdout.find('Mark lxc-hosts-setup completed') == -1 - name: lxc-containers-create - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH={{ run_dir }}/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible lxc-containers-create.yml \ @@ -66,7 +66,7 @@ register: failed_container - name: destroy the failed_container - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH={{ run_dir }}/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible lxc-containers-destroy.yml \ @@ -77,7 +77,7 @@ ignore_errors: "True" - name: retry to setup failed_container - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH={{ run_dir }}/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible lxc-containers-create.yml --limit {{item}} \ diff --git a/deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml b/deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml index 7cf5c86f..4e3a926f 100644 --- a/deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml +++ b/deploy/adapters/ansible/roles/setup-infrastructure/tasks/main.yml @@ -8,7 +8,7 @@ ############################################################################## --- - name: setup infrastructure - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH={{ run_dir }}/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible setup-infrastructure.yml \ diff --git a/deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml index a6ecb82f..c572936d 100644 --- a/deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml +++ b/deploy/adapters/ansible/roles/setup-openstack/tasks/main.yml @@ -8,7 +8,7 @@ ############################################################################## --- - name: setup openstack - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_pike-opnfv2/ansible.log; \ + shell: "export ANSIBLE_LOG_PATH={{ run_dir }}/ansible.log; \ export ANSIBLE_SCP_IF_SSH=y; \ cd /opt/openstack-ansible/playbooks; \ openstack-ansible setup-openstack.yml \ diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/handlers/main.yml b/deploy/adapters/ansible/roles/setup-openvswitch/handlers/main.yml index fb7814b7..58a1710c 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/handlers/main.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/handlers/main.yml @@ -6,6 +6,11 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################ --- +- name: restart network service + service: + name: networking + state: restarted + - name: restart neutron-openvswitch-agent service: name: neutron-openvswitch-agent diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/compute.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/compute.yml index 43c6689f..670eea75 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/compute.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/compute.yml @@ -50,7 +50,7 @@ when: - compute in item["role"] -- name: start neutron-openvswitch-agent +- name: restart neutron-openvswitch-agent service: name: neutron-openvswitch-agent - state: started + state: restarted diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml index 3637d1db..726cb545 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/controller.yml @@ -50,7 +50,27 @@ when: - controller in item["role"] +- name: configure interfaces ubuntu + template: + src: controller.j2 + dest: /etc/network/interfaces + notify: + - restart network service + - name: start neutron-openvswitch-agent service: name: neutron-openvswitch-agent - state: started + state: restarted + +- name: update keepalived + replace: + dest: /etc/keepalived/keepalived.conf + regexp: 'br-external' + replace: 'br-provider' + +- meta: flush_handlers + +- name: restart keepalived + service: + name: keepalived + state: restarted diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml index 87e508ca..0ad47d3c 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml @@ -10,9 +10,19 @@ - include: controller.yml when: - inventory_hostname not in groups['nova_compute'] - - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or "opendaylight" + - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" - include: compute.yml when: - inventory_hostname in groups['nova_compute'] - - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or "opendaylight" + - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" + +- include_vars: "{{ ansible_os_family }}.yml" + when: + - odl_sfc is not defined or odl_sfc != "Enable" + - NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight" + +- include: odl.yml + when: + - odl_sfc is not defined or odl_sfc != "Enable" + - NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight" diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml new file mode 100644 index 00000000..9c96a46a --- /dev/null +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml @@ -0,0 +1,25 @@ +############################################################################# +# Copyright (c) 2017-2018 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################# +--- +- name: uninstall ovs for odl + apt: + name: "{{ item.name }}" + state: absent + with_items: "{{ ovs_pkgs }}" + +- name: download ovs pkgs + get_url: + url: "{{ item.url }}" + dest: "/tmp/{{ item.package }}" + with_items: "{{ ovs_pkgs }}" + +- name: install ovs pkgs + shell: + dpkg -i "/tmp/{{ item.package }}" + with_items: "{{ ovs_pkgs }}" diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/templates/controller.j2 b/deploy/adapters/ansible/roles/setup-openvswitch/templates/controller.j2 new file mode 100755 index 00000000..bdc4d447 --- /dev/null +++ b/deploy/adapters/ansible/roles/setup-openvswitch/templates/controller.j2 @@ -0,0 +1,90 @@ +# This file describes the network interfaces available on your system +# and how to activate them. For more information, see interfaces(5). + +# The loopback network interface +auto lo +iface lo inet loopback + +# Physical interface +auto eth0 +iface eth0 inet manual + +# external interface +{% set intf_external = contr_sys_mappings["external"]["interface"] %} +{% if contr_sys_mappings["external"]["vlan_tag"] | int %} +{% set intf_external = intf_external + '.' + contr_sys_mappings["external"]["vlan_tag"]|string %} +{% endif %} +auto {{ intf_external }} +iface {{ intf_external }} inet manual +{% if contr_sys_mappings["external"]["vlan_tag"] | int %} + vlan-raw-device {{ intf_external }} +{% endif %} + +# tenant interface +{% set intf_tenant = contr_sys_mappings["tenant"]["interface"] %} +{% if contr_sys_mappings["tenant"]["vlan_tag"] | int %} +{% set intf_tenant = intf_tenant + '.' + contr_sys_mappings["tenant"]["vlan_tag"]|string %} +{% endif %} +auto {{ intf_tenant }} +iface {{ intf_tenant }} inet manual +{% if contr_sys_mappings["tenant"]["vlan_tag"] | int %} + vlan-raw-device {{ intf_tenant }} +{% endif %} + +# storage interface +{% set intf_storage = contr_sys_mappings["storage"]["interface"] %} +{% if contr_sys_mappings["storage"]["vlan_tag"] | int %} +{% set intf_storage = intf_storage + '.' + contr_sys_mappings["storage"]["vlan_tag"]|string %} +{% endif %} +auto {{ intf_storage }} +iface {{ intf_storage }} inet manual +{% if contr_sys_mappings["storage"]["vlan_tag"] | int %} + vlan-raw-device {{ intf_storage }} +{% endif %} + +# Container/Host management bridge +auto br-mgmt +iface br-mgmt inet static + bridge_stp off + bridge_waitport 0 + bridge_fd 0 + bridge_ports eth0 + address {{ ip_settings[inventory_hostname]["mgmt"]["ip"] }} + netmask 255.255.255.0 + +# OpenStack Networking VLAN bridge +auto br-provider +iface br-provider inet static + address {{ ip_settings[inventory_hostname]["external"]["ip"] }} + netmask 255.255.255.0 + gateway {{ ip_settings[inventory_hostname]["external"]["gw"] }} + pre-up ifconfig br-external down || true + pre-up brctl delbr br-external || true + +# OpenStack Networking VXLAN (tunnel/overlay) bridge +# +# Only the COMPUTE and NETWORK nodes must have an IP address +# on this bridge. When used by infrastructure nodes, the +# IP addresses are assigned to containers which use this +# bridge. +# +auto br-tenant +iface br-tenant inet static + bridge_stp off + bridge_waitport 0 + bridge_fd 0 + bridge_ports {{ intf_tenant }} + address {{ ip_settings[inventory_hostname]["tenant"]["ip"] }} + netmask 255.255.255.0 + +# Storage bridge +auto br-storage +iface br-storage inet static + bridge_stp off + bridge_waitport 0 + bridge_fd 0 + bridge_ports {{ intf_storage }} + address {{ ip_settings[inventory_hostname]["storage"]["ip"] }} + netmask 255.255.255.0 + +source /etc/network/interfaces.d/*.cfg diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml b/deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml index b6bd95a8..72c410ca 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml @@ -1,3 +1,16 @@ --- ovs_service: openvswitch-switch + +# yamllint disable rule:line-length +ovs_pkgs: + - openvswitch-common: + name: openvswitch-common + package: openvswitch-common.deb + url: http://archive.ubuntu.com/ubuntu/pool/main/o/openvswitch/openvswitch-common_2.8.0-0ubuntu2_amd64.deb + + - openvswitch-switch: + name: openvswitch-switch + package: openvswitch-switch.deb + url: http://archive.ubuntu.com/ubuntu/pool/main/o/openvswitch/openvswitch-switch_2.8.0-0ubuntu2_amd64.deb +# yamllint enable rule:line-length diff --git a/deploy/adapters/ansible/roles/storage/vars/main.yml b/deploy/adapters/ansible/roles/storage/vars/main.yml index cbee9c1e..d6c5961a 100644 --- a/deploy/adapters/ansible/roles/storage/vars/main.yml +++ b/deploy/adapters/ansible/roles/storage/vars/main.yml @@ -7,7 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -host_loopback_ceph_size: "100G" +host_loopback_ceph_size: "500G" rc_local_insert_before: "^exit 0$" bootstrap_host_data_disk_device: null bootstrap_host_data_disk_device_force: "no" diff --git a/deploy/adapters/cobbler/kickstarts/default16-aarch64.seed b/deploy/adapters/cobbler/kickstarts/default16-aarch64.seed new file mode 100644 index 00000000..e3e11f36 --- /dev/null +++ b/deploy/adapters/cobbler/kickstarts/default16-aarch64.seed @@ -0,0 +1,177 @@ +# Mostly based on the Ubuntu installation guide +# https://help.ubuntu.com/12.04/installation-guide/ + +## Figure out if we're kickstarting a system or a profile +#if $getVar('system_name','') != '' +#set $what = "system" +#else +#set $what = "profile" +#end if + +# Preseeding only locale sets language, country and locale. +d-i debian-installer/locale string en_US +d-i debian-installer/country string US +d-i debian-installer/language string en + +d-i debian-installer/splash boolean false +d-i debian-installer/quiet boolean false +d-i debian-installer/framebuffer boolean true +d-i hw-detect/load_firmware boolean true + +# Keyboard selection. +# Disable automatic (interactive) keymap detection. +d-i console-setup/ask_detect boolean false +d-i console-setup/layoutcode string us +d-i console-setup/modelcode string SKIP +d-i keyboard-configuration/variantcode string us +d-i keyboard-configuration/layoutcode string us +d-i keyboard-configuration/model select Generic 105-key (Intl) PC +d-i console-keymaps-at/keymap select us +d-i keyboard-configuration/xkb-keymap select us + +d-i preseed/early_command string \ +wget -O- \ +http://$http_server/cblr/svc/op/script/$what/$name/?script=preseed_early_default | /bin/sh -s; \ +debconf-set-selections /tmp/pre_install_network_config + +$SNIPPET('preseed_network_config') + +# Partition disk manually +d-i partman-auto/disk string /dev/sda +d-i partman-auto/method string regular +d-i partman-lvm/device_remove_lvm boolean true +d-i partman-md/device_remove_md boolean true +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + +d-i partman-auto/choose_recipe select efi-root +d-i partman-auto/expert_recipe string \ + efi-root :: \ + 512 512 512 fat32 \ + $primary{ } $lvmignore{ } \ + method{ efi } format{ } \ + . \ + 4096 4096 -1 ext4 \ + method{ format } format{ } \ + use_filesystem{ } filesystem{ ext4 } \ + mountpoint{ / } \ + . + +d-i partman-basicfilesystems/no_swap boolean false + +d-i partman/confirm_write_new_label boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + +# NTP/Time Setup +#if $getVar('timezone', '') != "" +d-i time/zone string $timezone +#else +d-i time/zone string US/Pacific +#end if +d-i clock-setup/utc boolean true +d-i clock-setup/ntp boolean true +#if $getVar('ntp_server', '') == "" +d-i clock-setup/ntp-server string 0.ubuntu.pool.ntp.org +#else +d-i clock-setup/ntp-server string $ntp_server +#end if + +# Setup the installation source +d-i mirror/country string manual +d-i mirror/http/hostname string $http_server +d-i mirror/http/directory string $install_source_directory +d-i mirror/http/proxy string +d-i mirror/http/mirror select $http_server +d-i mirror/protocol select http +d-i mirror/udeb/components multiselect main, restricted + +#set $os_v = $getVar('os_version','') +#if $os_v and $os_v.lower()[0] > 'p' +# Required at least for 12.10+ +d-i live-installer/net-image string http://$http_server/cobbler/ks_mirror/$distro_name/install/filesystem.squashfs +#end if + +# root account and password +#if $getVar('username', 'root') != "root" +d-i passwd/root-login boolean false +d-i passwd/make-user boolean true +d-i user-setup/allow-password-weak boolean true +d-i passwd/root-password password root +d-i passwd/root-password-again password root + #set username = $getVar('username', 'root') +d-i passwd/user-fullname string $username +d-i passwd/username string $username + #if $getVar('password', '') != "" +d-i passwd/user-password-crypted password $password + #else +d-i passwd/user-password password $username +d-i passwd/user-password-again password $username + #end if +#else +d-i passwd/root-login boolean true +d-i passwd/make-user boolean false +d-i user-setup/allow-password-weak boolean true + #if $getVar('password', '') != "" +d-i passwd/root-password-crypted password $password + #else +d-i passwd/root-password password root +d-i passwd/root-password-again password root + #end if +#end if + +$SNIPPET('preseed_apt_repo_config') + +# Individual additional packages to install +# wget is REQUIRED otherwise quite a few things won't work +# later in the build (like late-command scripts) +#if $getVar('tool', '') != '' + #set $preseed_software = "preseed_software_%s" % $tool +$SNIPPET($preseed_software) +#else +d-i pkgsel/include string ntp ssh openssh-server wget vim bridge-utils ifenslave vlan +#end if + +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none +d-i popularity-contest/participate boolean false +d-i lilo-installer/skip boolean true +d-i grub-installer/only_debian boolean true + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +d-i debian-installer/add-kernel-opts string $kernel_options_post +d-i debian-installer/allow_unauthenticated string true + +d-i finish-install/late_command string update-grub +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +d-i cdrom-detect/eject boolean false + +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +# d-i preseed/late_command string [command] +d-i preseed/late_command string \ +in-target sed -i '$a UseDNS no' /etc/ssh/sshd_config; \ +in-target sed -i 's/.*GSSAPIAuthentication.*/GSSAPIAuthentication no/g' /etc/ssh/sshd_config; \ +in-target sed -i '$d' /usr/share/initramfs-tools/scripts/local-top/lvm2; \ +in-target echo "lvm vgchange -ay" >> /usr/share/initramfs-tools/scripts/local-top/lvm2; \ +in-target echo "exit 0" >> /usr/share/initramfs-tools/scripts/local-top/lvm2; \ +in-target touch /etc/initramfs-tools/scripts/local-top/lvm2; \ +in-target chmod 777 /etc/initramfs-tools/scripts/local-top/lvm2; \ +in-target echo "vgchange -a y" >> /etc/initramfs-tools/scripts/local-top/lvm2; \ +wget -O- \ + http://$http_server/cblr/svc/op/script/$what/$name/?script=preseed_late_default | \ + chroot /target /bin/sh -s; cp /target/etc/network/interfaces /etc/network/interfaces; \ +in-target update-initramfs -k `uname -r` -c; \ +in-target update-grub; \ +in-target apt-get install python2.7; \ +in-target ln -s /usr/bin/python2.7 /usr/bin/python diff --git a/deploy/adapters/cobbler/snippets/kickstart_client.rb b/deploy/adapters/cobbler/snippets/kickstart_client.rb index 568ba46a..a890272a 100644 --- a/deploy/adapters/cobbler/snippets/kickstart_client.rb +++ b/deploy/adapters/cobbler/snippets/kickstart_client.rb @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + mkdir -p /etc/chef cat << EOL > /etc/chef/client.rb log_level :info diff --git a/deploy/adapters/cobbler/snippets/kickstart_knife.rb b/deploy/adapters/cobbler/snippets/kickstart_knife.rb index e4ab081b..aca3d5c0 100644 --- a/deploy/adapters/cobbler/snippets/kickstart_knife.rb +++ b/deploy/adapters/cobbler/snippets/kickstart_knife.rb @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + mkdir -p /root/.chef cat << EOL > /root/.chef/knife.rb log_level :info diff --git a/deploy/adapters/cobbler/snippets/kickstart_sysctl.conf b/deploy/adapters/cobbler/snippets/kickstart_sysctl.conf index c227ecfa..112f010d 100644 --- a/deploy/adapters/cobbler/snippets/kickstart_sysctl.conf +++ b/deploy/adapters/cobbler/snippets/kickstart_sysctl.conf @@ -59,7 +59,6 @@ net.ipv4.ip_local_port_range = 15000 61000 net.ipv4.tcp_fin_timeout=30 # fast cycling of sockets in time_wait state and re-using them -net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 # increase the maximum number of requests queued to a listen socket diff --git a/deploy/adapters/cobbler/snippets/preseed_knife.rb b/deploy/adapters/cobbler/snippets/preseed_knife.rb index 32047bbc..fa9a808d 100644 --- a/deploy/adapters/cobbler/snippets/preseed_knife.rb +++ b/deploy/adapters/cobbler/snippets/preseed_knife.rb @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + mkdir -p /root/.chef cat << EOL > /root/.chef/knife.rb log_level :info diff --git a/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config b/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config index 6ea56c56..591313b5 100644 --- a/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config +++ b/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config @@ -29,6 +29,8 @@ $SNIPPET($repos_snippet) #if $arch == "x86_64" #set $rarch = "[arch=amd64]" +#elif $arch == "arm" + #set $rarch = "[arch=arm64]" #else #set $rarch = "[arch=%s]" % $arch #end if diff --git a/deploy/adapters/cobbler/snippets/preseed_sysctl.conf b/deploy/adapters/cobbler/snippets/preseed_sysctl.conf index c227ecfa..112f010d 100644 --- a/deploy/adapters/cobbler/snippets/preseed_sysctl.conf +++ b/deploy/adapters/cobbler/snippets/preseed_sysctl.conf @@ -59,7 +59,6 @@ net.ipv4.ip_local_port_range = 15000 61000 net.ipv4.tcp_fin_timeout=30 # fast cycling of sockets in time_wait state and re-using them -net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 # increase the maximum number of requests queued to a listen socket diff --git a/deploy/adapters/cobbler/snippets/sysctl.xml b/deploy/adapters/cobbler/snippets/sysctl.xml index fe13bf7f..42f95976 100644 --- a/deploy/adapters/cobbler/snippets/sysctl.xml +++ b/deploy/adapters/cobbler/snippets/sysctl.xml @@ -62,7 +62,6 @@ net.ipv4.ip_local_port_range = 15000 61000 net.ipv4.tcp_fin_timeout=30 # fast cycling of sockets in time_wait state and re-using them -net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 # increase the maximum number of requests queued to a listen socket diff --git a/deploy/playbook_done.py b/deploy/ansible_plugins/callback/playbook_done.py index 6b1043d4..4784ff63 100644 --- a/deploy/playbook_done.py +++ b/deploy/ansible_plugins/callback/playbook_done.py @@ -17,6 +17,8 @@ """Ansible playbook callback after a playbook run has completed.""" import sys +from distutils.version import LooseVersion +from ansible import __version__ as __ansible_version__ from ansible.plugins.callback import CallbackBase compass_bin = "/opt/compass/bin" @@ -85,7 +87,10 @@ class CallbackModule(CallbackBase): return def v2_playbook_on_stats(self, stats): - all_vars = self.play.get_variable_manager().get_vars(self.loader) + if LooseVersion(__ansible_version__) < LooseVersion("2.4"): + all_vars = self.play.get_variable_manager().get_vars(self.loader) + else: + all_vars = self.play.get_variable_manager().get_vars() host_vars = all_vars["hostvars"] hosts = sorted(stats.processed.keys()) cluster_name = host_vars[hosts[0]]['cluster_name'] diff --git a/deploy/status_callback.py b/deploy/ansible_plugins/callback/status_callback.py index f0615f3f..b87d2094 100644 --- a/deploy/status_callback.py +++ b/deploy/ansible_plugins/callback/status_callback.py @@ -8,9 +8,11 @@ ############################################################################## import httplib -import json +import simplejson as json import sys # noqa:F401 +from distutils.version import LooseVersion +from ansible import __version__ as __ansible_version__ from ansible.plugins.callback import CallbackBase COMPASS_HOST = "compass-deck" @@ -101,7 +103,10 @@ class CallbackModule(CallbackBase): def v2_playbook_on_stats(self, stats): self._display.display("playbook_on_stats enter") - all_vars = self.play.get_variable_manager().get_vars(self.loader) + if LooseVersion(__ansible_version__) < LooseVersion("2.4"): + all_vars = self.play.get_variable_manager().get_vars(self.loader) + else: + all_vars = self.play.get_variable_manager().get_vars() host_vars = all_vars["hostvars"] hosts = sorted(stats.processed.keys()) cluster_name = host_vars[hosts[0]]['cluster_name'] diff --git a/deploy/ansible_plugins/lookup/yamlfile.py b/deploy/ansible_plugins/lookup/yamlfile.py new file mode 100644 index 00000000..489dccce --- /dev/null +++ b/deploy/ansible_plugins/lookup/yamlfile.py @@ -0,0 +1,64 @@ +#!/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 + +compass_bin = "/opt/compass/bin" +sys.path.append(compass_bin) +import switch_virtualenv # noqa: F401 + +from ansible.errors import AnsibleError # noqa: E402 +from ansible.plugins.lookup import LookupBase # noqa: E402 + + +class LookupModule(LookupBase): + + def read_yaml(self, yaml_path, key, default=None): + if not key: + return None + + with open(yaml_path) as fd: + yaml_data = yaml.safe_load(fd) + + if key in yaml_data: + return yaml_data[key] + else: + return default + + def run(self, terms, variables=None, **kwargs): + res = [] + if not isinstance(terms, list): + terms = [terms] + + for term in terms: + params = term.split() + yaml_path = params[0] + + param_dict = { + 'key': None, + 'default': None + } + + try: + for param in params[1:]: + key, value = param.split('=') + assert(key in param_dict) + param_dict[key] = value + except (AttributeError, AssertionError), e: + raise AnsibleError(e) + + data = self.read_yaml(yaml_path, + param_dict['key'], + param_dict['default']) + res.append(data) + + return res 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 910aa7f8..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, @@ -399,17 +402,20 @@ class CompassClient(object): except: raise RuntimeError('subnet %s format is invalid' % subnet) - if CONF.expansion == "false": + subnet_exist = False + for subnet_in_db in subnets_in_db: + if subnet == subnet_in_db['subnet']: + subnet_mapping[subnet] = subnet_in_db['id'] + subnet_exist = True + break + + if not subnet_exist: status, resp = self.client.add_subnet(subnet) LOG.info('add subnet %s status %s response %s', subnet, status, resp) if not self.is_ok(status): raise RuntimeError('failed to add subnet %s' % subnet) subnet_mapping[resp['subnet']] = resp['id'] - else: - for subnet_in_db in subnets_in_db: - if subnet == subnet_in_db['subnet']: - subnet_mapping[subnet] = subnet_in_db['id'] self.subnet_mapping = subnet_mapping @@ -475,8 +481,8 @@ class CompassClient(object): if host['hostname'] in hostnames: self.host_mapping[host['hostname']] = host['id'] - if CONF.expansion == "false": - assert(len(self.host_mapping) == len(machines)) + # if CONF.expansion == "false": + # assert(len(self.host_mapping) == len(machines)) def set_cluster_os_config(self, cluster_id): """set cluster os config.""" @@ -800,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( @@ -971,8 +983,6 @@ class CompassClient(object): ansible_log = "%s/work/deploy/docker/ansible/run/%s-%s/ansible.log" \ % (compass_dir, CONF.adapter_name, CONF.cluster_name) os.system("sudo touch %s" % ansible_log) - os.system("sudo chmod +x -R %s/work/deploy/docker/ansible/run/" - % compass_dir) ansible_print = multiprocessing.Process(target=print_log, args=(ansible_log,)) ansible_print.start() diff --git a/deploy/compass_conf/adapter/ansible_kubernetes.conf b/deploy/compass_conf/adapter/ansible_kubernetes.conf index 70e5564c..e2af8aff 100644 --- a/deploy/compass_conf/adapter/ansible_kubernetes.conf +++ b/deploy/compass_conf/adapter/ansible_kubernetes.conf @@ -3,5 +3,5 @@ DISPLAY_NAME = 'Kubernetes' PARENT = 'general' PACKAGE_INSTALLER = 'ansible_installer_kubernetes' OS_INSTALLER = 'cobbler' -SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04\.3', '(?i)CentOS-7.*17.*', '(?i)CentOS-7.*arm.*'] +SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04\.3', '(?i)CentOS-7.*17.*', '(?i)CentOS-7.*arm.*', '(?i)ubuntu-16.*arm.*'] DEPLOYABLE = True diff --git a/deploy/compass_conf/adapter/ansible_openstack_queens.conf b/deploy/compass_conf/adapter/ansible_openstack_queens.conf new file mode 100755 index 00000000..d8ac426f --- /dev/null +++ b/deploy/compass_conf/adapter/ansible_openstack_queens.conf @@ -0,0 +1,7 @@ +NAME = 'openstack_queens' +DISPLAY_NAME = 'Openstack Queens' +PARENT = 'openstack' +PACKAGE_INSTALLER = 'ansible_installer_queens' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04\.3', '(?i)CentOS-7.*17.*'] +DEPLOYABLE = True diff --git a/deploy/compass_conf/flavor/kubernetes.conf b/deploy/compass_conf/flavor/kubernetes.conf index 35c43155..2e808a83 100755 --- a/deploy/compass_conf/flavor/kubernetes.conf +++ b/deploy/compass_conf/flavor/kubernetes.conf @@ -4,8 +4,6 @@ FLAVORS = [{ 'display_name': 'ansible-kubernetes', 'template': 'ansible-kubernetes.tmpl', 'roles': [ - 'kube_master', 'etcd', 'kube_node' + 'kube_master', 'etcd', 'kube_node', 'ha', 'storage_master', 'storage_node', 'opencontrail' ], }] - - diff --git a/deploy/compass_conf/flavor/openstack_queens.conf b/deploy/compass_conf/flavor/openstack_queens.conf new file mode 100755 index 00000000..3f2294d4 --- /dev/null +++ b/deploy/compass_conf/flavor/openstack_queens.conf @@ -0,0 +1,32 @@ +ADAPTER_NAME = 'openstack_queens' +FLAVORS = [{ + 'flavor': 'allinone', + 'display_name': 'All-In-One', + 'template': 'allinone.tmpl', + 'roles': ['allinone-compute'], +}, { + 'flavor': 'single-controller', + 'display_name': 'Single Controller', + 'template': 'single-controller.tmpl', + 'roles': [ + 'controller', 'compute', 'network', 'storage', 'odl', 'onos' + ], +}, { + 'flavor': 'multinodes', + 'display_name': 'Multi-nodes', + 'template': 'multinodes.tmpl', + 'roles': [ + 'compute-controller', 'compute-worker', 'network-server', + 'network-worker', 'database', 'messaging', 'image', 'odl', + 'dashboard', 'identity', 'storage-controller', 'storage-volume' + ], +}, { + 'flavor': 'HA-ansible-multinodes-queens', + 'display_name': 'HA-ansible-multinodes-queens', + 'template': 'HA-ansible-multinodes.tmpl', + 'roles': [ + 'controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph', 'ceph-adm', 'ceph-mon', 'ceph-osd', 'ceph-osd-node', 'moon' + ], +}] + + diff --git a/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-ocata.conf b/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-ocata.conf index 5771a645..cb467eee 100755 --- a/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-ocata.conf +++ b/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-ocata.conf @@ -13,51 +13,51 @@ CONFIG_MAPPING = { "config": { "rabbitmq": { "username": "guest", - "password": "guest" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "identity": { "username": "keystone", - "password": "keystone" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "alarming": { "username": "aodh", - "password": "aodh" + "password": "" }, "network": { "username": "neutron", - "password": "neutron" + "password": "" }, "mysql": { "username": "root", - "password": "root" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" }, "heat": { "username": "heat", - "password": "heat" + "password": "" }, "policy": { "username": "congress", - "password": "congress" + "password": "" } } } @@ -72,51 +72,51 @@ CONFIG_MAPPING = { "config":{ "admin": { "username": "admin", - "password": "admin" + "password": "" }, "demo": { "username": "demo", - "password": "demo" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "identity": { "username": "keystone", - "password": "keystone" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "alarming": { "username": "aodh", - "password": "aodh" + "password": "" }, "network": { "username": "quantum", - "password": "quantum" + "password": "" }, "object-store": { "username": "swift", - "password": "swift" + "password": "" }, "heat": { "username": "heat", - "password": "heat" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } diff --git a/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-pike.conf b/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-pike.conf index d108c9b5..a205a5ed 100755 --- a/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-pike.conf +++ b/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-pike.conf @@ -13,51 +13,51 @@ CONFIG_MAPPING = { "config": { "rabbitmq": { "username": "guest", - "password": "guest" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "identity": { "username": "keystone", - "password": "keystone" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "alarming": { "username": "aodh", - "password": "aodh" + "password": "" }, "network": { "username": "neutron", - "password": "neutron" + "password": "" }, "mysql": { "username": "root", - "password": "root" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" }, "heat": { "username": "heat", - "password": "heat" + "password": "" }, "policy": { "username": "congress", - "password": "congress" + "password": "" } } } @@ -72,51 +72,51 @@ CONFIG_MAPPING = { "config":{ "admin": { "username": "admin", - "password": "admin" + "password": "" }, "demo": { "username": "demo", - "password": "demo" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "identity": { "username": "keystone", - "password": "keystone" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "alarming": { "username": "aodh", - "password": "aodh" + "password": "" }, "network": { "username": "quantum", - "password": "quantum" + "password": "" }, "object-store": { "username": "swift", - "password": "swift" + "password": "" }, "heat": { "username": "heat", - "password": "heat" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } diff --git a/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-queens.conf b/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-queens.conf new file mode 100755 index 00000000..d287bf58 --- /dev/null +++ b/deploy/compass_conf/flavor_mapping/HA-ansible-multinodes-queens.conf @@ -0,0 +1,124 @@ +ADAPTER = 'openstack_queens' +FLAVOR = 'HA-ansible-multinodes-queens' +CONFIG_MAPPING = { + "mapped_name": "flavor_config", + "mapped_children": [{ + "security": { + "accordion_heading": "OpenStack Database and Queue Credentials", + "category": "service_credentials", + "data_structure": "table", + "action": "true", + "modifiable_data": ["username", "password"], + "table_display_header": ["Service", "UserName", "Password", "Action"], + "config": { + "rabbitmq": { + "username": "guest", + "password": "" + }, + "compute": { + "username": "nova", + "password": "" + }, + "dashboard": { + "username": "dashboard", + "password": "" + }, + "identity": { + "username": "keystone", + "password": "" + }, + "image": { + "username": "glance", + "password": "" + }, + "metering": { + "username": "ceilometer", + "password": "" + }, + "alarming": { + "username": "aodh", + "password": "" + }, + "network": { + "username": "neutron", + "password": "" + }, + "mysql": { + "username": "root", + "password": "" + }, + "volume": { + "username": "cinder", + "password": "" + }, + "heat": { + "username": "heat", + "password": "" + }, + "policy": { + "username": "congress", + "password": "" + } + } + } + },{ + "security": { + "accordion_heading": "OpenStack Keystone User Credentials", + "category": "console_credentials", + "data_structure": "table", + "action": "true", + "modifiable_data": ["username", "password"], + "table_display_header": ["Service", "UserName", "Password", "Action"], + "config":{ + "admin": { + "username": "admin", + "password": "" + }, + "demo": { + "username": "demo", + "password": "" + }, + "compute": { + "username": "nova", + "password": "" + }, + "dashboard": { + "username": "dashboard", + "password": "" + }, + "identity": { + "username": "keystone", + "password": "" + }, + "image": { + "username": "glance", + "password": "" + }, + "metering": { + "username": "ceilometer", + "password": "" + }, + "alarming": { + "username": "aodh", + "password": "" + }, + "network": { + "username": "quantum", + "password": "" + }, + "object-store": { + "username": "swift", + "password": "" + }, + "heat": { + "username": "heat", + "password": "" + }, + "volume": { + "username": "cinder", + "password": "" + } + } + } + }] +} diff --git a/deploy/compass_conf/flavor_mapping/allinone.conf b/deploy/compass_conf/flavor_mapping/allinone.conf index 4752a805..11fadeaf 100755 --- a/deploy/compass_conf/flavor_mapping/allinone.conf +++ b/deploy/compass_conf/flavor_mapping/allinone.conf @@ -13,35 +13,35 @@ CONFIG_MAPPING = { "config": { "rabbitmq": { "username": "guest", - "password": "guest" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "identity": { "username": "keystone", - "password": "keystone" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "mysql": { "username": "root", - "password": "root" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } @@ -56,35 +56,35 @@ CONFIG_MAPPING = { "config":{ "admin": { "username": "admin", - "password": "admin" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "network": { "username": "quantum", - "password": "quantum" + "password": "" }, "object-store": { "username": "swift", - "password": "swift" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } diff --git a/deploy/compass_conf/flavor_mapping/ha-multinodes.conf b/deploy/compass_conf/flavor_mapping/ha-multinodes.conf index 34d76be1..1a3dc29f 100755 --- a/deploy/compass_conf/flavor_mapping/ha-multinodes.conf +++ b/deploy/compass_conf/flavor_mapping/ha-multinodes.conf @@ -13,35 +13,35 @@ CONFIG_MAPPING = { "config": { "rabbitmq": { "username": "guest", - "password": "guest" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "identity": { "username": "keystone", - "password": "keystone" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "mysql": { "username": "root", - "password": "root" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } @@ -56,35 +56,35 @@ CONFIG_MAPPING = { "config":{ "admin": { "username": "admin", - "password": "admin" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "network": { "username": "quantum", - "password": "quantum" + "password": "" }, "object-store": { "username": "swift", - "password": "swift" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } diff --git a/deploy/compass_conf/flavor_mapping/multinodes.conf b/deploy/compass_conf/flavor_mapping/multinodes.conf index bed52f06..003d7989 100755 --- a/deploy/compass_conf/flavor_mapping/multinodes.conf +++ b/deploy/compass_conf/flavor_mapping/multinodes.conf @@ -13,35 +13,35 @@ CONFIG_MAPPING = { "config": { "rabbitmq": { "username": "guest", - "password": "guest" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "identity": { "username": "keystone", - "password": "keystone" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "mysql": { "username": "root", - "password": "root" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } @@ -56,35 +56,35 @@ CONFIG_MAPPING = { "config":{ "admin": { "username": "admin", - "password": "admin" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "network": { "username": "quantum", - "password": "quantum" + "password": "" }, "object-store": { "username": "swift", - "password": "swift" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } diff --git a/deploy/compass_conf/flavor_mapping/single-contoller-multi-compute.conf b/deploy/compass_conf/flavor_mapping/single-contoller-multi-compute.conf index c7bbff73..26cc8610 100755 --- a/deploy/compass_conf/flavor_mapping/single-contoller-multi-compute.conf +++ b/deploy/compass_conf/flavor_mapping/single-contoller-multi-compute.conf @@ -13,35 +13,35 @@ CONFIG_MAPPING = { "config": { "rabbitmq": { "username": "guest", - "password": "guest" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "identity": { "username": "keystone", - "password": "keystone" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "mysql": { "username": "root", - "password": "root" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } @@ -56,35 +56,35 @@ CONFIG_MAPPING = { "config":{ "admin": { "username": "admin", - "password": "admin" + "password": "" }, "compute": { "username": "nova", - "password": "nova" + "password": "" }, "dashboard": { "username": "dashboard", - "password": "dashboard" + "password": "" }, "image": { "username": "glance", - "password": "glance" + "password": "" }, "metering": { "username": "ceilometer", - "password": "ceilometer" + "password": "" }, "network": { "username": "quantum", - "password": "quantum" + "password": "" }, "object-store": { "username": "swift", - "password": "swift" + "password": "" }, "volume": { "username": "cinder", - "password": "cinder" + "password": "" } } } diff --git a/deploy/compass_conf/flavor_metadata/HA-ansible-multinodes-queens.conf b/deploy/compass_conf/flavor_metadata/HA-ansible-multinodes-queens.conf new file mode 100755 index 00000000..e38292b4 --- /dev/null +++ b/deploy/compass_conf/flavor_metadata/HA-ansible-multinodes-queens.conf @@ -0,0 +1,19 @@ +ADAPTER = 'openstack_queens' +FLAVOR = 'HA-ansible-multinodes-queens' +METADATA = { + 'ha_proxy': { + '_self': { + }, + 'vip': { + '_self': { + 'is_required': True, + 'field': 'general', + 'mapping_to': 'ha_vip' + } + }, + 'test': { + '_self': { + }, + } + } +} diff --git a/deploy/compass_conf/os/centos7.3.aarch64.conf b/deploy/compass_conf/os/centos7.3.aarch64.conf index bd3bce30..e6c9f710 100755 --- a/deploy/compass_conf/os/centos7.3.aarch64.conf +++ b/deploy/compass_conf/os/centos7.3.aarch64.conf @@ -1,3 +1,3 @@ -NAME = 'CentOS-7-Minimal-1611-arm-arm' +NAME = 'CentOS-7-Minimal-1708-arm-arm' PARENT = 'CentOS' DEPLOYABLE = True diff --git a/deploy/compass_conf/package_installer/ansible-kubernetes.conf b/deploy/compass_conf/package_installer/ansible-kubernetes.conf index 32590c82..044af9a9 100755 --- a/deploy/compass_conf/package_installer/ansible-kubernetes.conf +++ b/deploy/compass_conf/package_installer/ansible-kubernetes.conf @@ -7,7 +7,7 @@ SETTINGS = { 'playbook_file': 'site.yml', 'inventory_file': 'inventory.py', 'inventory_json_file': 'inventory.json', - 'inventory_group': ['kube_master', 'etcd', 'kube_node'], + 'inventory_group': ['kube_master', 'etcd', 'kube_node', 'ha', 'ceph_adm', 'ceph_mon', 'ceph_osd', 'storage_master', 'storage_node'], 'group_variable': 'all', 'etc_hosts_path': 'roles/pre-k8s/templates/hosts', 'runner_dirs': ['roles','kubernetes/roles'] diff --git a/deploy/compass_conf/package_installer/ansible-queens.conf b/deploy/compass_conf/package_installer/ansible-queens.conf new file mode 100755 index 00000000..191e21d9 --- /dev/null +++ b/deploy/compass_conf/package_installer/ansible-queens.conf @@ -0,0 +1,15 @@ +NAME = 'ansible_installer' +INSTANCE_NAME = 'ansible_installer_queens' +SETTINGS = { + 'ansible_dir': '/var/ansible', + 'ansible_run_dir': '/var/ansible/run', + 'ansible_config': 'ansible.cfg', + 'playbook_file': 'site.yml', + 'inventory_file': 'inventory.py', + 'inventory_json_file': 'inventory.json', + 'inventory_group': ['controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph_adm', 'ceph_mon', 'ceph_osd', 'moon'], + 'group_variable': 'all', + 'etc_hosts_path': 'roles/pre-openstack/templates/hosts', + 'runner_dirs': ['roles','openstack_queens/templates','openstack_queens/roles'] +} + diff --git a/deploy/compass_conf/package_metadata/kubernetes.conf b/deploy/compass_conf/package_metadata/kubernetes.conf index d5e9a50f..c9853d17 100755 --- a/deploy/compass_conf/package_metadata/kubernetes.conf +++ b/deploy/compass_conf/package_metadata/kubernetes.conf @@ -129,6 +129,14 @@ METADATA = { 'default_value': '[]' } }, + 'cluster_param': { + '_self': { + 'mapping_to': 'cluster_param', + 'field': 'general_list', + 'is_required':False, + 'default_value': '[]' + } + }, 'ha_network': { '_self': { 'mapping_to': 'ha_network', diff --git a/deploy/compass_conf/package_metadata/openstack.conf b/deploy/compass_conf/package_metadata/openstack.conf index 6027cb1a..f0e41217 100755 --- a/deploy/compass_conf/package_metadata/openstack.conf +++ b/deploy/compass_conf/package_metadata/openstack.conf @@ -129,6 +129,14 @@ METADATA = { 'default_value': '[]' } }, + 'cluster_param': { + '_self': { + 'mapping_to': 'cluster_param', + 'field': 'general_list', + 'is_required':False, + 'default_value': '[]' + } + }, 'ha_network': { '_self': { 'mapping_to': 'ha_network', @@ -271,13 +279,11 @@ METADATA = { 'tenant_net_info': { '_self': { 'mapping_to': 'tenant_net_info', - 'is_required': True }, 'type': { '_self': { 'mapping_to': 'type', - 'is_required': True, 'field': 'general', 'options': ['vxlan', 'vlan'], } @@ -285,14 +291,12 @@ METADATA = { 'range': { '_self': { 'mapping_to': 'range', - 'is_required': True, 'field': 'general', } }, 'provider_network': { '_self': { 'mapping_to': 'provider_network', - 'is_required': True, 'field': 'general', } } diff --git a/deploy/compass_conf/role/kubernetes_ansible.conf b/deploy/compass_conf/role/kubernetes_ansible.conf index ae096f47..02e10cee 100755 --- a/deploy/compass_conf/role/kubernetes_ansible.conf +++ b/deploy/compass_conf/role/kubernetes_ansible.conf @@ -11,5 +11,24 @@ ROLES = [{ 'role': 'kube_node', 'display_name': 'kube node', 'description': 'kube Node' -} +}, { + 'role': 'opencontrail', + 'display_name': 'opencontrail node', + 'description': 'opencontrail node', + 'optional': True +},{ + 'role': 'ha', + 'display_name': 'ha', + 'description': 'ha' +}, { + 'role': 'storage_master', + 'display_name': 'storage master', + 'description': 'storage master', + 'optional': True +}, { + 'role': 'storage_node', + 'display_name': 'storage node', + 'description': 'storage node', + 'optional': True +} ] diff --git a/deploy/compass_conf/role/openstack_queens_ansible.conf b/deploy/compass_conf/role/openstack_queens_ansible.conf new file mode 100755 index 00000000..d46bd401 --- /dev/null +++ b/deploy/compass_conf/role/openstack_queens_ansible.conf @@ -0,0 +1,125 @@ +ADAPTER_NAME = 'openstack_queens' +ROLES = [{ + 'role': 'allinone-compute', + 'display_name': 'all in one', + 'description': 'All in One' +}, { + 'role': 'controller', + 'display_name': 'controller node', + 'description': 'Controller Node' +}, { + 'role': 'compute', + 'display_name': 'compute node', + 'description': 'Compute Node' +}, { + 'role': 'storage', + 'display_name': 'storage node', + 'description': 'Storage Node' +}, { + 'role': 'network', + 'display_name': 'network node', + 'description': 'Network Node' +}, { + 'role': 'compute-worker', + 'display_name': 'Compute worker node', + 'description': 'Compute worker node' +}, { + 'role': 'compute-controller', + 'display_name': 'Compute controller node', + 'description': 'Compute controller node' +}, { + 'role': 'network-server', + 'display_name': 'Network server node', + 'description': 'Network server node' +}, { + 'role': 'database', + 'display_name': 'Database node', + 'description': 'Database node' +}, { + 'role': 'messaging', + 'display_name': 'Messaging queue node', + 'description': 'Messaging queue node' +}, { + 'role': 'image', + 'display': 'Image node', + 'description': 'Image node' +}, { + 'role': 'dashboard', + 'display': 'Dashboard node', + 'description': 'Dashboard node' +}, { + 'role': 'identity', + 'display': 'Identity node', + 'description': 'Identity node' +}, { + 'role': 'storage-controller', + 'display': 'Storage controller node', + 'description': 'Storage controller node' +}, { + 'role': 'storage-volume', + 'display': 'Storage volume node', + 'description': 'Storage volume node' +}, { + 'role': 'network-worker', + 'display': 'Network worker node', + 'description': 'Network worker node' +}, { + 'role': 'odl', + 'display': 'open day light', + 'description': 'odl node', + 'optional': True +}, { + 'role': 'onos', + 'display': 'open network operating system', + 'description': 'onos node', + 'optional': True +}, { + 'role': 'opencontrail', + 'display': 'open contrail', + 'description': 'opencontrail node', + 'optional': True +}, { + 'role': 'ha', + 'display': 'Cluster with HA', + 'description': 'Cluster with HA node' +}, { + 'role': 'ceph-adm', + 'display': 'Ceph Admin Node', + 'description': 'Ceph Admin Node', + 'optional': True +}, { + 'role': 'ceph-mon', + 'display': 'Ceph Monitor Node', + 'description': 'Ceph Monitor Node', + 'optional': True +}, { + 'role': 'ceph-osd', + 'display': 'Ceph Storage Node', + 'description': 'Ceph Storage Node', + 'optional': True +}, { + 'role': 'ceph-osd-node', + 'display': 'Ceph osd install from node', + 'description': '', + 'optional': True +}, { + 'role': 'ceph', + 'display': 'ceph node', + 'description': 'ceph node', + 'optional': True +}, { + 'role': 'sec-patch', + 'display': 'sec-patch node', + 'description': 'Security Patch Node', + 'optional': True +}, { + 'role': 'none', + 'display': 'none node', + 'description': 'Only install OS Node', + 'optional': True +}, { + 'role': 'moon', + 'display': 'moon master or slave node', + 'description': "Moon master/slave Node", + 'optional': True +}] diff --git a/deploy/compass_conf/templates/ansible_installer/kubernetes/ansible_cfg/ansible-kubernetes.tmpl b/deploy/compass_conf/templates/ansible_installer/kubernetes/ansible_cfg/ansible-kubernetes.tmpl index f09fa9c8..da4554e3 100644 --- a/deploy/compass_conf/templates/ansible_installer/kubernetes/ansible_cfg/ansible-kubernetes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/kubernetes/ansible_cfg/ansible-kubernetes.tmpl @@ -3,7 +3,7 @@ log_path = /var/ansible/run/kubernetes-$cluster_name/ansible.log host_key_checking = False callback_whitelist = playbook_done, status_callback -callback_plugins = /opt/ansible_callbacks +callback_plugins = /opt/ansible_plugins/callback forks=100 [ssh_connection] 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 440bf7d7..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 @@ -23,6 +23,8 @@ #set kube_masters = $getVar('kube_master', []) #set kube_nodes = $getVar('kube_node', []) +run_dir: $getVar('run_dir', '') + enable_secgroup: $getVar('enable_secgroup', True) enable_fwaas: $getVar('enable_fwaas', True) enable_vpnaas: $getVar('enable_vpnaas', True) @@ -38,10 +40,15 @@ deploy_type: $getVar('deploy_type', 'virtual') public_cidr: $kube_nodes[0]['install']['subnet'] storage_cidr: "{{ ip_settings[inventory_hostname]['storage']['cidr'] }}" mgmt_cidr: "{{ ip_settings[inventory_hostname]['mgmt']['cidr'] }}" +external_cidr: "{{ ip_settings[inventory_hostname]['external']['cidr'] }}" public_net_info: "{{ network_cfg.public_net_info }}" host_ip_settings: "{{ ip_settings[inventory_hostname] }}" +proxy: $getVar('http_proxy', '') +#set no_proxy = ','.join($getVar('no_proxy', [])) +ignore_proxy: $no_proxy + ntp_server: $ntp_server internal_vip: ip: $network_cfg["internal_vip"]["ip"] @@ -82,7 +89,7 @@ dashboard_host: "{{ internal_ip }}" haproxy_hosts: #for $item in $has #set $hostname=$item["hostname"] - $hostname: $ip_settings[$hostname]["mgmt"]["ip"] + $hostname: $ip_settings[$hostname]["external"]["ip"] #end for host_index: @@ -91,31 +98,6 @@ host_index: #end for ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set keystone_pass = $console_credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set heat_dbpass = $credentials.heat.password -#set heat_pass = $console_credentials.heat.password -#set neutron_dbpass = $credentials.network.password -#set neutron_pass = $console_credentials.network.password -#set ceilometer_dbpass = $credentials.metering.password -#set ceilometer_pass = $console_credentials.metering.password -#set aodh_dbpass = $credentials.alarming.password -#set aodh_pass = $console_credentials.alarming.password -#set congress_dbpass = $credentials.policy.password -#set congress_pass = $console_credentials.policy.password -#set admin_pass = $console_credentials.admin.password -#set demo_pass = $console_credentials.demo.password cluster_name: $cluster_name @@ -133,29 +115,20 @@ ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 erlang.cookie: DJJVECFMCJPVYQTJTDWG -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -KEYSTONE_PASS: $keystone_pass -CEILOMETER_DBPASS: $ceilometer_dbpass -CEILOMETER_PASS: $ceilometer_pass -AODH_DBPASS: $aodh_dbpass -AODH_PASS: $aodh_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_dbpass -NEUTRON_PASS: $neutron_pass -HEAT_DBPASS: $heat_dbpass -HEAT_PASS: $heat_pass -CONGRESS_DBPASS: $congress_dbpass -CONGRESS_PASS: $congress_pass -DEMO_PASS: $demo_pass -ADMIN_PASS: $admin_pass +#set plugins = $getVar('plugins', []) +#for item in plugins +#set keys = $item.keys() +#set values = $item.values() +$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'] @@ -185,10 +158,6 @@ build_in_image_name: cirros-0.3.3-x86_64-disk.img physical_device: /dev/sdb -odl_username: admin -odl_password: admin -odl_api_port: 8080 - odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz odl_pkg_name: karaf.tar.gz odl_home: "/opt/opendaylight-0.2.2/" diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl index 527f480a..d7a0e1b4 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl @@ -142,31 +142,6 @@ host_index: #end for ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set keystone_pass = $console_credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set heat_dbpass = $credentials.heat.password -#set heat_pass = $console_credentials.heat.password -#set neutron_dbpass = $credentials.network.password -#set neutron_pass = $console_credentials.network.password -#set ceilometer_dbpass = $credentials.metering.password -#set ceilometer_pass = $console_credentials.metering.password -#set aodh_dbpass = $credentials.alarming.password -#set aodh_pass = $console_credentials.alarming.password -#set congress_dbpass = $credentials.policy.password -#set congress_pass = $console_credentials.policy.password -#set admin_pass = $console_credentials.admin.password -#set demo_pass = $console_credentials.demo.password cluster_name: $cluster_name @@ -184,30 +159,6 @@ ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 erlang.cookie: DJJVECFMCJPVYQTJTDWG -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -KEYSTONE_PASS: $keystone_pass -CEILOMETER_DBPASS: $ceilometer_dbpass -CEILOMETER_PASS: $ceilometer_pass -AODH_DBPASS: $aodh_dbpass -AODH_PASS: $aodh_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_dbpass -NEUTRON_PASS: $neutron_pass -HEAT_DBPASS: $heat_dbpass -HEAT_PASS: $heat_pass -CONGRESS_DBPASS: $congress_dbpass -CONGRESS_PASS: $congress_pass -DEMO_PASS: $demo_pass -ADMIN_PASS: $admin_pass - #set plugins = $getVar('plugins', []) #for item in plugins #set keys = $item.keys() @@ -255,9 +206,6 @@ api_workers: 1 physical_device: /dev/sdb -odl_username: admin -odl_password: admin -odl_api_port: 8080 odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz odl_pkg_name: karaf.tar.gz diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/allinone.tmpl index 2fc97c41..aa4d7e67 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/allinone.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/allinone.tmpl @@ -17,20 +17,6 @@ INTERFACE_NAME: $network_external_nic INTERNAL_INTERFACE: $network_internal_nic #end for -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password compute_controller_host: "{{ controller_host }}" db_host: "{{ controller_host }}" @@ -55,20 +41,6 @@ ocata_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] #NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/multinodes.tmpl index 9fa649bc..11f6fa79 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/multinodes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/multinodes.tmpl @@ -86,21 +86,6 @@ INTERFACE_NAME: $network_external_nic INTERNAL_INTERFACE: $network_internal_nic #end for -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password - cluster_name: $cluster_name odl_controller: 10.1.0.15 @@ -116,20 +101,6 @@ ocata_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] #NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] @@ -151,9 +122,6 @@ physical_device: /dev/sdb internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" HA_VIP: "{{ internal_ip }}" -odl_username: admin -odl_password: admin -odl_api_port: 8080 odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz odl_pkg_name: karaf.tar.gz diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/single-controller.tmpl index 57c23366..e7544170 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/single-controller.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/single-controller.tmpl @@ -29,21 +29,6 @@ INTERFACE_NAME: $network_external_nic INTERNAL_INTERFACE: $network_internal_nic #end for -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password - cluster_name: $cluster_name deploy_type: $getVar('deploy_type', 'virtual') compute_controller_host: "{{ controller_host }}" @@ -67,20 +52,6 @@ ocata_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] #NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] @@ -103,6 +74,3 @@ physical_device: /dev/sdb internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" HA_VIP: "{{ internal_ip }}" -odl_username: admin -odl_password: admin -odl_api_port: 8080 diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_pike/ansible_cfg/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_pike/ansible_cfg/HA-ansible-multinodes.tmpl index cd8c8d30..6fdb6b16 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_pike/ansible_cfg/HA-ansible-multinodes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_pike/ansible_cfg/HA-ansible-multinodes.tmpl @@ -3,7 +3,8 @@ log_path = /var/ansible/run/openstack_pike-$cluster_name/ansible.log host_key_checking = False callback_whitelist = playbook_done, status_callback -callback_plugins = /opt/ansible_callbacks +callback_plugins = /opt/ansible_plugins/callback +lookup_plugins = /opt/ansible_plugins/lookup forks=100 [ssh_connection] diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/HA-ansible-multinodes.tmpl index 6b226e6f..25deaa55 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/HA-ansible-multinodes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/HA-ansible-multinodes.tmpl @@ -142,31 +142,6 @@ host_index: #end for ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set keystone_pass = $console_credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set heat_dbpass = $credentials.heat.password -#set heat_pass = $console_credentials.heat.password -#set neutron_dbpass = $credentials.network.password -#set neutron_pass = $console_credentials.network.password -#set ceilometer_dbpass = $credentials.metering.password -#set ceilometer_pass = $console_credentials.metering.password -#set aodh_dbpass = $credentials.alarming.password -#set aodh_pass = $console_credentials.alarming.password -#set congress_dbpass = $credentials.policy.password -#set congress_pass = $console_credentials.policy.password -#set admin_pass = $console_credentials.admin.password -#set demo_pass = $console_credentials.demo.password cluster_name: $cluster_name @@ -184,30 +159,6 @@ ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 erlang.cookie: DJJVECFMCJPVYQTJTDWG -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -KEYSTONE_PASS: $keystone_pass -CEILOMETER_DBPASS: $ceilometer_dbpass -CEILOMETER_PASS: $ceilometer_pass -AODH_DBPASS: $aodh_dbpass -AODH_PASS: $aodh_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_dbpass -NEUTRON_PASS: $neutron_pass -HEAT_DBPASS: $heat_dbpass -HEAT_PASS: $heat_pass -CONGRESS_DBPASS: $congress_dbpass -CONGRESS_PASS: $congress_pass -DEMO_PASS: $demo_pass -ADMIN_PASS: $admin_pass - #set plugins = $getVar('plugins', []) #for item in plugins #set keys = $item.keys() @@ -255,8 +206,6 @@ api_workers: 1 physical_device: /dev/sdb -odl_username: admin -odl_password: admin odl_api_port: 8080 odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/allinone.tmpl index 0fb6581f..31ea7be8 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/allinone.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/allinone.tmpl @@ -17,20 +17,6 @@ INTERFACE_NAME: $network_external_nic INTERNAL_INTERFACE: $network_internal_nic #end for -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password compute_controller_host: "{{ controller_host }}" db_host: "{{ controller_host }}" @@ -55,20 +41,6 @@ pike_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial- ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] #NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] @@ -91,6 +63,3 @@ internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" HA_VIP: "{{ internal_ip }}" -odl_username: admin -odl_password: admin -odl_api_port: 8080 diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/multinodes.tmpl index 10056042..51f8295b 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/multinodes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/multinodes.tmpl @@ -86,21 +86,6 @@ INTERFACE_NAME: $network_external_nic INTERNAL_INTERFACE: $network_internal_nic #end for -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password - cluster_name: $cluster_name odl_controller: 10.1.0.15 @@ -116,20 +101,6 @@ pike_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial- ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] #NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/single-controller.tmpl index 08423749..3ffd9b2f 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/single-controller.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_pike/vars/single-controller.tmpl @@ -29,20 +29,6 @@ INTERFACE_NAME: $network_external_nic INTERNAL_INTERFACE: $network_internal_nic #end for -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password cluster_name: $cluster_name deploy_type: $getVar('deploy_type', 'virtual') @@ -67,20 +53,6 @@ pike_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial- ADMIN_TOKEN: admin CEILOMETER_TOKEN: c095d479023a0fd58a54 -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] #NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] @@ -103,6 +75,3 @@ physical_device: /dev/sdb internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" HA_VIP: "{{ internal_ip }}" -odl_username: admin -odl_password: admin -odl_api_port: 8080 diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/HA-ansible-multinodes.tmpl new file mode 100755 index 00000000..4d20ff6d --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/HA-ansible-multinodes.tmpl @@ -0,0 +1,12 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_queens-$cluster_name/ansible.log +host_key_checking = False +callback_whitelist = playbook_done, status_callback +callback_plugins = /opt/ansible_plugins/callback +lookup_plugins = /opt/ansible_plugins/lookup +forks=100 + +[ssh_connection] +pipelining=True +retries = 5 diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/allinone.tmpl new file mode 100755 index 00000000..7a947da7 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/allinone.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_queens-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/ansible_callbacks +pipelining=True diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/multinodes.tmpl new file mode 100755 index 00000000..7a947da7 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/multinodes.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_queens-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/ansible_callbacks +pipelining=True diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/single-controller.tmpl new file mode 100755 index 00000000..7a947da7 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/ansible_cfg/single-controller.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_queens-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/ansible_callbacks +pipelining=True diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/HA-ansible-multinodes.tmpl new file mode 100755 index 00000000..4c98066e --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/HA-ansible-multinodes.tmpl @@ -0,0 +1,31 @@ +#set ip_settings={} +#for k,v in $getVar('ip_settings', {}).items() +#set host_ip_settings={} +#for intf in v +#set $host_ip_settings[$intf["alias"]]=intf +#end for +#set $ip_settings[$k]=$host_ip_settings +#end for + +# localhost +127.0.0.1 localhost +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($compute, list) + #set computes = [$computes] +#end if +# controller +#for worker in $controllers + #set worker_hostname = $worker.hostname + #set worker_ip = $ip_settings[$worker_hostname]["tenant"]["ip"] +$worker_ip $worker_hostname +#end for +# compute +#for worker in $computes + #set worker_hostname = $worker.hostname + #set worker_ip = $ip_settings[$worker_hostname]["tenant"]["ip"] +$worker_ip $worker_hostname +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/allinone.tmpl new file mode 100755 index 00000000..b777815e --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/allinone.tmpl @@ -0,0 +1,10 @@ +#set controllers = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +# allinone +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_ip $controller_hostname +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/multinodes.tmpl new file mode 100755 index 00000000..ca8c793f --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/multinodes.tmpl @@ -0,0 +1,110 @@ +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +# compute-controller +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# database +#for worker in $databases + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# messaging +#for worker in $messagings + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage-controller +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# image +#for worker in $images + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# identity +#for worker in $identities + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network-server +#for worker in $network_servers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# dashboard +#for worker in $dashboards + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage-volume +#for worker in $storage_volumes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network-worker +#for worker in $network_workers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# compute-worker +#for worker in $compute_workers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/single-controller.tmpl new file mode 100755 index 00000000..3ed94694 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/hosts/single-controller.tmpl @@ -0,0 +1,40 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set storages = $getVar('storage', []) +#set networks = $getVar('network', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +# controller +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_ip $controller_hostname +#end for +# compute +#for worker in $computes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage +#for worker in $storages + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network +#for worker in $networks + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/HA-ansible-multinodes.tmpl new file mode 100755 index 00000000..7184d21d --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/HA-ansible-multinodes.tmpl @@ -0,0 +1,74 @@ +#set inventory_json = $getVar('inventory_json', []) +#!/usr/bin/env python + +import os +import sys +import copy +import argparse + +try: + import json +except ImportError: + import simplejson as json + +local_inventory='$inventory_json' + +def _byteify(data, ignore_dicts = False): + if isinstance(data, unicode): + return data.encode('utf-8') + if isinstance(data, list): + return [ _byteify(item, ignore_dicts=True) for item in data ] + if isinstance(data, dict) and not ignore_dicts: + return { + _byteify(key, ignore_dicts=True): _byteify(value, ignore_dicts=True) + for key, value in data.iteritems() + } + return data + +def merge_dict(ldict, rdict, overwrite=True): + if not (ldict and rdict): + return + + if not isinstance(ldict, dict): + raise TypeError('ldict type is %s not dict' % type(ldict)) + + if not isinstance(rdict, dict): + raise TypeError('rdict type is %s not dict' % type(rdict)) + + for key, value in rdict.items(): + if isinstance(value, dict) and key in ldict and isinstance(ldict[key], + dict): + merge_dict(ldict[key], value, overwrite) + else: + if overwrite or key not in ldict: + ldict[key] = copy.deepcopy(value) + +def load_inventory(inventory): + if not os.path.exists(inventory): + raise RuntimeError('file: %s not exist' % inventory) + with open(inventory, 'r') as fd: + return json.load(fd, object_hook=_byteify) + +def dump_inventory(inventory, data): + with open(inventory, 'w') as fd: + json.dump(data, fd, indent=4) + +def merge_inventory(linv, rinv): + ldata = load_inventory(linv) + rdata = load_inventory(rinv) + merge_dict(ldata, rdata, overwrite=True) + dump_inventory(linv, ldata) + +def read_cli_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--list', action = 'store_true') + parser.add_argument('--merge', action = 'store') + return parser.parse_args() + +if __name__ == '__main__': + get_args = read_cli_args() + new_inventory = get_args.merge + if get_args.list: + print load_inventory(local_inventory) + elif new_inventory: + merge_inventory(local_inventory, new_inventory) diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/allinone.tmpl new file mode 100755 index 00000000..b320b9c5 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/allinone.tmpl @@ -0,0 +1,47 @@ +#set controllers = $getVar('allinone_compute', []) +#set computes = $getVar('allinone_compute', []) +#set storages = $getVar('allinone_compute', []) +#set networks = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[compute] +#for compute in $computes + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[network] +#for network in $networks + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/multinodes.tmpl new file mode 100755 index 00000000..b342d22f --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/multinodes.tmpl @@ -0,0 +1,123 @@ +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[compute-controller] +#for controller in $compute_controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[compute-worker] +#for compute in $compute_workers + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[network-server] +#for network in $network_servers + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[network-worker] +#for network in $network_workers + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[database] +#for worker in $databases + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[messaging] +#for worker in $messagings + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[image] +#for worker in $images + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[dashboard] +#for worker in $dashboards + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[identity] +#for worker in $identities + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[storage-controller] +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[storage-volume] +#for worker in $storage_volumes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/single-controller.tmpl new file mode 100755 index 00000000..1afb45fa --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/inventories/single-controller.tmpl @@ -0,0 +1,67 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set storages = $getVar('storage', []) +#set networks = $getVar('network', []) +#set odls = $getVar('odl', []) +#set onoss = $getVar('onos', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +#if not $isinstance($odls, list) + #set odls = [$odls] +#end if +#if not $isinstance($onoss, list) + #set onoss = [$onoss] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[compute] +#for compute in $computes + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[network] +#for network in $networks + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for + +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for +[odl] +#for odl in odls + #set odl_ip = $odl.management.ip + #set odl_hostname = $odl.hostname +$odl_hostname ansible_ssh_host=$odl_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_pass=$password +#end for diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/HA-ansible-multinodes.tmpl new file mode 100755 index 00000000..202f86bb --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/HA-ansible-multinodes.tmpl @@ -0,0 +1,237 @@ +#from random import randint +#set cluster_name = $getVar('name', '') +#set network_cfg = $getVar('network_cfg', {}) +#set ntp_server = $getVar('ntp_server', "") +#set ceph_disk = $getVar('ceph_disk',"") +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set $contr_sys_mappings= {} +#set $compu_sys_mappings= {} +#for $intf_info in $network_cfg.sys_intf_mappings +#if "controller" in $intf_info["role"] +#set $contr_sys_mappings[$intf_info["name"]] = $intf_info +#end if +#if "compute" in $intf_info["role"] +#set $compu_sys_mappings[$intf_info["name"]] = $intf_info +#end if +#end for + +#set ip_settings={} +#for k,v in $getVar('ip_settings', {}).items() +#set host_ip_settings={} +#for intf in v +#set $host_ip_settings[$intf["alias"]]=intf +#end for +#set $ip_settings[$k]=$host_ip_settings +#end for + +#for item in $network_cfg["ip_settings"] +#if $item["name"] == "mgmt" +#set mgmt_cfg = $item +#end if +#if $item["name"] == "external" +#set external_cfg = $item +#end if +#if $item["name"] == "tenant" +#set tenant_cfg = $item +#end if +#if $item["name"] == "storage" +#set storage_cfg = $item +#end if +#end for + +#set provider_net_mappings = $network_cfg["provider_net_mappings"] +#set contr_prv_mappings = {} +#set compu_prv_mappings = {} +#for item in $provider_net_mappings +#if "controller" in $item["role"] +#set $contr_prv_mappings[$item["network"]] = {"bridge":$item["name"],"interface":$item["interface"]} +#end if +#if "compute" in $item["role"] +#set $compu_prv_mappings[$item["network"]] = {"bridge":$item["name"],"interface":$item["interface"]} +#end if +#end for + +#set neutron_cfg = $getVar('neutron_config', {}) +#set ovs_config = $neutron_cfg.openvswitch +#set has = $getVar('ha', []) +#set ha_vip = $getVar('ha_vip', []) + +run_dir: $getVar('run_dir', '') + +enable_secgroup: $getVar('enable_secgroup', True) +enable_fwaas: $getVar('enable_fwaas', True) +enable_vpnaas: $getVar('enable_vpnaas', True) +ha_network: $getVar('ha_network', 'Disable') +onos_nic: $getVar('onos_nic', 'eth2') +onos_sfc: $getVar('onos_sfc', 'Disable') +ip_settings: $ip_settings +network_cfg: $network_cfg + +provider_net_mappings: $network_cfg["provider_net_mappings"] + +contr_sys_mappings: $contr_sys_mappings +compu_sys_mappings: $compu_sys_mappings + +contr_prv_mappings: $contr_prv_mappings +compu_prv_mappings: $compu_prv_mappings + +deploy_type: $getVar('deploy_type', 'virtual') + +mgmt_cidr: $mgmt_cfg["cidr"] +external_cidr: $external_cfg["cidr"] +tenant_cidr: $tenant_cfg["cidr"] +storage_cidr: $storage_cfg["cidr"] + +tenant_net_info: "{{ network_cfg.tenant_net_info }}" +public_net_info: "{{ network_cfg.public_net_info }}" +host_ip_settings: "{{ ip_settings[inventory_hostname] }}" + +ntp_server: $ntp_server + +offline_deployment: $getVar('offline_deployment', 'Disable') +offline_repo_ip: $getVar('compass_ip', '') +offline_repo_port: $getVar('offline_repo_port', '5151') + +internal_vip: + ip: $network_cfg["internal_vip"]["ip"] + netmask: $network_cfg["internal_vip"]["netmask"] +#if "vlan_tag" in $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]] + interface: $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]]["name"] +#else + interface: $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]]["interface"] +#end if + +public_vip: + ip: $network_cfg["public_vip"]["ip"] + netmask: $network_cfg["public_vip"]["netmask"] +#if "vlan_tag" in $contr_sys_mappings[$network_cfg["public_vip"]["interface"]] + interface: $contr_sys_mappings[$network_cfg["public_vip"]["interface"]]["name"] +#else + interface: $contr_sys_mappings[$network_cfg["public_vip"]["interface"]]["interface"] +#end if + +db_host: "{{ internal_vip.ip }}" +rabbit_host: "{{ internal_vip.ip }}" + +internal_ip: "{{ ip_settings[inventory_hostname]['tenant']['ip'] }}" +internal_nic: tenant + +#set random_id = randint(1, 255) +vrouter_id_internal: $random_id +vrouter_id_public: $random_id + +identity_host: "{{ internal_ip }}" +controllers_host: "{{ internal_ip }}" +storage_controller_host: "{{ internal_ip }}" +compute_controller_host: "{{ internal_ip }}" +image_host: "{{ internal_ip }}" +network_server_host: "{{ internal_ip }}" +dashboard_host: "{{ internal_ip }}" + +haproxy_hosts: +#for $item in $has +#set $hostname=$item["hostname"] + $hostname: $ip_settings[$hostname]["tenant"]["ip"] +#end for + +host_index: +#for $index, $item in enumerate($has) + $item["hostname"]: $index +#end for + +ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD + +cluster_name: $cluster_name + +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controllers_host }}" +DB_HOST: "{{ db_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-queens.list +queens_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 +erlang.cookie: DJJVECFMCJPVYQTJTDWG + +#set plugins = $getVar('plugins', []) +#set odl_enable = False +#for item in plugins +#set key = $item.keys()[0] +#set value = $item.values()[0] +#if $key == "opendaylight" and $value == "Enable" +#set odl_enable = True +#end if +$key: $value +#end for + +#set cluster_param = $getVar('cluster_param', []) +#for item in cluster_param +#set key = $item.keys()[0] +#set value = $item.values()[0] +$key: $value +#end for + +#set neutron_service_plugins=['router'] +#if $getVar('enable_fwaas', True) +#neutron_service_plugins.append('firewall') +#end if +#if $getVar('enable_vpnaas', True) +#neutron_service_plugins.append('vpnaas') +#end if + +NEUTRON_SERVICE_PLUGINS: $neutron_service_plugins +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan', 'vlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['$ovs_config["tenant_network_type"]'] +NEUTRON_OVS_BRIDGE_MAPPINGS: $ovs_config['bridge_mappings'] +#if 'vlan_ranges' in $ovs_config +NEUTRON_VLAN_RANGES: $ovs_config['vlan_ranges'] +#else +NEUTRON_VLAN_RANGES: [] +#end if +#if 'tunnel_id_ranges' in $ovs_config +NEUTRON_TUNNEL_ID_RANGES: $ovs_config['tunnel_id_ranges'] +#else +NEUTRON_TUNNEL_ID_RANGES: [] +#end if + +#if odl_enable == True +NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +#else +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +#end if +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +WSREP_SST_USER: wsrep_sst +WSREP_SST_PASS: wsrep_sst_sercet + +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: "{{ internal_ip }}" + +#build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image: http://192.168.121.12:9999/img/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +api_workers: 1 + +physical_device: /dev/sdb + +odl_api_port: 8080 + +odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz +odl_pkg_name: karaf.tar.gz +odl_home: "/opt/opendaylight-0.2.2/" +odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] +odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] +odl_features: "{{ odl_base_features + odl_extra_features }}" +odl_api_port: 8080 + +#set moon_cfg = $getVar('moon_cfg', {}) +moon_master: $moon_cfg.master.flag +moon_slave: $moon_cfg.slave.flag +moon_slave_name: $moon_cfg.slave.name +moon_master_ip: $moon_cfg.slave.master_ip + diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/allinone.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/allinone.tmpl new file mode 100755 index 00000000..2260a08d --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/allinone.tmpl @@ -0,0 +1,65 @@ +#set cluster_name = $getVar('name', '') +#set controllers = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if + +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +controller_host: $controller_ip +#end for +#for network in $controllers + #set network_external_nic = $network.external.interface + #set network_external_subnet = $network.external.subnet + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + + +compute_controller_host: "{{ controller_host }}" +db_host: "{{ controller_host }}" +rabbit_host: "{{ controller_host }}" +storage_controller_host: "{{ controller_host }}" +image_host: "{{ controller_host }}" +identity_host: "{{ controller_host }}" +network_server_host: "{{ controller_host }}" +dashboard_host: "{{ controller_host }}" + +cluster_name: $cluster_name +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controller_host }}" +DB_HOST: "{{ controller_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-queens.list +queens_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" + diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/multinodes.tmpl new file mode 100755 index 00000000..a75a633a --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/multinodes.tmpl @@ -0,0 +1,136 @@ +#set cluster_name = $getVar('name', '') +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip +compute_controller_host: $worker_ip +#end for +#for worker in $databases + #set worker_ip = $worker.management.ip +db_host: $worker_ip +#end for +#for worker in $messagings + #set worker_ip = $worker.management.ip +rabbit_host: $worker_ip +#end for +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip +storage_controller_host: $worker_ip +#end for +#for worker in $images + #set worker_ip = $worker.management.ip +image_host: $worker_ip +#end for +#for worker in $identities + #set worker_ip = $worker.management.ip +identity_host: $worker_ip +#end for +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip +compute_controller_host: $worker_ip +#end for +#for worker in $network_servers + #set worker_ip = $worker.management.ip +network_server_host: $worker_ip +#end for +#for worker in $dashboards + #set worker_ip = $worker.management.ip +dashboard_host: $worker_ip +#end for +#for network in $network_workers + #set network_external_nic = $network.external.interface + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + +cluster_name: $cluster_name + +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ compute_controller_host }}" +DB_HOST: "{{ db_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-queens.list +queens_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" +odl_username: admin +odl_password: admin +odl_api_port: 8080 + +odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz +odl_pkg_name: karaf.tar.gz +odl_home: "/opt/opendaylight-0.2.2/" +odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] +odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] +odl_features: "{{ odl_base_features + odl_extra_features }}" +odl_api_port: 8080 + diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/single-controller.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/single-controller.tmpl new file mode 100755 index 00000000..7f021d31 --- /dev/null +++ b/deploy/compass_conf/templates/ansible_installer/openstack_queens/vars/single-controller.tmpl @@ -0,0 +1,77 @@ +#set cluster_name = $getVar('name', '') +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set networks = $getVar('network', []) +#set storages = $getVar('storage', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if + +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +controller_host: $controller_ip +#end for +#for network in $networks + #set network_external_nic = $network.external.interface + #set network_external_subnet = $network.external.subnet + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + + +cluster_name: $cluster_name +deploy_type: $getVar('deploy_type', 'virtual') +compute_controller_host: "{{ controller_host }}" +db_host: "{{ controller_host }}" +rabbit_host: "{{ controller_host }}" +storage_controller_host: "{{ controller_host }}" +image_host: "{{ controller_host }}" +identity_host: "{{ controller_host }}" +network_server_host: "{{ controller_host }}" +dashboard_host: "{{ controller_host }}" +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controller_host }}" +DB_HOST: "{{ controller_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-queens.list +queens_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +# EXTERNAL_NETWORK_CIDR: $network_external_subnet +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" diff --git a/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/profile.tmpl b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/profile.tmpl new file mode 100755 index 00000000..cfa89004 --- /dev/null +++ b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/profile.tmpl @@ -0,0 +1,3 @@ +{ + "repos": "$getVar('repo_name', '')" +} diff --git a/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/system.tmpl b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/system.tmpl new file mode 100755 index 00000000..8e4cbbbe --- /dev/null +++ b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1708-arm-arm/system.tmpl @@ -0,0 +1,76 @@ +{ + "name": "$hostname", + "hostname": "$hostname", + "profile": "$profile", + "gateway": "$gateway", + #import simplejson as json + #set nameservers = json.dumps($nameservers, encoding='utf-8') + "name_servers": $nameservers, + #set search_path = ' '.join($search_path) + "name_servers_search": "$search_path", + "proxy": "$getVar('http_proxy', '')", + "modify_interface": + #set networks = $networks + #set rekeyed = {} + #set promic_nic = "" + #for $nic, $val in $networks.iteritems(): + #set ip_key = '-'.join(('ipaddress', $nic)) + #set netmask_key = '-'.join(('netmask', $nic)) + #set mgmt_key = '-'.join(('management', $nic)) + #set static_key = '-'.join(('static', $nic)) + #set $rekeyed[$ip_key] = $val.ip + #set $rekeyed[$netmask_key] = $val.netmask + #set $rekeyed[$mgmt_key] = $val.is_mgmt + #set $rekeyed[$static_key] = True + + #set dns_key = '-'.join(('dnsname', $nic)) + #if $val.is_mgmt + #set $rekeyed[$dns_key] = $dns + #else + #if '.' in $dns + #set $dns_name, $dns_domain = $dns.split('.', 1) + #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain) + #else + #set $dns_nic = '%s-%s' % ($dns, $nic) + #end if + #set $rekeyed[$dns_key] = $dns_nic + #end if + + #if $val.is_promiscuous: + #set promic_nic = $nic + #end if + #if $val.is_mgmt: + #set mac_key = '-'.join(('macaddress', $nic)) + #set $rekeyed[$mac_key] = $mac + #end if + #end for + #set nic_info = json.dumps($rekeyed, encoding='utf-8') + $nic_info + , + "ksmeta":{ + #set partition_config = '' + #for k, v in $partition.iteritems(): + #set path = '' + #if v['vol_percentage']: + #set $path = k + ' ' + str(v['vol_percentage']) + '%' + #else: + #set $path = k + ' ' + str(v['vol_size']) + #end if + #set partition_config = ';'.join((partition_config, $path)) + #end for + #set partition_config = partition_config[1:] + #import crypt + #set $password = crypt.crypt($server_credentials.password, "az") + #set no_proxy = ','.join($getVar('no_proxy', [])) + "username": "$server_credentials.username", + "password": "$password", + "promisc_nics": "$promic_nic", + "partition": "$partition_config", + "https_proxy": "$getVar('https_proxy', '')", + "ntp_server": "$ntp_server", + "timezone": "$timezone", + "ignore_proxy": "$no_proxy", + "local_repo": "$getVar('local_repo', '')", + "disk_num": "1" + } +} diff --git a/deploy/compass_conf/templates/cobbler/ubuntu-16.04.3-server-x86_64/system.tmpl b/deploy/compass_conf/templates/cobbler/ubuntu-16.04.3-server-x86_64/system.tmpl index cfcc883e..366cbc13 100755 --- a/deploy/compass_conf/templates/cobbler/ubuntu-16.04.3-server-x86_64/system.tmpl +++ b/deploy/compass_conf/templates/cobbler/ubuntu-16.04.3-server-x86_64/system.tmpl @@ -11,36 +11,38 @@ "proxy": "$getVar('http_proxy', '')", "modify_interface": #set networks = $networks + #set mac = $mac #set rekeyed = {} #set promic_nic = "" - #for $nic, $val in $networks.iteritems(): - #set ip_key = '-'.join(('ipaddress', $nic)) - #set netmask_key = '-'.join(('netmask', $nic)) - #set mgmt_key = '-'.join(('management', $nic)) - #set static_key = '-'.join(('static', $nic)) - #set $rekeyed[$ip_key] = $val.ip - #set $rekeyed[$netmask_key] = $val.netmask - #set $rekeyed[$static_key] = True + #for $nic in $mac + #set mac_key = '-'.join(('macaddress', $nic)) + #set $rekeyed[$mac_key] = $mac[$nic] + #if $nic in $networks + #set val = $networks[$nic] + #set ip_key = '-'.join(('ipaddress', $nic)) + #set netmask_key = '-'.join(('netmask', $nic)) + #set mgmt_key = '-'.join(('management', $nic)) + #set static_key = '-'.join(('static', $nic)) + #set $rekeyed[$ip_key] = $val.ip + #set $rekeyed[$netmask_key] = $val.netmask + #set $rekeyed[$static_key] = True - #set dns_key = '-'.join(('dnsname', $nic)) - #if $val.is_mgmt - #set $rekeyed[$dns_key] = $dns - #else - #if '.' in $dns - #set $dns_name, $dns_domain = $dns.split('.', 1) - #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain) + #set dns_key = '-'.join(('dnsname', $nic)) + #if $val.is_mgmt + #set $rekeyed[$dns_key] = $dns #else - #set $dns_nic = '%s-%s' % ($dns, $nic) + #if '.' in $dns + #set $dns_name, $dns_domain = $dns.split('.', 1) + #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain) + #else + #set $dns_nic = '%s-%s' % ($dns, $nic) + #end if + #set $rekeyed[$dns_key] = $dns_nic #end if - #set $rekeyed[$dns_key] = $dns_nic - #end if - #if $val.is_promiscuous: - #set promic_nic = $nic - #end if - #if $val.is_mgmt: - #set mac_key = '-'.join(('macaddress', $nic)) - #set $rekeyed[$mac_key] = $mac + #if $val.is_promiscuous + #set promic_nic = $nic + #end if #end if #end for #set nic_info = json.dumps($rekeyed, encoding='utf-8') @@ -71,5 +73,9 @@ "ignore_proxy": "$no_proxy", "local_repo": "$getVar('local_repo', '')", "disk_num": "1" - } + }, + "power_address": "$power_manage.ip", + "power_user": "$power_manage.username", + "power_pass": "$power_manage.password", + "power_type": "$getVar('power_type', 'ipmilan')" } diff --git a/deploy/compass_vm.sh b/deploy/compass_vm.sh index 7689f41c..edce626b 100755 --- a/deploy/compass_vm.sh +++ b/deploy/compass_vm.sh @@ -10,6 +10,26 @@ compass_vm_dir=$WORK_DIR/vm/compass rsa_file=$compass_vm_dir/boot.rsa ssh_args="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $rsa_file" + +function check_container_alive() { + sudo docker exec -it compass-deck bash -c "exit" + local deck_state=$? + sudo docker exec -it compass-tasks bash -c "exit" + local tasks_state=$? + sudo docker exec -it compass-cobbler bash -c "exit" + local cobbler_state=$? + sudo docker exec -it compass-db bash -c "exit" + local db_state=$? + 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 + echo "true" + else + echo "false" + fi +} + function tear_down_compass() { sudo virsh destroy compass > /dev/null 2>&1 sudo virsh undefine compass > /dev/null 2>&1 @@ -27,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 } @@ -161,6 +179,35 @@ function recover_compass() { log_info "launch_compass exit" } +function launch_harbor() { + local harbor_install_dir=$WORK_DIR/installer + + if [[ ! -d $harbor_install_dir ]]; then + mkdir -p $harbor_install_dir + fi + + local harbor_cfg=$harbor_install_dir/harbor/harbor.cfg + local harbor_docker_compose=$harbor_install_dir/harbor/docker-compose.yml + local harbor_tar=$harbor_install_dir/compass_dists/harbor-offline-installer-v$HABOR_VERSION.tgz + rm -f $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz + curl --connect-timeout 10 -o $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz file://$harbor_tar + tar -zxf $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz -C $harbor_install_dir + + sed "s/^hostname = .*/hostname = $INSTALL_IP:8080/g" -i $harbor_cfg + sed "s/80:80/8080:80/g" -i $harbor_docker_compose + sed "s/443:443/8443:443/g" -i $harbor_docker_compose + cd $harbor_install_dir/harbor/ + sudo ./prepare + if [ -n "$(docker-compose -f $harbor_docker_compose ps -q)" ] + then + log_info "stopping existing Harbor instance ..." + docker-compose -f $harbor_docker_compose down -v + log_info "remove the odler harbor images ..." + sudo docker images | grep 'vmware' | awk '{print $3;}' | xargs docker rmi -f + fi + ./install.sh +} + function _check_hosts_reachable() { retry=0 diff --git a/deploy/conf/base.conf b/deploy/conf/base.conf index c2bf5291..76eb1491 100644 --- a/deploy/conf/base.conf +++ b/deploy/conf/base.conf @@ -2,18 +2,10 @@ export DHA=${DHA:-$COMPASS_DIR/deploy/conf/vm_environment/os-nosdn-nofeature-ha. export NEUTRON=${NEUTRON:-$COMPASS_DIR/deploy/conf/neutron_cfg.yaml} export NETWORK=${NETWORK:-$COMPASS_DIR/deploy/conf/network_cfg.yaml} export TAR_URL=${TAR_URL:-file://`pwd`/work/building/compass.tar.gz} -export INSTALL_IP=${INSTALL_IP:-10.1.0.1} -export EXT_NAT_MASK=${EXT_NAT_MASK:-255.255.252.0} -export EXT_NAT_GW=${EXT_NAT_GW:-192.16.1.1} -export EXT_NAT_IP_START=${EXT_NAT_IP_START:-192.16.1.3} -export EXT_NAT_IP_END=${EXT_NAT_IP_END:-192.16.1.254} -export EXTERNAL_NIC=${EXTERNAL_NIC:-eth0} -export CLUSTER_NAME="opnfv2" +export PXE_NIC=${PXE_NIC:-eth0} export DOMAIN="ods.com" export PARTITIONS="/=30%,/home=5%,/tmp=5%,/var=60%" -export SUBNETS="10.1.0.0/24,172.16.2.0/24,172.16.3.0/24,172.16.4.0/24" -export MANAGEMENT_IP_START=${MANAGEMENT_IP_START:-'10.1.0.50'} export MANAGEMENT_INTERFACE=${MANAGEMENT_INTERFACE:-eth0} export DASHBOARD_URL="" export ENABLE_SECGROUP=${ENABLE_SECGROUP:-"true"} @@ -25,10 +17,9 @@ export EXPANSION=${EXPANSION:-"false"} export NETWORK_MAPPING=${NETWORK_MAPPING:-"install=${MANAGEMENT_INTERFACE}"} -export PROXY="" -export IGNORE_PROXY="" +export PROXY=${LOCAL_PROXY:-""} +export IGNORE_PROXY=${LOCAL_NO_PROXY:-""} export SEARCH_PATH="ods.com" -export GATEWAY="10.1.0.1" export SERVER_CREDENTIAL="root=root" export LOCAL_REPO_URL="" export OS_CONFIG_FILENAME="" diff --git a/deploy/conf/cluster.conf b/deploy/conf/cluster.conf index 750ff113..6510f3cb 100644 --- a/deploy/conf/cluster.conf +++ b/deploy/conf/cluster.conf @@ -8,8 +8,9 @@ else export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)CentOS-7.*17.*'} fi -# pike -export OPENSTACK_VERSION=${OPENSTACK_VERSION:-"pike"} +export DEPLOY_TOOL=${DEPLOY_TOOL:-"osa"} +# queens +export OPENSTACK_VERSION=${OPENSTACK_VERSION:-"queens"} # don't touch this export ADAPTER_TARGET_SYSTEM_PATTERN="^openstack$" @@ -24,10 +25,11 @@ export ADAPTER_NAME="openstack_$OPENSTACK_VERSION" export ADAPTER_FLAVOR_PATTERN="HA-ansible-multinodes-$OPENSTACK_VERSION" if [[ "x"$KUBERNETES_VERSION != "x" ]]; then + unset OPENSTACK_VERSION + export DEPLOY_TOOL="k8s" export ADAPTER_NAME=kubernetes export ADAPTER_FLAVOR_PATTERN=ansible-kubernetes export ADAPTER_TARGET_SYSTEM_PATTERN='^kubernetes$' fi export DEFAULT_ROLES="" -export VIP="10.1.0.222" diff --git a/deploy/conf/compass.conf b/deploy/conf/compass.conf index 9d9145f1..b031c035 100644 --- a/deploy/conf/compass.conf +++ b/deploy/conf/compass.conf @@ -1,20 +1,21 @@ -export COMPASS_VIRT_CPUS=4 -export COMPASS_VIRT_MEM=4096 +export CLUSTER_NAME=${CLUSTER_NAME:-opnfv} +export INSTALL_IP=${INSTALL_IP:-$INSTALL_GW} export COMPASS_SERVER=$INSTALL_IP export COMPASS_DECK_PORT="5050" export COMPASS_SERVER_URL="http://$INSTALL_IP:$COMPASS_DECK_PORT/api" export HTTP_SERVER_URL="http://$INSTALL_IP:$COMPASS_DECK_PORT/api" export COMPASS_USER_EMAIL="admin@huawei.com" export COMPASS_USER_PASSWORD="admin" + export COMPASS_DNS1=${COMPASS_DNS1:-'8.8.8.8'} export COMPASS_DNS2=${COMPASS_DNS2:-} -export COMPASS_EXTERNAL_IP=${COMPASS_EXTERNAL_IP:-} -export COMPASS_EXTERNAL_MASK=${COMPASS_EXTERNAL_MASK:-} -export COMPASS_EXTERNAL_GW=${COMPASS_EXTERNAL_GW:-} export LANGUAGE="EN" export TIMEZONE="America/Los_Angeles" export NTP_SERVER="$COMPASS_SERVER" export NAMESERVERS=${USER_NAMESERVER:-"$COMPASS_SERVER"} export COMPASS_REPO_PORT="5151" export OFFLINE_DEPLOY=${OFFLINE_DEPLOY:-'Disable'} -export COMPOSE_IMAGES="[compass-db,compass-mq,compass-deck,compass-tasks,compass-cobbler]" + +if [[ "x"$COMPOSE_IMAGES == "x" ]]; then + export COMPOSE_IMAGES="[compass-db,compass-mq,compass-deck,compass-tasks-$DEPLOY_TOOL,compass-cobbler]" +fi diff --git a/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/k8-nosdn-nofeature-ha.yml index 995d0107..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 @@ -25,26 +25,29 @@ hosts: roles: - kube_master - etcd + - ha - name: host2 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 - etcd + - 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 - etcd + - ha - name: host4 mac: 'D8:49:0B:DA:5B:5D' 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 new file mode 100644 index 00000000..6efdadc3 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod1/k8-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: + - kube_master + - etcd + - ha + + - 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: + - kube_master + - etcd + - ha + + - 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: + - kube_master + - etcd + - ha + - storage_master + + - 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: + - kube_node + - storage_node + + - 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: + - kube_node + - storage_node diff --git a/deploy/conf/hardware_environment/huawei-pod1/network.yml b/deploy/conf/hardware_environment/huawei-pod1/network.yml index 77160d69..a5b01145 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/network.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/network_dpdk.yml b/deploy/conf/hardware_environment/huawei-pod1/network_dpdk.yml index 03483629..3e871f98 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/network_dpdk.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/network_odl.yml b/deploy/conf/hardware_environment/huawei-pod1/network_odl.yml new file mode 100644 index 00000000..266fd222 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod1/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.168.10.10" + - "192.168.10.50" + cidr: "192.168.10.0/24" + gw: "192.168.10.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.168.10.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 10 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.168.10.1" + floating_ip_cidr: "192.168.10.0/24" + floating_ip_start: "192.168.10.100" + floating_ip_end: "192.168.10.200" diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-bar-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-bar-ha.yml index 59e7180a..32f561d5 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-bar-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-bar-ha.yml @@ -35,7 +35,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -43,10 +43,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-kvm-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-kvm-ha.yml index 9c00916b..03267ffc 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-kvm-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-kvm-ha.yml @@ -35,7 +35,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -43,10 +43,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml index 6b329be6..7ca9e795 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml @@ -32,7 +32,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -40,10 +40,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-openo-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-openo-ha.yml index 6027bddb..b2440ee4 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-openo-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-openo-ha.yml @@ -40,7 +40,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -48,10 +48,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-stor4nfv-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-stor4nfv-ha.yml new file mode 100644 index 00000000..5ce9b47a --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-stor4nfv-ha.yml @@ -0,0 +1,74 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: baremetal +FLAVOR: cluster +POWER_TOOL: ipmitool + +ipmiUser: root +ipmiVer: '2.0' + +plugins: + - stor4nfv: "Enable" + +hosts: + - name: host1 + mac: 'F8:4A:BF:55:A2:8D' + interfaces: + - eth1: 'F8:4A:BF:55:A2:8E' + ipmiIp: 172.16.130.26 + ipmiPass: Opnfv@pod1 + roles: + - controller + - ha + - ceph-adm + - ceph-mon + + - name: host2 + mac: 'D8:49:0B:DA:5A:B7' + interfaces: + - eth1: 'D8:49:0B:DA:5A:B8' + ipmiIp: 172.16.130.29 + ipmiPass: Opnfv@pod1 + roles: + - controller + - ha + - ceph-mon + + - name: host3 + mac: '70:7B:E8:77:7B:60' + interfaces: + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 + ipmiPass: Opnfv@pod1 + roles: + - controller + - ha + - ceph-mon + + - name: host4 + mac: 'D8:49:0B:DA:5B:5D' + interfaces: + - eth1: 'D8:49:0B:DA:5B:5E' + ipmiIp: 172.16.130.30 + ipmiPass: Opnfv@pod1 + roles: + - compute + - ceph-osd + + - name: host5 + mac: 'D8:49:0B:DA:56:85' + interfaces: + - eth1: 'D8:49:0B:DA:56:86' + ipmiIp: 172.16.130.31 + ipmiPass: Opnfv@pod1 + roles: + - compute + - ceph-osd diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml index 287383b2..bfab0151 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml @@ -33,17 +33,17 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - compute - ceph-osd - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - compute diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl-sfc-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl-sfc-ha.yml index 8095fe03..c5fd84ee 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl-sfc-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl-sfc-ha.yml @@ -38,7 +38,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -47,10 +47,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml index d2447c1d..71b114f2 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml @@ -37,7 +37,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -46,10 +46,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml index 71edf08c..2c2757a6 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml @@ -36,7 +36,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -45,10 +45,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml index 2aaf192f..cc621d76 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,8 @@ POWER_TOOL: ipmitool ipmiUser: root ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" plugins: - opendaylight: "Enable" @@ -37,7 +38,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -46,10 +47,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml index fb4b1788..57d0a2d5 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml @@ -33,7 +33,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -42,10 +42,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml index 1f40241f..c8aee2dc 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml @@ -35,7 +35,7 @@ hosts: mac: 'D8:49:0B:DA:5A:B7' interfaces: - eth1: 'D8:49:0B:DA:5A:B8' - ipmiIp: 172.16.130.27 + ipmiIp: 172.16.130.29 ipmiPass: Opnfv@pod1 roles: - controller @@ -44,10 +44,10 @@ hosts: - ceph-mon - name: host3 - mac: '78:D7:52:A0:B1:99' + mac: '70:7B:E8:77:7B:60' interfaces: - - eth1: '78:D7:52:A0:B1:9A' - ipmiIp: 172.16.130.29 + - eth1: '70:7B:E8:77:7B:5F' + ipmiIp: 172.16.130.27 ipmiPass: Opnfv@pod1 roles: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod2/k8-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/k8-nosdn-nofeature-ha.yml new file mode 100644 index 00000000..a96a5259 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod2/k8-nosdn-nofeature-ha.yml @@ -0,0 +1,73 @@ +############################################################################## +# 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 +############################################################################## + +--- + +TYPE: baremetal +FLAVOR: cluster +POWER_TOOL: ipmitool + +ipmiVer: '2.0' + +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: + - kube_master + - etcd + - ha + + - 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: + - kube_master + - etcd + - ha + + - 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: + - kube_master + - etcd + - ha + + - 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: + - kube_node + + - 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: + - kube_node diff --git a/deploy/conf/hardware_environment/huawei-pod2/k8-nosdn-stor4nfv-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/k8-nosdn-stor4nfv-ha.yml new file mode 100644 index 00000000..4fbea1f0 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod2/k8-nosdn-stor4nfv-ha.yml @@ -0,0 +1,79 @@ +############################################################################## +# 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 +############################################################################## + +--- + +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: + - kube_master + - etcd + - ha + + - 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: + - kube_master + - etcd + - ha + + - 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: + - kube_master + - etcd + - ha + - storage_master + + - 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: + - kube_node + - storage_node + + - 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: + - kube_node + - storage_node diff --git a/deploy/conf/hardware_environment/huawei-pod2/network.yml b/deploy/conf/hardware_environment/huawei-pod2/network.yml index ccf66a47..9e6365ee 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/network.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod2/network_dpdk.yml b/deploy/conf/hardware_environment/huawei-pod2/network_dpdk.yml index b357a6e1..40124467 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/network_dpdk.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/huawei-pod2/network_odl.yml b/deploy/conf/hardware_environment/huawei-pod2/network_odl.yml new file mode 100644 index 00000000..0941939a --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod2/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.168.11.10" + - "192.168.11.50" + cidr: "192.168.11.0/24" + gw: "192.168.11.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.168.11.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 10 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.168.11.1" + floating_ip_cidr: "192.168.11.0/24" + floating_ip_start: "192.168.11.100" + floating_ip_end: "192.168.11.200" diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-nosdn-stor4nfv-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-nosdn-stor4nfv-ha.yml new file mode 100644 index 00000000..f60c08e5 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod2/os-nosdn-stor4nfv-ha.yml @@ -0,0 +1,79 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- + +TYPE: baremetal +FLAVOR: cluster +POWER_TOOL: ipmitool + +ipmiVer: '2.0' + +plugins: + - stor4nfv: "Enable" + +hosts: + - name: host1 + mac: 'EC:38:8F:79:0C:2C' + ipmiUser: root + ipmiPass: Opnfv@pod2 + ipmiIp: 172.16.130.20 + interfaces: + - eth1: 'EC:38:8F:79:0C:2D' + roles: + - controller + - ha + - ceph-adm + - ceph-mon + + - name: host2 + mac: 'EC:38:8F:79:0C:48' + ipmiIp: 172.16.130.19 + ipmiUser: root + ipmiPass: Opnfv@pod2 + interfaces: + - eth1: 'EC:38:8F:79:0C:49' + roles: + - controller + - ha + - ceph-mon + + - name: host3 + mac: 'EC:38:8F:79:10:CC' + ipmiIp: 172.16.130.18 + ipmiUser: root + ipmiPass: Opnfv@pod2 + interfaces: + - eth1: 'EC:38:8F:79:10:CD' + roles: + - controller + - ha + - ceph-mon + + - name: host4 + mac: 'EC:38:8F:79:0C:6C' + ipmiIp: 172.16.130.17 + ipmiUser: root + ipmiPass: Opnfv@pod2 + interfaces: + - eth1: 'EC:38:8F:79:0C:6D' + roles: + - compute + - ceph-osd + + - name: host5 + mac: 'EC:38:8F:7A:E6:ED' + ipmiIp: 172.16.130.16 + ipmiUser: root + ipmiPass: Opnfv@pod2 + interfaces: + - eth1: 'EC:38:8F:7A:E6:EE' + roles: + - compute + - ceph-osd diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml index 5d8ed350..d96ab06d 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,8 @@ POWER_TOOL: ipmitool ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" plugins: - opendaylight: "Enable" diff --git a/deploy/conf/hardware_environment/huawei-pod4/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod4/os-odl_l3-nofeature-ha.yml index 46f7e791..b3ac36c6 100644 --- a/deploy/conf/hardware_environment/huawei-pod4/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod4/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,10 @@ POWER_TOOL: ipmitool ipmiUser: root ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod5/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod5/os-odl_l3-nofeature-ha.yml index 921fe81b..20d24cd0 100644 --- a/deploy/conf/hardware_environment/huawei-pod5/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod5/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,10 @@ POWER_TOOL: ipmitool ipmiUser: root ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod6/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod6/os-odl_l3-nofeature-ha.yml index 8710d420..55161bb4 100644 --- a/deploy/conf/hardware_environment/huawei-pod6/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod6/os-odl_l3-nofeature-ha.yml @@ -15,7 +15,10 @@ POWER_TOOL: ipmitool ipmiUser: root ipmiVer: '2.0' -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod8/k8-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod8/k8-nosdn-nofeature-ha.yml new file mode 100644 index 00000000..60b7466b --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod8/k8-nosdn-nofeature-ha.yml @@ -0,0 +1,73 @@ +############################################################################## +# 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' + +hosts: + - name: host1 + mac: '14:30:04:F2:24:CB' + ipmiUser: root + ipmiPass: Opnfv@podarm + ipmiIp: 172.16.130.81 + interfaces: + - eth1: '14:30:04:F2:24:CC' + roles: + - kube_master + - etcd + - ha + + - name: host2 + mac: '14:30:04:F2:24:3B' + ipmiIp: 172.16.130.82 + ipmiUser: root + ipmiPass: Opnfv@podarm + interfaces: + - eth1: '14:30:04:F2:24:3C' + roles: + - kube_master + - etcd + - ha + + - name: host3 + mac: '14:30:04:F2:24:FB' + ipmiIp: 172.16.130.83 + ipmiUser: root + ipmiPass: Opnfv@podarm + interfaces: + - eth1: '14:30:04:F2:24:FC' + roles: + - kube_master + - etcd + - ha + + - name: host4 + mac: '14:30:04:F2:25:EB' + ipmiIp: 172.16.130.84 + ipmiUser: root + ipmiPass: Opnfv@podarm + interfaces: + - eth1: '14:30:04:F2:25:EC' + roles: + - kube_node + + - name: host5 + mac: '14:30:04:F2:25:8B' + ipmiIp: 172.16.130.85 + ipmiUser: root + ipmiPass: Opnfv@podarm + interfaces: + - eth1: '14:30:04:F2:25:8C' + roles: + - kube_node diff --git a/deploy/conf/hardware_environment/huawei-pod8/k8-nosdn-nofeature-noha.yml b/deploy/conf/hardware_environment/huawei-pod8/k8-nosdn-nofeature-noha.yml new file mode 100644 index 00000000..7a1a92c1 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod8/k8-nosdn-nofeature-noha.yml @@ -0,0 +1,39 @@ +############################################################################## +# 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' + +hosts: + - name: host1 + mac: '14:30:04:F2:24:CB' + ipmiUser: root + ipmiPass: Opnfv@podarm + ipmiIp: 172.16.130.81 + interfaces: + - eth1: '14:30:04:F2:24:CC' + roles: + - kube_master + - etcd + - ha + + - name: host2 + mac: '14:30:04:F2:24:3B' + ipmiIp: 172.16.130.82 + ipmiUser: root + ipmiPass: Opnfv@podarm + interfaces: + - eth1: '14:30:04:F2:24:3C' + roles: + - kube_node diff --git a/deploy/conf/hardware_environment/huawei-pod8/network-sriov.yml b/deploy/conf/hardware_environment/huawei-pod8/network-sriov.yml new file mode 100644 index 00000000..a256101b --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod8/network-sriov.yml @@ -0,0 +1,127 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# Copyright (C) 2018, ARM Limited and contributors. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-provider + network: physnet + interface: eth1 + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: sriov + interface: eth1 + type: normal + vlan_tag: 1401 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 1402 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: sriov + ip_ranges: + - - "172.16.1.2" + - "172.16.1.250" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "172.30.14.10" + - "172.30.14.50" + cidr: "172.30.14.0/24" + gw: "172.30.14.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 172.30.14.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 10 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "172.30.14.1" + floating_ip_cidr: "172.30.14.0/24" + floating_ip_start: "172.30.14.100" + floating_ip_end: "172.30.14.200" diff --git a/deploy/conf/hardware_environment/huawei-pod8/network.yml b/deploy/conf/hardware_environment/huawei-pod8/network.yml new file mode 100644 index 00000000..d6b89d2b --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-pod8/network.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-provider + network: physnet + interface: eth1 + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 1401 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 1402 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: 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: + - - "172.30.14.10" + - "172.30.14.50" + cidr: "172.30.14.0/24" + gw: "172.30.14.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 172.30.14.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 10 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "172.30.14.1" + floating_ip_cidr: "172.30.14.0/24" + floating_ip_start: "172.30.14.100" + floating_ip_end: "172.30.14.200" diff --git a/deploy/conf/hardware_environment/intel-pod17/k8-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/intel-pod17/k8-nosdn-nofeature-ha.yml index 7cc2c215..660f5e2e 100644 --- a/deploy/conf/hardware_environment/intel-pod17/k8-nosdn-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/intel-pod17/k8-nosdn-nofeature-ha.yml @@ -27,6 +27,7 @@ hosts: roles: - kube_master - etcd + - ha - name: host2 mac: 'A4:BF:01:14:01:13' @@ -39,6 +40,7 @@ hosts: roles: - kube_master - etcd + - ha - name: host3 mac: 'A4:BF:01:14:71:1E' @@ -51,6 +53,7 @@ hosts: roles: - kube_master - etcd + - ha - name: host4 mac: 'A4:BF:01:16:2F:17' diff --git a/deploy/conf/hardware_environment/intel-pod17/network.yml b/deploy/conf/hardware_environment/intel-pod17/network.yml index bb6f5130..a524c52d 100644 --- a/deploy/conf/hardware_environment/intel-pod17/network.yml +++ b/deploy/conf/hardware_environment/intel-pod17/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/hardware_environment/intel-pod17/network_dpdk.yml b/deploy/conf/hardware_environment/intel-pod17/network_dpdk.yml index 7cc421e7..4b35483b 100644 --- a/deploy/conf/hardware_environment/intel-pod17/network_dpdk.yml +++ b/deploy/conf/hardware_environment/intel-pod17/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/network_cfg_dpdk.yaml b/deploy/conf/network_cfg_dpdk.yaml index e196d6f4..def5d308 100644 --- a/deploy/conf/network_cfg_dpdk.yaml +++ b/deploy/conf/network_cfg_dpdk.yaml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/network_cfg_sriov.yaml b/deploy/conf/network_cfg_sriov.yaml new file mode 100644 index 00000000..cb4d9b7f --- /dev/null +++ b/deploy/conf/network_cfg_sriov.yaml @@ -0,0 +1,109 @@ +############################################################################## +# 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-provider + network: physnet + interface: eth1 + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + 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.2" + - "172.16.1.250" + cidr: "172.16.1.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/virtual.conf b/deploy/conf/virtual.conf index 1e9034f3..f49f0c6b 100644 --- a/deploy/conf/virtual.conf +++ b/deploy/conf/virtual.conf @@ -1,9 +1,14 @@ -export VIRT_NUMBER=${VIRT_NUMBER:-5} export VIRT_CPUS=${VIRT_CPUS:-8} export VIRT_MEM=${VIRT_MEM:-16384} export VIRT_DISK=${VIRT_DISK:-200G} +export EXT_NAT_MASK=${EXT_NAT_MASK:-255.255.252.0} +export EXT_NAT_GW=${EXT_NAT_GW:-192.16.1.1} +export EXT_NAT_IP_START=${EXT_NAT_IP_START:-192.16.1.3} +export EXT_NAT_IP_END=${EXT_NAT_IP_END:-192.16.1.254} + export SWITCH_IPS="1.1.1.1" export SWITCH_CREDENTIAL="version=2c,community=public" export DEPLOYMENT_TIMEOUT="300" export POLL_SWITCHES_FLAG="nopoll_switches" +export NAT_EXTERNAL=${NAT_EXTERNAL:true} diff --git a/deploy/conf/vm_environment/huawei-virtual1/network.yml b/deploy/conf/vm_environment/huawei-virtual1/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual1/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual1/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual1/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual1/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual1/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual1/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual1/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual1/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual1/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual2/network.yml b/deploy/conf/vm_environment/huawei-virtual2/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual2/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual2/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual2/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual2/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual2/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual2/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual2/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual2/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual2/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual3/network.yml b/deploy/conf/vm_environment/huawei-virtual3/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual3/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual3/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual3/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual3/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual3/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual3/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual3/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual3/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual3/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual4/network.yml b/deploy/conf/vm_environment/huawei-virtual4/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual4/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual4/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual4/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual4/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual4/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual4/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual4/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual4/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual4/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual5/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual5/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual5/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual7/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual7/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual7/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual8/network.yml b/deploy/conf/vm_environment/huawei-virtual8/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual8/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual8/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual8/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual8/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual8/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual8/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual8/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual8/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual8/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/huawei-virtual9/network.yml b/deploy/conf/vm_environment/huawei-virtual9/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/huawei-virtual9/network.yml +++ b/deploy/conf/vm_environment/huawei-virtual9/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual9/network_dpdk.yml b/deploy/conf/vm_environment/huawei-virtual9/network_dpdk.yml index e196d6f4..def5d308 100644 --- a/deploy/conf/vm_environment/huawei-virtual9/network_dpdk.yml +++ b/deploy/conf/vm_environment/huawei-virtual9/network_dpdk.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/huawei-virtual9/network_odl.yml b/deploy/conf/vm_environment/huawei-virtual9/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/huawei-virtual9/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/k8-nosdn-nofeature-ha.yml b/deploy/conf/vm_environment/k8-nosdn-nofeature-ha.yml index 003f41be..42262057 100644 --- a/deploy/conf/vm_environment/k8-nosdn-nofeature-ha.yml +++ b/deploy/conf/vm_environment/k8-nosdn-nofeature-ha.yml @@ -16,16 +16,19 @@ hosts: roles: - kube_master - etcd + - ha - name: host2 roles: - kube_master - etcd + - ha - name: host3 roles: - kube_master - etcd + - ha - name: host4 roles: diff --git a/deploy/conf/vm_environment/k8-nosdn-nofeature-noha.yml b/deploy/conf/vm_environment/k8-nosdn-nofeature-noha.yml index 9912d59b..9c2c23fb 100644 --- a/deploy/conf/vm_environment/k8-nosdn-nofeature-noha.yml +++ b/deploy/conf/vm_environment/k8-nosdn-nofeature-noha.yml @@ -16,6 +16,7 @@ hosts: roles: - kube_master - etcd + - ha - name: host2 roles: diff --git a/deploy/conf/vm_environment/k8-nosdn-onap-noha.yml b/deploy/conf/vm_environment/k8-nosdn-onap-noha.yml new file mode 100644 index 00000000..d7b85a85 --- /dev/null +++ b/deploy/conf/vm_environment/k8-nosdn-onap-noha.yml @@ -0,0 +1,46 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: virtual +FLAVOR: cluster + +plugins: + - onap: "Enable" + +hosts: + - name: host1 + roles: + - kube_master + - etcd + - ha + + - name: host2 + roles: + - kube_node + + - name: host3 + roles: + - kube_node + + - name: host4 + roles: + - kube_node + + - name: host5 + roles: + - kube_node + + - name: host6 + roles: + - kube_node + + - name: host7 + roles: + - kube_node diff --git a/deploy/conf/vm_environment/k8-nosdn-stor4nfv-ha.yml b/deploy/conf/vm_environment/k8-nosdn-stor4nfv-ha.yml new file mode 100644 index 00000000..e5e458f7 --- /dev/null +++ b/deploy/conf/vm_environment/k8-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: + - kube_master + - etcd + - ha + + - name: host2 + roles: + - kube_master + - etcd + - ha + + - name: host3 + roles: + - kube_master + - etcd + - ha + - storage_master + + - name: host4 + roles: + - kube_node + - storage_node + + - name: host5 + roles: + - kube_node + - storage_node diff --git a/deploy/conf/vm_environment/k8-nosdn-stor4nfv-noha.yml b/deploy/conf/vm_environment/k8-nosdn-stor4nfv-noha.yml new file mode 100644 index 00000000..f8c29b3e --- /dev/null +++ b/deploy/conf/vm_environment/k8-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: + - kube_master + - etcd + - storage_master + - ha + + - name: host2 + roles: + - kube_node + - storage_node diff --git a/deploy/conf/vm_environment/k8-ocl-nofeature-noha.yml b/deploy/conf/vm_environment/k8-ocl-nofeature-noha.yml new file mode 100644 index 00000000..fd7bfda0 --- /dev/null +++ b/deploy/conf/vm_environment/k8-ocl-nofeature-noha.yml @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: virtual +FLAVOR: cluster + +plugins: + - opencontrail: "Enable" + +hosts: + - name: host1 + roles: + - kube_master + - etcd + - opencontrail + - ha + + - name: host2 + roles: + - kube_node diff --git a/deploy/conf/vm_environment/network.yml b/deploy/conf/vm_environment/network.yml index 4359202e..420b478a 100644 --- a/deploy/conf/vm_environment/network.yml +++ b/deploy/conf/vm_environment/network.yml @@ -14,7 +14,7 @@ bond_mappings: [] provider_net_mappings: - name: br-provider network: physnet - interface: eth10 + interface: eth1 type: ovs role: - controller diff --git a/deploy/conf/vm_environment/network_odl.yml b/deploy/conf/vm_environment/network_odl.yml new file mode 100644 index 00000000..017c6f6d --- /dev/null +++ b/deploy/conf/vm_environment/network_odl.yml @@ -0,0 +1,126 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-int + network: physnet + interface: external-nic + type: ovs + role: + - controller + +sys_intf_mappings: + - name: mgmt + interface: eth0 + type: normal + vlan_tag: None + role: + - controller + - compute + + - name: tenant + interface: eth1 + type: normal + vlan_tag: 101 + role: + - controller + - compute + + - name: storage + interface: eth1 + type: normal + vlan_tag: 102 + role: + - controller + - compute + + - name: external + interface: eth1 + type: normal + vlan_tag: None + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "10.1.0.50" + - "10.1.0.100" + dhcp_ranges: + - - "10.1.0.2" + - "10.1.0.49" + cidr: "10.1.0.0/24" + gw: "10.1.0.1" + role: + - controller + - compute + + - name: tenant + ip_ranges: + - - "172.16.1.1" + - "172.16.1.50" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.50" + cidr: "172.16.2.0/24" + role: + - controller + - compute + + - name: external + ip_ranges: + - - "192.16.1.210" + - "192.16.1.220" + cidr: "192.16.1.0/24" + gw: "192.16.1.1" + role: + - controller + - compute + +internal_vip: + ip: 10.1.0.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.16.1.222 + netmask: "24" + interface: external + +onos_nic: eth2 +tenant_net_info: + type: vxlan + range: "1:1000" + provider_network: None + +public_net_info: + enable: "True" + network: ext-net + type: flat + segment_id: 1000 + subnet: ext-subnet + provider_network: physnet + router: router-ext + enable_dhcp: "False" + no_gateway: "False" + external_gw: "192.16.1.1" + floating_ip_cidr: "192.16.1.0/24" + floating_ip_start: "192.16.1.101" + floating_ip_end: "192.16.1.199" diff --git a/deploy/conf/vm_environment/os-nosdn-stor4nfv-ha.yml b/deploy/conf/vm_environment/os-nosdn-stor4nfv-ha.yml new file mode 100644 index 00000000..1ef4bdd9 --- /dev/null +++ b/deploy/conf/vm_environment/os-nosdn-stor4nfv-ha.yml @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: virtual +FLAVOR: cluster + +plugins: + - stor4nfv: "Enable" + +hosts: + - name: host1 + roles: + - controller + - ha + - ceph-adm + - ceph-mon + + - name: host2 + roles: + - controller + - ha + - ceph-mon + + - name: host3 + roles: + - controller + - ha + - ceph-mon + + - name: host4 + roles: + - compute + - ceph-osd + + - name: host5 + roles: + - compute + - ceph-osd diff --git a/deploy/conf/vm_environment/os-nosdn-stor4nfv-noha.yml b/deploy/conf/vm_environment/os-nosdn-stor4nfv-noha.yml new file mode 100644 index 00000000..e03a4d4d --- /dev/null +++ b/deploy/conf/vm_environment/os-nosdn-stor4nfv-noha.yml @@ -0,0 +1,28 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +--- +TYPE: virtual +FLAVOR: cluster + +plugins: + - stor4nfv: "Enable" + +hosts: + - name: host1 + roles: + - controller + - ha + - ceph-adm + - ceph-mon + + - name: host2 + roles: + - compute + - ceph-osd diff --git a/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml b/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml index fb530012..1517fffc 100644 --- a/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml @@ -11,7 +11,8 @@ TYPE: virtual FLAVOR: cluster -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" plugins: - opendaylight: "Enable" diff --git a/deploy/conf/vm_environment/os-odl_l3-nofeature-noha.yml b/deploy/conf/vm_environment/os-odl_l3-nofeature-noha.yml index 6e3c0a94..e6491afe 100644 --- a/deploy/conf/vm_environment/os-odl_l3-nofeature-noha.yml +++ b/deploy/conf/vm_environment/os-odl_l3-nofeature-noha.yml @@ -11,7 +11,8 @@ TYPE: virtual FLAVOR: cluster -odl_l3_agent: "Enable" +cluster_param: + - odl_l3_agent: "Enable" plugins: - opendaylight: "Enable" diff --git a/deploy/config_parse.py b/deploy/config_parse.py index 3d8dedc5..88a31e9a 100644 --- a/deploy/config_parse.py +++ b/deploy/config_parse.py @@ -11,29 +11,44 @@ import os import netaddr import yaml import sys +import random from Cheetah.Template import Template -PXE_INTF = "eth0" - -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: @@ -43,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 @@ -59,14 +76,19 @@ def hostroles(s, seq, host=None): @decorator -def hostmacs(s, seq, host=None): - return host.get('mac', '') - - -def export_network_file(dha, network, ofile): - env = {} - - mgmt_net = [item for item in network['ip_settings'] +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, output_path): + install_network_env = {} + host_network_env = {} + ip_settings = network['ip_settings'] + mgmt_net = [item for item in ip_settings if item['name'] == 'mgmt'][0] mgmt_gw = mgmt_net['gw'] mgmt_cidr = mgmt_net['cidr'] @@ -74,12 +96,15 @@ def export_network_file(dha, network, ofile): mgmt_netmask = '.'.join([str((0xffffffff << (32 - prefix) >> i) & 0xff) for i in [24, 16, 8, 0]]) dhcp_ip_range = ' '.join(mgmt_net['dhcp_ranges'][0]) - env.update({'INSTALL_GW': mgmt_gw}) - env.update({'INSTALL_CIDR': mgmt_cidr}) - env.update({'INSTALL_NETMASK': mgmt_netmask}) - env.update({'INSTALL_IP_RANGE': dhcp_ip_range}) - export_env_dict(env, ofile) - + internal_vip = network['internal_vip']['ip'] + install_network_env.update({'INSTALL_GW': mgmt_gw}) + install_network_env.update({'INSTALL_CIDR': mgmt_cidr}) + 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, output_path) + + pxe_nic = os.environ['PXE_NIC'] host_ip_range = mgmt_net['ip_ranges'][0] host_ips = netaddr.iter_iprange(host_ip_range[0], host_ip_range[1]) host_networks = [] @@ -87,12 +112,15 @@ def export_network_file(dha, network, ofile): host_name = host['name'] host_ip = str(host_ips.next()) host_networks.append( - "{0}:{1}={2}|is_mgmt".format(host_name, PXE_INTF, host_ip)) - host_network_env = {"HOST_NETWORKS": ';'.join(host_networks)} - export_env_dict(host_network_env, ofile, True) + '{0}:{1}={2}|is_mgmt'.format(host_name, pxe_nic, host_ip)) + host_subnets = [item['cidr'] for item in ip_settings] + 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, 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', []): @@ -104,20 +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 @@ -135,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 7a91bd88..7a7b5dd5 100755 --- a/deploy/deploy_host.sh +++ b/deploy/deploy_host.sh @@ -37,19 +37,20 @@ function deploy_host(){ --adapter_flavor_pattern="${ADAPTER_FLAVOR_PATTERN}" --repo_name="${REPO_NAME}" \ --http_proxy="${PROXY}" --https_proxy="${PROXY}" --no_proxy="${IGNORE_PROXY}" \ --ntp_server="${NTP_SERVER}" --dns_servers="${NAMESERVERS}" --domain="${DOMAIN}" \ - --search_path="${SEARCH_PATH}" --default_gateway="${GATEWAY}" \ + --search_path="${SEARCH_PATH}" --default_gateway="${INSTALL_GW}" \ --server_credential="${SERVER_CREDENTIAL}" --local_repo_url="${LOCAL_REPO_URL}" \ --os_config_json_file="${OS_CONFIG_FILENAME}" --service_credentials="${SERVICE_CREDENTIALS}" \ --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 03a1230f..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() { @@ -52,6 +53,11 @@ function launch_host_vms() { vm_template_file="$vm_template_dir/host.xml" vm_template_arch="$vm_template_dir/host-$COMPASS_ARCH.xml" [ -f $vm_template_arch ] && vm_template_file=$vm_template_arch + if [[ "$NAT_EXTERNAL" == "false" ]]; then + NET_IAAS="external" + else + NET_IAAS="external_nat" + fi log_info "bringing up pxe boot vms" i=0 @@ -67,7 +73,7 @@ function launch_host_vms() { -e "s#REPLACE_IMAGE#$vm_dir/disk.img#g" \ -e "s/REPLACE_BOOT_MAC/${mac_array[i]}/g" \ -e "s/REPLACE_NET_INSTALL/install/g" \ - -e "s/REPLACE_NET_IAAS/external_nat/g" \ + -e "s/REPLACE_NET_IAAS/$NET_IAAS/g" \ "$vm_template_file" \ > $vm_dir/libvirt.xml @@ -92,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 6cbad1fa..b11127ca 100755 --- a/deploy/launch.sh +++ b/deploy/launch.sh @@ -15,6 +15,7 @@ mkdir -p $WORK_DIR/script export DEPLOY_FIRST_TIME=${DEPLOY_FIRST_TIME:-"true"} export DEPLOY_RECOVERY=${DEPLOY_RECOVERY:-"false"} +source ${COMPASS_DIR}/deploy/conf/base.conf source ${COMPASS_DIR}/deploy/prepare.sh prepare_python_env source ${COMPASS_DIR}/util/log.sh @@ -24,7 +25,6 @@ check_input_para source $(process_default_para $*) || exit 1 source ${COMPASS_DIR}/deploy/conf/${FLAVOR}.conf source ${COMPASS_DIR}/deploy/conf/${TYPE}.conf -source ${COMPASS_DIR}/deploy/conf/base.conf source ${COMPASS_DIR}/deploy/conf/compass.conf source ${COMPASS_DIR}/deploy/network.sh source ${COMPASS_DIR}/deploy/host_${TYPE}.sh @@ -53,9 +53,14 @@ if [[ "$EXPANSION" == "false" ]]; then exit 1 fi + export machine_file=$WORK_DIR/script/machine export machines - if [[ "$DEPLOY_COMPASS" == "true" ]]; then + CONTAINER_ALIVE=$(check_container_alive) + if + [[ "$DEPLOY_FIRST_TIME" == "true" ]] || + [[ "$DEPLOY_COMPASS" == "true" && "$CONTAINER_ALIVE" == "false" ]] + then if ! prepare_env;then echo "prepare_env failed" exit 1 @@ -71,7 +76,9 @@ if [[ "$EXPANSION" == "false" ]]; then log_error "launch_compass failed" exit 1 fi - else + elif + [[ "$DEPLOY_COMPASS" == "true" && "$CONTAINER_ALIVE" == "true" ]] + then refresh_compass_core fi else @@ -84,6 +91,13 @@ else log_info "deploy host macs: $machines" fi +if [[ "$DEPLOY_HARBOR" == "true" ]]; then + if ! launch_harbor;then + log_error "launch_harbor failed" + exit 1 + fi +fi + if [[ "$REDEPLOY_HOST" != "true" ]]; then if ! set_compass_machine; then log_error "set_compass_machine fail" diff --git a/deploy/network.sh b/deploy/network.sh index 698771b3..b74a1b40 100755 --- a/deploy/network.sh +++ b/deploy/network.sh @@ -10,6 +10,10 @@ function clear_forward_rejct_rules() { while sudo iptables -nL FORWARD --line-number|grep -E 'REJECT +all +-- +0.0.0.0/0 +0.0.0.0/0 +reject-with icmp-port-unreachable'|head -1|awk '{print $1}'|xargs sudo iptables -D FORWARD; do :; done + ip_forward=$(cat /proc/sys/net/ipv4/ip_forward) + if [ $ip_forward -eq 0 ]; then + sysctl -w net.ipv4.ip_forward=1 + fi } function setup_bridge_net() @@ -76,9 +80,9 @@ function setup_bridge_external() sudo virsh net-destroy external sudo virsh net-undefine external - #save_network_info + save_network_info sed -e "s/REPLACE_NAME/external/g" \ - -e "s/REPLACE_OVS/br-external_nat/g" \ + -e "s/REPLACE_OVS/br-external/g" \ $COMPASS_DIR/deploy/template/network/bridge_ovs.xml \ > $WORK_DIR/network/external.xml @@ -86,14 +90,12 @@ function setup_bridge_external() sudo virsh net-start external sudo virsh net-autostart external - python $COMPASS_DIR/deploy/setup_vnic.py } function recover_bridge_external() { sudo virsh net-start external - python $COMPASS_DIR/deploy/setup_vnic.py } function setup_nat_net() { @@ -128,7 +130,12 @@ function recover_nat_net() { function setup_virtual_net() { setup_nat_net install $INSTALL_GW $INSTALL_NETMASK - setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END + + if [[ "$NAT_EXTERNAL" == "false" ]]; then + setup_bridge_external + else + setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END + fi } function recover_virtual_net() { @@ -140,7 +147,8 @@ function setup_baremetal_net() { exit 1 fi sudo ifconfig $INSTALL_NIC up - sudo ifconfig $INSTALL_NIC $INSTALL_GW + sudo ifconfig $INSTALL_NIC promisc + sudo ifconfig $INSTALL_NIC $INSTALL_GW netmask $INSTALL_NETMASK } function recover_baremetal_net() { diff --git a/deploy/opera_adapter.py b/deploy/opera_adapter.py deleted file mode 100644 index fbf1b662..00000000 --- a/deploy/opera_adapter.py +++ /dev/null @@ -1,126 +0,0 @@ -############################################################################## -# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -import os -import sys -import yaml -import re -import subprocess -import traceback - - -def load_file(file): - with open(file) as fd: - try: - return yaml.safe_load(fd) - except: - traceback.print_exc() - return None - - -def dump_file(data, file): - with open(file, 'w') as fd: - try: - return yaml.dump(data, fd, default_flow_style=False) - except: - traceback.print_exc() - return None - - -def sync_openo_config(openo_config, dha, network): - """sync opera/conf/open-o.yml according to DHA and Network file""" - deploy_opts = dha.get('deploy_options') - openo_net = network.get('openo_net') - if deploy_opts['orchestrator']['type'] != 'open-o': - print("orchestrator is not openo") - sys.exit(1) - - openo_config['openo_version'] = deploy_opts['orchestrator']['version'] - openo_config['vnf_type'] = deploy_opts['vnf']['type'] - openo_config['openo_net']['openo_ip'] = openo_net['openo_ip'] - - -def sync_admin_openrc(network, admin_openrc_file): - ssh_opts = "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - vip = network['public_vip']['ip'] - cmd = 'sshpass -p"root" ssh %s root@%s "cat /opt/admin-openrc.sh"' \ - % (ssh_opts, vip) - ssh = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - if ssh.stdout is None: - print("fetch openrc fail") - sys.exit(1) - - rcdata = ssh.stdout.readlines() - with open(admin_openrc_file, 'w') as fd: - ip = re.compile("\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}") - for i in rcdata: - if 'OS_AUTH_URL' in i: - i = re.sub(ip, vip, i) - fd.write(i) - - fd.write('export OS_REGION_NAME=RegionOne') - - -if __name__ == "__main__": - if len(sys.argv) != 3: - print("parameter wrong%d %s" % (len(sys.argv), sys.argv)) - sys.exit(1) - - _, dha_file, network_file = sys.argv - compass_dir = os.getenv('COMPASS_DIR') - - if not compass_dir: - print("env var COMPASS_DIR doesn't exist") - sys.exit(1) - - if not os.path.exists(dha_file): - print("DHA file doesn't exist") - sys.exit(1) - if not os.path.exists(network_file): - print("NETWORK file doesn't exist") - sys.exit(1) - - dha = load_file(dha_file) - network = load_file(network_file) - - if not dha: - print('format error in DHA: %s' % dha_file) - sys.exit(1) - if not network: - print('format error in NETWORK: %s' % network_file) - sys.exit(1) - - work_dir = os.path.join(compass_dir, 'work') - opera_dir = os.path.join(work_dir, 'opera') - conf_dir = os.path.join(opera_dir, 'conf') - openo_config_file = os.path.join(conf_dir, 'open-o.yml') - admin_openrc_file = os.path.join(conf_dir, 'admin-openrc.sh') - - p1 = subprocess.Popen( - "git clone https://gerrit.opnfv.org/gerrit/opera", - cwd=work_dir, shell=True) - p1.communicate() - - if not os.path.exists(openo_config_file): - print('file opera/conf/open-o.yml not found') - sys.exit(1) - if not os.path.exists(admin_openrc_file): - print('file opera/conf/admin-openrc.sh not found') - sys.exit(1) - - openo_config = load_file(openo_config_file) - sync_openo_config(openo_config, dha, network) - dump_file(openo_config, openo_config_file) - sync_admin_openrc(network, admin_openrc_file) - - p2 = subprocess.Popen("./opera_launch.sh", cwd=opera_dir, shell=True) - p2.communicate() - if p2.returncode != 0: - print('./opera_launch.sh fail') - sys.exit(1) diff --git a/deploy/prepare.sh b/deploy/prepare.sh index c0a05564..f11ae74c 100755 --- a/deploy/prepare.sh +++ b/deploy/prepare.sh @@ -48,7 +48,14 @@ function extract_tar() function prepare_env() { sudo sed -i -e 's/^#user =.*/user = "root"/g' /etc/libvirt/qemu.conf sudo sed -i -e 's/^#group =.*/group = "root"/g' /etc/libvirt/qemu.conf + sudo sed -i 's/^.\?listen_tls.*/listen_tls = 0/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?listen_tcp.*/listen_tcp = 1/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?tcp_port.*/tcp_port = "16509"/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?listen_addr.*/listen_addr = "0.0.0.0"/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?auth_tcp.*/auth_tcp = "none"/g' /etc/libvirt/libvirtd.conf + sudo sed -i 's/^.\?libvirtd_opts.*/libvirtd_opts="-d -l"/g' /etc/default/libvirt-bin sudo service libvirt-bin restart + if sudo service openvswitch-switch status|grep stop; then sudo service openvswitch-switch start fi @@ -89,7 +96,7 @@ function _prepare_python_env() { sudo apt-get install -y --force-yes libxslt-dev libxml2-dev libvirt-dev build-essential qemu-utils qemu-kvm libvirt-bin virtinst libmysqld-dev sudo apt-get install -y --force-yes libffi-dev libssl-dev else - sudo yum install -y centos-release-openstack-pike + sudo yum install -y centos-release-openstack-queens sudo yum install -y epel-release sudo yum install openvswitch -y --nogpgcheck sudo yum install -y git python-devel python-pip figlet sshpass mkisofs bc curl ipmitool diff --git a/deploy/template/vm/host-aarch64.xml b/deploy/template/vm/host-aarch64.xml index 7f32a198..69202fd2 100644 --- a/deploy/template/vm/host-aarch64.xml +++ b/deploy/template/vm/host-aarch64.xml @@ -9,9 +9,6 @@ <boot dev='hd'/> <boot dev='network'/> </os> - <features> - <gic version='2'/> - </features> <cpu mode='host-passthrough'/> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> diff --git a/docs/release/installation/configure-network.rst b/docs/release/installation/configure-network.rst index 2303be45..25dfb76d 100644 --- a/docs/release/installation/configure-network.rst +++ b/docs/release/installation/configure-network.rst @@ -1,3 +1,6 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International Licence. +.. http://creativecommons.org/licenses/by/4.0 + Configure network ================= network_cfg.yaml file describes networks configuration for openstack on hosts. It diff --git a/docs/release/installation/featureTable.rst b/docs/release/installation/featureTable.rst index 2cd74a2b..c810a072 100644 --- a/docs/release/installation/featureTable.rst +++ b/docs/release/installation/featureTable.rst @@ -1,54 +1,57 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International Licence. +.. http://creativecommons.org/licenses/by/4.0 + Features ======== Supported Openstack Version and OS ---------------------------------- -+---------------+----------+-----------+-----------+-----------+-----------+ -| | OS | OpenStack | OpenStack | OpenStack | OpenStack | -| | only | Liberty | Mitaka | Newton | Ocata | -+---------------+----------+-----------+-----------+-----------+-----------+ -| CentOS 7 | yes | yes | yes | yes | no | -+---------------+----------+-----------+-----------+-----------+-----------+ -| Ubuntu trusty | yes | yes | yes | no | no | -+---------------+----------+-----------+-----------+-----------+-----------+ -| Ubuntu xenial | yes | no | yes | yes | yes | -+---------------+----------+-----------+-----------+-----------+-----------+ ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ +| | OS | OpenStack | OpenStack | OpenStack | OpenStack | OpenStack | +| | only | Liberty | Mitaka | Newton | Ocata | Pike | ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ +| CentOS 7 | yes | yes | yes | yes | no | yes | ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ +| Ubuntu trusty | yes | yes | yes | no | no | no | ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ +| Ubuntu xenial | yes | no | yes | yes | yes | yes | ++---------------+----------+-----------+-----------+-----------+-----------+-----------+ Supported Openstack Flavor and Features --------------------------------------- -+---------------+--------------+--------------+---------------+---------------+ -| | OpenStack | OpenStack | OpenStack | OpenStack | -| | Liberty | Mitaka | Newton | Ocata | -+---------------+--------------+--------------+---------------+---------------+ -| Virtual | Yes | Yes | Yes | Yes | -| Deployment | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Baremetal | Yes | Yes | Yes | Yes | -| Deployment | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| HA | Yes | Yes | Yes | Yes | -| | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Ceph | Yes | Yes | Yes | Yes | -| | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| SDN | Yes | Yes | Yes | Yes* | -| ODL/ONOS | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Compute Node | Yes | Yes | Yes | No | -| Expansion | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Multi-Nic | Yes | Yes | Yes | Yes | -| Support | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| Boot | Yes | Yes | Yes | Yes | -| Recovery | | | | | -+---------------+--------------+--------------+---------------+---------------+ -| SFC | No | No | Yes | Yes | -| | | | | | -+---------------+--------------+--------------+---------------+---------------+ ++---------------+--------------+--------------+---------------+---------------+---------------+ +| | OpenStack | OpenStack | OpenStack | OpenStack | OpenStack | +| | Liberty | Mitaka | Newton | Ocata | Pike | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Virtual | Yes | Yes | Yes | Yes | Yes | +| Deployment | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Baremetal | Yes | Yes | Yes | Yes | Yes | +| Deployment | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| HA | Yes | Yes | Yes | Yes | Yes | +| | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Ceph | Yes | Yes | Yes | Yes | Yes | +| | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| SDN | Yes | Yes | Yes | Yes* | Yes* | +| ODL/ONOS | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Compute Node | Yes | Yes | Yes | No | No | +| Expansion | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Multi-Nic | Yes | Yes | Yes | Yes | Yes | +| Support | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| Boot | Yes | Yes | Yes | Yes | Yes | +| Recovery | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ +| SFC | No | No | Yes | Yes | Yes | +| | | | | | | ++---------------+--------------+--------------+---------------+---------------+---------------+ * ONOS will not be supported in this release. diff --git a/docs/release/installation/installation.rst b/docs/release/installation/installation.rst index 05c5e2ef..2fb51641 100644 --- a/docs/release/installation/installation.rst +++ b/docs/release/installation/installation.rst @@ -6,7 +6,7 @@ Compass4nfv configuration ========================= This document describes providing guidelines on how to install and -configure the Euphrates release of OPNFV when using Compass4nfv as a +configure the Fraser release of OPNFV when using Compass4nfv as a deployment tool including required software and hardware configurations. @@ -21,7 +21,7 @@ networking and Unix/Linux administration. Preconditions ------------- -Before starting the installation of the Euphrates release of OPNFV, +Before starting the installation of the Fraser release of OPNFV, some planning must be done. @@ -37,10 +37,10 @@ The daily build tarball can be retrieved via OPNFV artifacts repository: http://artifacts.opnfv.org/compass4nfv.html -NOTE: Search the keyword "compass4nfv/Euphrates" to locate the ISO image. +NOTE: Search the keyword "compass4nfv/Fraser" to locate the ISO image. E.g. -compass4nfv/Euphrates/opnfv-2017-09-18_08-15-13.tar.gz +compass4nfv/Fraser/opnfv-2017-09-18_08-15-13.tar.gz The name of tarball includes the time of iso building, you can get the daily ISO according the building time. @@ -57,9 +57,9 @@ To retrieve the repository of Compass4nfv on Jumphost use the following command: NOTE: PLEASE DO NOT GIT CLONE COMPASS4NFV IN ROOT DIRECTORY(INCLUDE SUBFOLDERS). -To get stable /Euphrates release, you can use the following command: +To get stable /Fraser release, you can use the following command: -- git checkout Euphrates.1.0 +- git checkout Fraser.1.0 Setup Requirements ------------------ diff --git a/docs/release/installation/introduction.rst b/docs/release/installation/introduction.rst index 6ffc3d17..5f0b0b28 100644 --- a/docs/release/installation/introduction.rst +++ b/docs/release/installation/introduction.rst @@ -5,7 +5,7 @@ Abstract ======== -This document describes how to install the Euphrates release of OPNFV when +This document describes how to install the Fraser release of OPNFV when using Compass4nfv as a deployment tool covering it's limitations, dependencies and required system resources. diff --git a/docs/release/installation/k8s-deploy-arm.rst b/docs/release/installation/k8s-deploy-arm.rst new file mode 100644 index 00000000..8c809bf6 --- /dev/null +++ b/docs/release/installation/k8s-deploy-arm.rst @@ -0,0 +1,116 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International Licence. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) by Yibo Cai (Arm) + +Validated platform +================== + +Jump server: Baremetal, Ubuntu 16.04 + +Node: VM / Baremetal, CentOS 7 / Ubuntu 16.04, K8s 1.9.1 + +Prepare jump server +=================== +A baremetal Arm server is required as Compass4NFV jump server. + +#. Install Ubuntu 16.04 aarch64 on jump server. + +#. Install required packages. + + .. code-block:: bash + + $ sudo apt install docker.io libvirt-bin virt-manager qemu qemu-efi + +#. Disable DHCP of default libvirt network. + + Libvirt creates a default network at intallation, which enables DHCP and occupies port 67. It conflicts with compass-cobbler container. + + .. code-block:: bash + + $ sudo virsh net-edit default + + .. code-block:: xml + + <!-- remove below lines and save/quit -> + <dhcp> + <range start='192.168.122.2' end='192.168.122.254'/> + </dhcp> + + .. code-block:: bash + + $ sudo virsh net-destroy default + $ sudo virsh net-start default + +#. Make sure ports 67, 69, 80, 443 are free. + + Compass-cobber requires ports 67, 69 to provide DHCP and TFTP services. Compass-deck provides HTTP and HTTPS through ports 80, 443. All these ports should be free before deployment. + +#. Tear down apparmor service. + + .. code-block:: bash + + $ sudo service apparmor teardown + +#. Enable password-less sudo for current user (optional). + + +Build Arm tarball +================= + +Clone Compass4NFV code. Run below command to build deployment tarball for Arm. + +.. code-block:: bash + + $ ./build.sh + +It downloads and archives Ubuntu/CentOS installation ISO and Compass core docker images for later deployment. + + +Deploy K8s +========== +This section introduces the steps to deploy K8s cluster in VM and baremetal nodes. + +Clear old Compass core +---------------------- + +Compass core consists of five containers which are responsible for deploying K8s clusters. + +- *compass-deck*: provides API service and web UI +- *compass-tasks*: deploy K8s to nodes +- *compass-cobbler*: deploy OS to nodes +- *compass-db*: mysql service +- *compass-mq*: rabbitmq service + +Run below command to remove running Compass containers for a clean deployment. + +.. code-block:: bash + + $ docker rm -f `docker ps | grep compass | cut -f1 -d' '` + +Deploy OS and K8s +----------------- +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.9.1 \ + DHA=deploy/conf/vm_environment/k8-nosdn-nofeature-noha.yml \ + NETWORK=deploy/conf/vm_environment/network.yml \ + VIRT_NUMBER=2 VIRT_CPUS=4 VIRT_MEM=8192 VIRT_DISK=50G \ + ./deploy.sh + +To deploy on baremetal nodes, reference below DHA and NETWORK files: + +.. code-block:: bash + + DHA="deploy/conf/hardware_environment/huawei-pod8/k8-nosdn-nofeature-noha.yml" + NETWORK="deploy/conf/hardware_environment/huawei-pod8/network.yml" + +To deploy Ubuntu, set: + +.. code-block:: bash + + ADAPTER_OS_PATTERN='(?i)ubuntu-16.*arm.*' + OS_VERSION=xenial diff --git a/docs/release/installation/k8s-deploy.rst b/docs/release/installation/k8s-deploy.rst index 49025ee3..0c1ffbd0 100644 --- a/docs/release/installation/k8s-deploy.rst +++ b/docs/release/installation/k8s-deploy.rst @@ -20,7 +20,7 @@ If you want to deploy noha with1 controller and 1 compute, run the following com export SCENARIO=k8-nosdn-nofeature-noha.yml export VIRT_NUMBER=2 - curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/euphrates/quickstart_k8s.sh | bash + curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/fraser/quickstart_k8s.sh | bash Installation of K8s on Bare Metal ================================= diff --git a/docs/release/installation/offline-deploy.rst b/docs/release/installation/offline-deploy.rst index d35d7e1b..a3a33a09 100644 --- a/docs/release/installation/offline-deploy.rst +++ b/docs/release/installation/offline-deploy.rst @@ -1,3 +1,5 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International Licence. +.. http://creativecommons.org/licenses/by/4.0 .. two dots create a comment. please leave this logo at the top of each of your rst files. Offline Deploy diff --git a/docs/release/installation/preconditions.rst b/docs/release/installation/preconditions.rst index 3ba42ab6..9264c793 100644 --- a/docs/release/installation/preconditions.rst +++ b/docs/release/installation/preconditions.rst @@ -21,7 +21,7 @@ networking and Unix/Linux administration. Preconditions ------------- -Before starting the installation of the Euphrates release of OPNFV, +Before starting the installation of the Fraser release of OPNFV, some planning must be done. @@ -38,10 +38,10 @@ The daily build tarball can be retrieved via OPNFV artifacts repository: http://artifacts.opnfv.org/compass4nfv.html -NOTE: Search the keyword "compass4nfv/Euphrates" to locate the tarball. +NOTE: Search the keyword "compass4nfv/Fraser" to locate the tarball. E.g. -compass4nfv/euphrates/opnfv-2017-03-29_08-55-09.tar.gz +compass4nfv/fraser/opnfv-2017-03-29_08-55-09.tar.gz The name of tarball includes the time of tarball building, you can get the daily tarball according the building time. @@ -58,9 +58,9 @@ To retrieve the repository of Compass4nfv on Jumphost use the following command: NOTE: PLEASE DO NOT GIT CLONE COMPASS4NFV IN ROOT DIRECTORY(INCLUDE SUBFOLDERS). -To get stable/euphrates release, you can use the following command: +To get stable/fraser release, you can use the following command: -- git checkout Euphrates.1.0 +- git checkout Fraser.1.0 Setup Requirements ------------------ diff --git a/docs/release/installation/vmdeploy.rst b/docs/release/installation/vmdeploy.rst index 5db934be..4f1336c5 100644 --- a/docs/release/installation/vmdeploy.rst +++ b/docs/release/installation/vmdeploy.rst @@ -12,15 +12,14 @@ Only 1 command to try virtual deployment, if you have Internet access. Just Past .. code-block:: bash - curl https://raw.githubusercontent.com/opnfv/compass4nfv/euphrates/quickstart.sh | bash + curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/fraser/quickstart.sh | bash If you want to deploy noha with1 controller and 1 compute, run the following command .. code-block:: bash export SCENARIO=os-nosdn-nofeature-noha.yml - export VIRT_NUMBER=2 - curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/euphrates/quickstart.sh | bash + curl https://raw.githubusercontent.com/opnfv/compass4nfv/stable/fraser/quickstart.sh | bash Nodes Configuration (Virtual Deployment) ---------------------------------------- @@ -28,8 +27,6 @@ Nodes Configuration (Virtual Deployment) virtual machine setting ~~~~~~~~~~~~~~~~~~~~~~~ - - VIRT_NUMBER -- the number of nodes for virtual deployment. - - VIRT_CPUS -- the number of CPUs allocated per virtual machine. - VIRT_MEM -- the memory size(MB) allocated per virtual machine. @@ -38,7 +35,6 @@ virtual machine setting .. code-block:: bash - export VIRT_NUMBER=${VIRT_NUMBER:-5} export VIRT_CPUS=${VIRT_CPU:-4} export VIRT_MEM=${VIRT_MEM:-16384} export VIRT_DISK=${VIRT_DISK:-200G} @@ -146,7 +142,7 @@ Start Deployment (Virtual Deployment) 1. Edit deploy.sh 1.1. Set OS version for deployment nodes. - Compass4nfv supports ubuntu and centos based openstack ocata. + Compass4nfv supports ubuntu and centos based openstack pike. E.g. diff --git a/docs/release/release-notes/release-notes.rst b/docs/release/release-notes/release-notes.rst index 73825062..b6096568 100644 --- a/docs/release/release-notes/release-notes.rst +++ b/docs/release/release-notes/release-notes.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Weidong Shao (HUAWEI) and Justin Chi (HUAWEI) -Release Note for the Euphrates release of OPNFV when using Compass4nfv as a deployment tool. +Release Note for the Fraser release of OPNFV when using Compass4nfv as a deployment tool. Abstract ======== @@ -25,16 +25,16 @@ Release Data | **Project** | Compass4nfv | | | | +--------------------------------------+--------------------------------------+ -| **Repo/tag** | Compass4nfv/Euphrates.1.0 | +| **Repo/tag** | Compass4nfv/Fraser.1.0 | | | | +--------------------------------------+--------------------------------------+ -| **Release designation** | Euphrates.1.0 | +| **Release designation** | Fraser.1.0 | | | | +--------------------------------------+--------------------------------------+ -| **Release date** | October 2017 | +| **Release date** | March 2018 | | | | +--------------------------------------+--------------------------------------+ -| **Purpose of the delivery** | OPNFV Euphrates release | +| **Purpose of the delivery** | OPNFV Fraser release | | | | +--------------------------------------+--------------------------------------+ @@ -44,16 +44,16 @@ Deliverables Software deliverables ~~~~~~~~~~~~~~~~~~~~~ - - Compass4nfv/Euphrates.1.0 tarball, please get it from `OPNFV software download page <https://www.opnfv.org/software/>`_ + - Compass4nfv/Fraser.1.0 tarball, please get it from `OPNFV software download page <https://www.opnfv.org/software/>`_ .. _document-label: Documentation deliverables ~~~~~~~~~~~~~~~~~~~~~~~~~~ - - OPNFV(Euphrates) Compass4nfv installation instructions + - OPNFV(Fraser) Compass4nfv installation instructions - - OPNFV(Euphrates) Compass4nfv Release Notes + - OPNFV(Fraser) Compass4nfv Release Notes Version change -------------- @@ -62,16 +62,16 @@ Version change Module version change ~~~~~~~~~~~~~~~~~~~~~ -This is the Euphrates release of compass4nfv as a deployment toolchain in OPNFV, the following +This is the Fraser release of compass4nfv as a deployment toolchain in OPNFV, the following upstream components supported with this release. - - Ubuntu 16.04/Centos 7.3 + - Ubuntu 16.04.3/Centos 7.4 - - Openstack (Ocata release) + - Openstack (Pike release) - - Kubernates (1.7.3) + - Kubernates (1.9) - - Opendaylight (Nitrogen release) + - Opendaylight (Nitrogen SR1 release) Reason for new version @@ -135,27 +135,15 @@ System Limitations Scenario Limitations -------------------- -**ODL SFC:** In the Euphrates1.0, Compass doesn't integrate OpenStack Tacker -Project yet. However, the SFC related test cases in Functest always use Tacker -as NFVO to delivery VNFFG or SFC related requests to ODL via networking-sfc. -So the odl-sfc scenario of Compass cannot pass the SFC testcases in Functest. -But if you want to use verify SFC in the cluster deployed by Compass, you can -use neutron CLI to achieve the same effect. Known issues ------------ -+-----------------------+---------------------------------+-----------------------+ -| **Scenario** | **Issue** | **Workarounds** | -+-----------------------+---------------------------------+-----------------------+ -| Ceph Related Scenario | After a power failure or reboot,| Deploy without Ceph | -| | the cluster cannot heal itself | | -+-----------------------+---------------------------------+-----------------------+ Test Result =========== -The Euphrates release with the Compass4nfv deployment toolchain has undergone QA test +The Fraser release with the Compass4nfv deployment toolchain has undergone QA test runs with the following results: -Functest: http://testresults.opnfv.org/reporting/euphrates/functest/status-compass.html +Functest: http://testresults.opnfv.org/reporting/fraser/functest/status-compass.html diff --git a/docs/release/scenarios/k8s-nosdn-nofeature-ha.rst b/docs/release/scenarios/k8s-nosdn-nofeature-ha.rst index d9925cb7..e52889fa 100644 --- a/docs/release/scenarios/k8s-nosdn-nofeature-ha.rst +++ b/docs/release/scenarios/k8s-nosdn-nofeature-ha.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Justin Chi (HUAWEI),Yifei Xue (HUAWEI)and Xinhui Hu (FIBERHOME) -This document introduces scenario descriptions for Euphrates 1.0 of +This document introduces scenario descriptions for Fraser 1.0 of deployment with no SDN controller and no feature enabled. .. contents:: @@ -35,5 +35,5 @@ Limitations, Issues and Workarounds References ========== -For more information on the OPNFV Euphrates release, please visit -http://www.opnfv.org/euphrates +For more information on the OPNFV Fraser release, please visit +http://www.opnfv.org/fraser diff --git a/docs/release/scenarios/os-nosdn-nofeature-ha.rst b/docs/release/scenarios/os-nosdn-nofeature-ha.rst index 6ff3b85c..5fc3e6d4 100644 --- a/docs/release/scenarios/os-nosdn-nofeature-ha.rst +++ b/docs/release/scenarios/os-nosdn-nofeature-ha.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Justin Chi (HUAWEI) and Yifei Xue (HUAWEI) -This document introduces scenario descriptions for Euphrates 1.0 of +This document introduces scenario descriptions for Fraser 1.0 of deployment with no SDN controller and no feature enabled. .. contents:: @@ -13,8 +13,8 @@ deployment with no SDN controller and no feature enabled. os-nosdn-nofeature-ha ===================== -This scenario is used to deploy an Ocata OpenStack deployment with -Ceph Jewel, and without SDN controller nor any NFV feature enabled. +This scenario is used to deploy a Pike OpenStack deployment with +Ceph Luminous, and without SDN controller nor any NFV feature enabled. Scenario components and composition =================================== @@ -37,5 +37,5 @@ Limitations, Issues and Workarounds References ========== -For more information on the OPNFV Euphrates release, please visit -http://www.opnfv.org/euphrates +For more information on the OPNFV Fraser release, please visit +http://www.opnfv.org/fraser diff --git a/docs/release/scenarios/os-odl-nofeature-ha.rst b/docs/release/scenarios/os-odl-nofeature-ha.rst index 64e74e04..df6cfa6a 100644 --- a/docs/release/scenarios/os-odl-nofeature-ha.rst +++ b/docs/release/scenarios/os-odl-nofeature-ha.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Justin Chi (HUAWEI) and Yifei Xue (HUAWEI) -This document introduces scenario descriptions for Euphrates 1.0 of +This document introduces scenario descriptions for Fraser 1.0 of deployment with the OpenDaylight controller and no feature enabled. .. contents:: @@ -13,8 +13,8 @@ deployment with the OpenDaylight controller and no feature enabled. os-odl-nofeature-ha =================== -This scenario is used to deploy an Ocata OpenStack deployment with -OpenDaylight Nitrogen, Ceph Jewel, and without any NFV feature enabled. +This scenario is used to deploy a Pike OpenStack deployment with +OpenDaylight Nitrogen SR1, Ceph Luminous, and without any NFV feature enabled. Scenario components and composition =================================== @@ -39,5 +39,5 @@ Limitations, Issues and Workarounds References ========== -For more information on the OPNFV Euphrates release, please visit -http://www.opnfv.org/euphrates +For more information on the OPNFV Fraser release, please visit +http://www.opnfv.org/fraser diff --git a/docs/release/scenarios/os-odl-sfc-ha.rst b/docs/release/scenarios/os-odl-sfc-ha.rst index 7dca2417..3be817a2 100644 --- a/docs/release/scenarios/os-odl-sfc-ha.rst +++ b/docs/release/scenarios/os-odl-sfc-ha.rst @@ -2,7 +2,7 @@ .. http://creativecommons.org/licenses/by/4.0 .. (c) Justin Chi (HUAWEI) and Yifei Xue (HUAWEI) -This document introduces scenario descriptions for Euphrates 1.0 of +This document introduces scenario descriptions for Fraser 1.0 of deployment with the OpenDaylight controller and SFC feature enabled. .. contents:: @@ -13,8 +13,8 @@ deployment with the OpenDaylight controller and SFC feature enabled. os-odl-sfc-ha ============= -This scenario is used to deploy an Ocata OpenStack deployment with -OpenDaylight Nitrogen, Ceph Jewel, and SFC feature enabled. +This scenario is used to deploy a Pike OpenStack deployment with +OpenDaylight Nitrogen SR1, Ceph Luminous, and SFC feature enabled. Scenario components and composition =================================== @@ -41,5 +41,5 @@ Limitations, Issues and Workarounds References ========== -For more information on the OPNFV Euphrates release, please visit -http://www.opnfv.org/euphrates +For more information on the OPNFV Fraser release, please visit +http://www.opnfv.org/fraser diff --git a/plugins/barometer/plugin.desc b/plugins/barometer/plugin.desc index 896d6f27..3d976c2e 100644 --- a/plugins/barometer/plugin.desc +++ b/plugins/barometer/plugin.desc @@ -15,6 +15,7 @@ plugin: maintainers: - john.hinman@intel.com + - ramamani.yeleswarapu@intel.com # host os type: ubuntu/centos os_version: ubuntu @@ -50,3 +51,12 @@ plugin: inventory: - compute + - role: influxdb + phrase: post_openstack + inventory: + - controller + + - role: grafana + phrase: post_openstack + inventory: + - controller diff --git a/plugins/barometer/roles/collectd/files/install_docker.sh b/plugins/barometer/roles/collectd/files/install_docker.sh new file mode 100644 index 00000000..f0c08bae --- /dev/null +++ b/plugins/barometer/roles/collectd/files/install_docker.sh @@ -0,0 +1,25 @@ +#!/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 +# ############################################################################# + +apt-get update +apt-get install -y apt-transport-https ca-certificates curl software-properties-common +sleep 3 + +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +apt-key fingerprint 0EBFCD88 + +add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + +apt-get update +sleep 3 + +apt-get install -y docker-ce +sleep 5 diff --git a/plugins/barometer/roles/collectd/tasks/collectd.yml b/plugins/barometer/roles/collectd/tasks/collectd.yml index 48e15989..0f6a6266 100644 --- a/plugins/barometer/roles/collectd/tasks/collectd.yml +++ b/plugins/barometer/roles/collectd/tasks/collectd.yml @@ -1,5 +1,5 @@ # ############################################################################# -# Copyright (c) 2017 Intel Corp. +# Copyright (c) 2017-18 Intel Corp. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 @@ -7,120 +7,173 @@ # http://www.apache.org/licenses/LICENSE-2.0 # ############################################################################# --- -- name: install dependencies - apt: - name: "{{ item }}" - state: present - with_items: - - libltdl7 - - init-system-helpers - - mcelog - - rrdtool - - libc6 - - librrd4 - - libvirt-bin - - libvirt-dev - - gcc - - git - - python3-pip - -- name: create workspace directory - file: - path: "{{ workspace }}" - state: directory - mode: 0755 - -- name: download, unarchive and install collectd packages +- name: copy install_docker script + remote_user: root + copy: + src: install_docker.sh + dest: /opt/install_docker.sh + mode: 0777 + +- name: install docker + command: su -s /bin/sh -c "/opt/install_docker.sh" + +- name: create collectd_sample_configs dir + remote_user: root shell: | - cd "{{ workspace }}"; - wget "{{ artifacts_collectd_pkg }}"; - su -s /bin/sh -c \ - "tar xzf collectd_pkg.tar.gz -C {{ workspace }} --strip-components 1"; - apt-get install ./libcollectd*.deb -y; - apt-get install ./collectd*.deb -y - -- name: make stack dir - file: - path: /opt/stack - state: directory - mode: 0755 - -- name: check plugin dir exists - stat: - path: /opt/stack/collectd-ceilometer-plugin - register: stat_result + rm -rf /root/collectd_sample_configs; + mkdir /root/collectd_sample_configs; -- name: fetch collectd plugin source code +- name: docker pull opnfv/barometer-collectd + remote_user: root shell: | - cd /opt/stack; - git clone https://github.com/openstack/collectd-ceilometer-plugin.git; - cd /opt/stack/collectd-ceilometer-plugin; - git checkout stable/pike - when: stat_result.stat.exists == False + docker pull opnfv/barometer-collectd; + sleep 5 - name: configure logfile conf + remote_user: root template: src: logfile.conf.j2 - dest: /etc/collectd/collectd.conf.d/logfile.conf + dest: /root/collectd_sample_configs/logfile.conf + +- name: configure csv conf + remote_user: root + template: + src: csv.conf.j2 + dest: /root/collectd_sample_configs/csv.conf + +- name: check if vswitchd on host + shell: ps -ef | grep vswitchd | grep -v grep > /dev/null + register: vswitchd_result + ignore_errors: "true" + +- name: check if db.sock exists + stat: + path: /var/run/openvswitch/db.sock + register: dbsock_result + ignore_errors: "true" + +- name: configure ovs_stats conf and ovs_events conf + remote_user: root + template: + src: "{{ item }}.conf.j2" + dest: "/root/collectd_sample_configs/{{ item }}.conf" + when: vswitchd_result|succeeded and dbsock_result|succeeded + with_items: + - ovs_stats + - ovs_events + +- name: check if mcelog running on host + shell: ps -ef | grep mcelog | grep -v grep > /dev/null + register: mcelog_running + ignore_errors: "true" + +- name: check if mcelog exists + shell: which mcelog > /dev/null + register: mcelog_exists + ignore_errors: "true" + +- name: check if mcelog-client exists + stat: + path: /var/run/mcelog-client + register: mcelog_client_exists + ignore_errors: "true" + +- name: configure mcelog conf + remote_user: root + template: + src: mcelog.conf.j2 + dest: /root/collectd_sample_configs/mcelog.conf + when: mcelog_running|succeeded and mcelog_exists|succeeded and mcelog_client_exists|succeeded - name: configure collectd-aodh plugin conf + remote_user: root template: src: collectd-aodh.conf.j2 - dest: /etc/collectd/collectd.conf.d/collectd-aodh-plugin.conf + dest: /root/collectd_sample_configs/collectd-aodh-plugin.conf - name: configure collectd-gnocchi plugin conf + remote_user: root template: src: collectd-gnocchi.conf.j2 - dest: /etc/collectd/collectd.conf.d/collectd-gnocchi-plugin.conf + dest: /root/collectd_sample_configs/collectd-gnocchi-plugin.conf + +- name: check if hugepages folders exist on host + stat: + path: "{{ item }}" + register: hugepages_result + ignore_errors: "true" + with_items: + /sys/devices/system/node + /sys/kernel/mm/hugepages - name: configure hugepages conf + remote_user: root template: src: hugepages.conf.j2 - dest: /etc/collectd/collectd.conf.d/hugepages.conf + dest: /root/collectd_sample_configs/hugepages.conf + when: hugepages_result|succeeded -- name: configure mcelog conf +- name: check if rdt on host + shell: | + grep -q cqm* "/proc/cpuinfo" + register: rdt_result + ignore_errors: "true" + +- name: configure rdt conf + remote_user: root template: - src: mcelog.conf.j2 - dest: /etc/collectd/collectd.conf.d/mcelog.conf + src: rdt.conf.j2 + dest: /root/collectd_sample_configs/rdt.conf + when: rdt_result|succeeded + +- name: load msr kernel module + modprobe: + name: msr + state: present + +- name: check if libvirtd on host + shell: ps -ef | grep libvirtd | grep -v grep > /dev/null + register: libvirt_result + ignore_errors: "true" -- name: configure ovs_stats conf +- name: configure virt conf + remote_user: root template: - src: ovs_stats.conf.j2 - dest: /etc/collectd/collectd.conf.d/ovs_stats.conf + src: virt.conf.j2 + dest: /root/collectd_sample_configs/virt.conf + when: libvirt_result|succeeded -- name: configure ovs_events conf +- name: configure virt conf extra stats when rdt is present + remote_user: root + shell: | + sed -i '/ExtraStats/s/^#//g' /root/collectd_sample_configs/virt.conf + when: rdt_result|failed and libvirt_result|succeeded + +- name: configure rrdtool conf template: - src: ovs_events.conf.j2 - dest: /etc/collectd/collectd.conf.d/ovs_events.conf - -- name: configure collectd conf - lineinfile: - dest: /etc/collectd/collectd.conf - regexp: '{{ item.regexp }}' - line: '{{ item.line }}' - with_items: - - regexp: '#LoadPlugin numa' - line: 'LoadPlugin numa' - - regexp: '#LoadPlugin virt' - line: 'LoadPlugin virt' - - regexp: '#LoadPlugin cpufreq' - line: 'LoadPlugin cpufreq' - - regexp: '#LoadPlugin cpusleep' - line: 'LoadPlugin cpusleep' + src: rrdtool.conf.j2 + dest: /root/collectd_sample_configs/rrdtool.conf -- name: configure mcelog conf - lineinfile: - dest: /etc/mcelog/mcelog.conf - regexp: '{{ item.regexp }}' - line: '{{ item.line }}' - with_items: - - regexp: '#socket-path = /var/run/mcelog-client' - line: 'socket-path = /var/run/mcelog-client' +- name: configure intel_pmu conf + remote_user: root + template: + src: intel_pmu.conf.j2 + dest: /root/collectd_sample_configs/intel_pmu.conf + +- name: configure network conf + remote_user: root + template: + src: network.conf.j2 + dest: /root/collectd_sample_configs/network.conf + +- name: configure default plugins + remote_user: root + template: + src: default_plugins.conf.j2 + dest: /root/collectd_sample_configs/default_plugins.conf -- name: install gnocchiclient, aodhclient, set ovs manager, restart mcelog, collectd +- name: run barometer collectd container + remote_user: root shell: | - pip install gnocchiclient; - pip install aodhclient; - ovs-vsctl set-manager ptcp:6640:127.0.0.1; - systemctl restart mcelog; - systemctl restart collectd + docker run -dti --net=host -v /root/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \ + -v /var/run:/var/run -v /tmp:/tmp --privileged opnfv/barometer-collectd /run_collectd.sh diff --git a/plugins/barometer/roles/collectd/tasks/main.yml b/plugins/barometer/roles/collectd/tasks/main.yml index d33823ed..88602ea2 100644 --- a/plugins/barometer/roles/collectd/tasks/main.yml +++ b/plugins/barometer/roles/collectd/tasks/main.yml @@ -1,5 +1,5 @@ # ############################################################################# -# Copyright (c) 2017 Intel Corp. +# Copyright (c) 2017-18 Intel Corp. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 diff --git a/plugins/barometer/roles/collectd/templates/collectd-aodh.conf.j2 b/plugins/barometer/roles/collectd/templates/collectd-aodh.conf.j2 index 301ba25a..b7fcfb60 100644 --- a/plugins/barometer/roles/collectd/templates/collectd-aodh.conf.j2 +++ b/plugins/barometer/roles/collectd/templates/collectd-aodh.conf.j2 @@ -3,7 +3,7 @@ </LoadPlugin> <Plugin python> - ModulePath "/opt/stack/collectd-ceilometer-plugin" + ModulePath "/src/barometer/src/collectd-openstack-plugins/collectd-openstack-plugins" LogTraces true Interactive false Import "collectd_ceilometer.aodh.plugin" diff --git a/plugins/barometer/roles/collectd/templates/collectd-gnocchi.conf.j2 b/plugins/barometer/roles/collectd/templates/collectd-gnocchi.conf.j2 index b54e9d5a..22dd7966 100644 --- a/plugins/barometer/roles/collectd/templates/collectd-gnocchi.conf.j2 +++ b/plugins/barometer/roles/collectd/templates/collectd-gnocchi.conf.j2 @@ -3,7 +3,7 @@ </LoadPlugin> <Plugin python> - ModulePath "/opt/stack/collectd-ceilometer-plugin" + ModulePath "/src/barometer/src/collectd-openstack-plugins/collectd-openstack-plugins" LogTraces true Interactive false Import "collectd_ceilometer.gnocchi.plugin" @@ -16,6 +16,8 @@ # Batch size BATCH_SIZE "1" + DEFAULT_ARCHIVE_POLICY "high" + # Service endpoint addresses OS_AUTH_URL "http://{{ internal_vip.ip }}:35357/v3/" diff --git a/plugins/barometer/roles/collectd/templates/csv.conf.j2 b/plugins/barometer/roles/collectd/templates/csv.conf.j2 new file mode 100644 index 00000000..06abf4ba --- /dev/null +++ b/plugins/barometer/roles/collectd/templates/csv.conf.j2 @@ -0,0 +1,20 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin csv + +<Plugin csv> + DataDir "/tmp/collectd/csv" + StoreRates false +</Plugin> + diff --git a/plugins/barometer/roles/collectd/templates/default_plugins.conf.j2 b/plugins/barometer/roles/collectd/templates/default_plugins.conf.j2 new file mode 100644 index 00000000..a4d632a6 --- /dev/null +++ b/plugins/barometer/roles/collectd/templates/default_plugins.conf.j2 @@ -0,0 +1,31 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +Hostname "{{ inventory_hostname }}" + +LoadPlugin cpufreq +LoadPlugin disk +LoadPlugin ethstat +LoadPlugin ipc +LoadPlugin ipmi +LoadPlugin load +LoadPlugin memory +LoadPlugin numa +LoadPlugin processes +LoadPlugin df +LoadPlugin turbostat +LoadPlugin uptime +LoadPlugin contextswitch +LoadPlugin irq +LoadPlugin swap + diff --git a/plugins/barometer/roles/collectd/templates/hugepages.conf.j2 b/plugins/barometer/roles/collectd/templates/hugepages.conf.j2 index cefcc25d..9378c1f2 100644 --- a/plugins/barometer/roles/collectd/templates/hugepages.conf.j2 +++ b/plugins/barometer/roles/collectd/templates/hugepages.conf.j2 @@ -1,3 +1,16 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. LoadPlugin hugepages <Plugin hugepages> diff --git a/plugins/barometer/roles/collectd/templates/intel_pmu.conf.j2 b/plugins/barometer/roles/collectd/templates/intel_pmu.conf.j2 new file mode 100644 index 00000000..caba8825 --- /dev/null +++ b/plugins/barometer/roles/collectd/templates/intel_pmu.conf.j2 @@ -0,0 +1,23 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin intel_pmu + +<Plugin intel_pmu> + ReportHardwareCacheEvents true + ReportKernelPMUEvents true + ReportSoftwareEvents true +# EventList "/var/cache/pmu/GenuineIntel-6-2D-core.json" +# HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD" +</Plugin> + diff --git a/plugins/barometer/roles/collectd/templates/logfile.conf.j2 b/plugins/barometer/roles/collectd/templates/logfile.conf.j2 index 77d86a99..bf53ae8f 100644 --- a/plugins/barometer/roles/collectd/templates/logfile.conf.j2 +++ b/plugins/barometer/roles/collectd/templates/logfile.conf.j2 @@ -1,3 +1,16 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. LoadPlugin "logfile" <Plugin "logfile"> diff --git a/plugins/barometer/roles/collectd/templates/mcelog.conf.j2 b/plugins/barometer/roles/collectd/templates/mcelog.conf.j2 index 3a043ec8..f9ae8aa0 100644 --- a/plugins/barometer/roles/collectd/templates/mcelog.conf.j2 +++ b/plugins/barometer/roles/collectd/templates/mcelog.conf.j2 @@ -1,9 +1,25 @@ -LoadPlugin mcelog +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +<LoadPlugin mcelog> + Interval 1 +</LoadPlugin> <Plugin mcelog> <Memory> - McelogClientSocket "/var/run/mcelog-client" - PersistentNotification false + McelogClientSocket "/var/run/mcelog-client" + PersistentNotification false </Memory> +## McelogLogfile "/var/log/mcelog" </Plugin> diff --git a/plugins/barometer/roles/collectd/templates/network.conf.j2 b/plugins/barometer/roles/collectd/templates/network.conf.j2 new file mode 100644 index 00000000..e9343e66 --- /dev/null +++ b/plugins/barometer/roles/collectd/templates/network.conf.j2 @@ -0,0 +1,19 @@ +# Copyright 2017-18 OPNFV, Intel Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin network + +<Plugin network> + Server "{{ internal_vip.ip }}" "25826" +</Plugin> + diff --git a/plugins/barometer/roles/collectd/templates/ovs_events.conf.j2 b/plugins/barometer/roles/collectd/templates/ovs_events.conf.j2 index d72e2004..2d71fa18 100644 --- a/plugins/barometer/roles/collectd/templates/ovs_events.conf.j2 +++ b/plugins/barometer/roles/collectd/templates/ovs_events.conf.j2 @@ -1,8 +1,23 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. <LoadPlugin ovs_events> Interval 1 </LoadPlugin> + <Plugin "ovs_events"> Port 6640 + Address "127.0.0.1" Socket "/var/run/openvswitch/db.sock" Interfaces "br0" "veth0" SendNotification false diff --git a/plugins/barometer/roles/collectd/templates/ovs_stats.conf.j2 b/plugins/barometer/roles/collectd/templates/ovs_stats.conf.j2 index 945c4e92..b7e4d5c8 100644 --- a/plugins/barometer/roles/collectd/templates/ovs_stats.conf.j2 +++ b/plugins/barometer/roles/collectd/templates/ovs_stats.conf.j2 @@ -1,6 +1,20 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License <LoadPlugin ovs_stats> Interval 1 </LoadPlugin> + <Plugin ovs_stats> Port "6640" Address "127.0.0.1" diff --git a/plugins/barometer/roles/collectd/templates/rdt.conf.j2 b/plugins/barometer/roles/collectd/templates/rdt.conf.j2 new file mode 100644 index 00000000..96d5eb34 --- /dev/null +++ b/plugins/barometer/roles/collectd/templates/rdt.conf.j2 @@ -0,0 +1,21 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +<LoadPlugin intel_rdt> + Interval 1 +</LoadPlugin> + +<Plugin "intel_rdt"> + Cores "" +</Plugin> + diff --git a/plugins/barometer/roles/collectd/templates/rrdtool.conf.j2 b/plugins/barometer/roles/collectd/templates/rrdtool.conf.j2 new file mode 100644 index 00000000..50bd6603 --- /dev/null +++ b/plugins/barometer/roles/collectd/templates/rrdtool.conf.j2 @@ -0,0 +1,21 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +Loadplugin rrdtool + +<Plugin rrdtool> + DataDir "/tmp/collectd/rrd" + CacheFlush 120 + WritesPerSecond 50 +</Plugin> + diff --git a/plugins/barometer/roles/collectd/templates/virt.conf.j2 b/plugins/barometer/roles/collectd/templates/virt.conf.j2 new file mode 100644 index 00000000..c6161237 --- /dev/null +++ b/plugins/barometer/roles/collectd/templates/virt.conf.j2 @@ -0,0 +1,32 @@ +# Copyright 2017-18 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LoadPlugin virt + +<Plugin virt> +# Connection "xen:///" + RefreshInterval 60 +# Domain "name" +# BlockDevice "name:device" +# BlockDeviceFormat target +# BlockDeviceFormatBasename false +# InterfaceDevice "name:device" +# IgnoreSelected false +# HostnameFormat name +# InterfaceFormat name +# PluginInstanceFormat name +# Instances 1 +# ExtraStats "cpu_util disk disk_err domain_state fs_info job_stats_background pcpu perf vcpupin" +</Plugin> + diff --git a/plugins/barometer/roles/collectd/vars/main.yml b/plugins/barometer/roles/collectd/vars/main.yml index 9fc0687d..b3a0b3b7 100644 --- a/plugins/barometer/roles/collectd/vars/main.yml +++ b/plugins/barometer/roles/collectd/vars/main.yml @@ -1,5 +1,5 @@ # ############################################################################# -# Copyright (c) 2017 Intel Corp. +# Copyright (c) 2017-18 Intel Corp. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 @@ -8,9 +8,3 @@ # ############################################################################# --- openstack_passwd_file: /etc/openstack_deploy/user_secrets.yml - -workspace: /tmp/plugin - -artifacts_collectd_pkg: http://artifacts.opnfv.org/compass4nfv/package/master/collectd_pkg.tar.gz - -collectd_ver: 5.8.0.23.g576797d-1~xenial_amd64.deb diff --git a/plugins/barometer/roles/grafana/files/configure_grafana.sh b/plugins/barometer/roles/grafana/files/configure_grafana.sh new file mode 100644 index 00000000..39fcc82b --- /dev/null +++ b/plugins/barometer/roles/grafana/files/configure_grafana.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Copyright 2017-2018 OPNFV, Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if [ -z "${influxdb_host}" ] +then + influxdb_host=localhost +fi + + +while [ -z "$RETURN" ] +do + sleep 1 + RETURN=$(curl -u admin:admin -X POST -H 'content-type: application/json'\ + http://127.0.0.1:3000/api/datasources -d \ + '{"name":"collectd","type":"influxdb","url":"http://'"${influxdb_host}"':8086","access":"proxy","isDefault":true,"database":"collectd","user":"admin","password":"admin","basicAuth":false}') +done + +FILES=/opt/barometer/docker/barometer-grafana/dashboards/*.json +for f in $FILES +do + curl -u admin:admin -X POST -H 'content-type: application/json' \ + http://127.0.0.1:3000/api/dashboards/db -d @$f ; +done diff --git a/plugins/barometer/roles/grafana/files/install_grafana.sh b/plugins/barometer/roles/grafana/files/install_grafana.sh new file mode 100644 index 00000000..43d9a588 --- /dev/null +++ b/plugins/barometer/roles/grafana/files/install_grafana.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2017-2018 OPNFV, Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "deb https://packagecloud.io/grafana/stable/debian/ stretch main" | tee /etc/apt/sources.list.d/grafana.list + +curl https://packagecloud.io/gpg.key | apt-key add - + +apt-get update + +apt-get install -y grafana + +sleep 5 + +service grafana-server start diff --git a/plugins/barometer/roles/grafana/tasks/grafana.yml b/plugins/barometer/roles/grafana/tasks/grafana.yml new file mode 100644 index 00000000..9c01920f --- /dev/null +++ b/plugins/barometer/roles/grafana/tasks/grafana.yml @@ -0,0 +1,34 @@ +# ############################################################################# +# 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: copy install_grafana script + remote_user: root + copy: + src: install_grafana.sh + dest: /opt/install_grafana.sh + mode: 0777 + +- name: install grafana + command: su -s /bin/sh -c "/opt/install_grafana.sh" + +- name: fetch barometer source code + remote_user: root + shell: | + cd /opt && rm -rf barometer; + git clone https://github.com/opnfv/barometer.git; + +- name: copy configure_grafana script + remote_user: root + copy: + src: configure_grafana.sh + dest: /opt/configure_grafana.sh + mode: 0777 + +- name: configure grafana + command: su -s /bin/sh -c "/opt/configure_grafana.sh" diff --git a/plugins/barometer/roles/grafana/tasks/main.yml b/plugins/barometer/roles/grafana/tasks/main.yml new file mode 100644 index 00000000..50d15b49 --- /dev/null +++ b/plugins/barometer/roles/grafana/tasks/main.yml @@ -0,0 +1,11 @@ +# ############################################################################# +# 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: grafana.yml + when: barometer is defined and barometer == "Enable" diff --git a/plugins/barometer/roles/influxdb/files/install_influxdb.sh b/plugins/barometer/roles/influxdb/files/install_influxdb.sh new file mode 100644 index 00000000..7fd1e046 --- /dev/null +++ b/plugins/barometer/roles/influxdb/files/install_influxdb.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Copyright 2017-2018 OPNFV, Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +curl -sL https://repos.influxdata.com/influxdb.key | apt-key add - + +source /etc/lsb-release + +echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | tee /etc/apt/sources.list.d/influxdb.list + +apt-get update + +apt-get install -y influxdb + +sleep 5 + +# install types.db +mkdir /opt/collectd && mkdir /opt/collectd/share && mkdir /opt/collectd/share/collectd && cd /opt/collectd/share/collectd + +wget https://raw.githubusercontent.com/collectd/collectd/master/src/types.db && cd - diff --git a/plugins/barometer/roles/influxdb/tasks/influxdb.yml b/plugins/barometer/roles/influxdb/tasks/influxdb.yml new file mode 100644 index 00000000..8e1f4ca1 --- /dev/null +++ b/plugins/barometer/roles/influxdb/tasks/influxdb.yml @@ -0,0 +1,28 @@ +# ############################################################################# +# 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: copy install_influxdb script + remote_user: root + copy: + src: install_influxdb.sh + dest: /opt/install_influxdb.sh + mode: 0777 + +- name: install influxdb + command: su -s /bin/sh -c "/opt/install_influxdb.sh" + +- name: configure /etc/influxdb/influxdb.conf + remote_user: root + template: + src: influxdb.conf.j2 + dest: /etc/influxdb/influxdb.conf + +- name: start influxdb service + remote_user: root + shell: service influxdb start diff --git a/plugins/barometer/roles/influxdb/tasks/main.yml b/plugins/barometer/roles/influxdb/tasks/main.yml new file mode 100644 index 00000000..b6da783b --- /dev/null +++ b/plugins/barometer/roles/influxdb/tasks/main.yml @@ -0,0 +1,11 @@ +# ############################################################################# +# 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: influxdb.yml + when: barometer is defined and barometer == "Enable" diff --git a/plugins/barometer/roles/influxdb/templates/influxdb.conf.j2 b/plugins/barometer/roles/influxdb/templates/influxdb.conf.j2 new file mode 100644 index 00000000..d35e93a7 --- /dev/null +++ b/plugins/barometer/roles/influxdb/templates/influxdb.conf.j2 @@ -0,0 +1,478 @@ +### Welcome to the InfluxDB configuration file. + +# The values in this file override the default values used by the system if +# a config option is not specified. The commented out lines are the configuration +# field and the default value used. Uncommenting a line and changing the value +# will change the value used at runtime when the process is restarted. + +# Once every 24 hours InfluxDB will report usage data to usage.influxdata.com +# The data includes a random ID, os, arch, version, the number of series and other +# usage data. No data from user databases is ever transmitted. +# Change this option to true to disable reporting. +# reporting-disabled = false + +# Bind address to use for the RPC service for backup and restore. +# bind-address = "127.0.0.1:8088" + +### +### [meta] +### +### Controls the parameters for the Raft consensus group that stores metadata +### about the InfluxDB cluster. +### + +[meta] + # Where the metadata/raft database is stored + dir = "/var/lib/influxdb/meta" + + # Automatically create a default retention policy when creating a database. + # retention-autocreate = true + + # If log messages are printed for the meta service + # logging-enabled = true + +### +### [data] +### +### Controls where the actual shard data for InfluxDB lives and how it is +### flushed from the WAL. "dir" may need to be changed to a suitable place +### for your system, but the WAL settings are an advanced configuration. The +### defaults should work for most systems. +### + +[data] + # The directory where the TSM storage engine stores TSM files. + dir = "/var/lib/influxdb/data" + + # The directory where the TSM storage engine stores WAL files. + wal-dir = "/var/lib/influxdb/wal" + + # The amount of time that a write will wait before fsyncing. A duration + # greater than 0 can be used to batch up multiple fsync calls. This is useful for slower + # disks or when WAL write contention is seen. A value of 0s fsyncs every write to the WAL. + # Values in the range of 0-100ms are recommended for non-SSD disks. + # wal-fsync-delay = "0s" + + + # The type of shard index to use for new shards. The default is an in-memory index that is + # recreated at startup. A value of "tsi1" will use a disk based index that supports higher + # cardinality datasets. + # index-version = "inmem" + + # Trace logging provides more verbose output around the tsm engine. Turning + # this on can provide more useful output for debugging tsm engine issues. + # trace-logging-enabled = false + + # Whether queries should be logged before execution. Very useful for troubleshooting, but will + # log any sensitive data contained within a query. + # query-log-enabled = true + + # Settings for the TSM engine + + # CacheMaxMemorySize is the maximum size a shard's cache can + # reach before it starts rejecting writes. + # Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k). + # Vaues without a size suffix are in bytes. + # cache-max-memory-size = "1g" + + # CacheSnapshotMemorySize is the size at which the engine will + # snapshot the cache and write it to a TSM file, freeing up memory + # Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k). + # Values without a size suffix are in bytes. + # cache-snapshot-memory-size = "25m" + + # CacheSnapshotWriteColdDuration is the length of time at + # which the engine will snapshot the cache and write it to + # a new TSM file if the shard hasn't received writes or deletes + # cache-snapshot-write-cold-duration = "10m" + + # CompactFullWriteColdDuration is the duration at which the engine + # will compact all TSM files in a shard if it hasn't received a + # write or delete + # compact-full-write-cold-duration = "4h" + + # The maximum number of concurrent full and level compactions that can run at one time. A + # value of 0 results in 50% of runtime.GOMAXPROCS(0) used at runtime. Any number greater + # than 0 limits compactions to that value. This setting does not apply + # to cache snapshotting. + # max-concurrent-compactions = 0 + + # The maximum series allowed per database before writes are dropped. This limit can prevent + # high cardinality issues at the database level. This limit can be disabled by setting it to + # 0. + # max-series-per-database = 1000000 + + # The maximum number of tag values per tag that are allowed before writes are dropped. This limit + # can prevent high cardinality tag values from being written to a measurement. This limit can be + # disabled by setting it to 0. + # max-values-per-tag = 100000 + +### +### [coordinator] +### +### Controls the clustering service configuration. +### + +[coordinator] + # The default time a write request will wait until a "timeout" error is returned to the caller. + # write-timeout = "10s" + + # The maximum number of concurrent queries allowed to be executing at one time. If a query is + # executed and exceeds this limit, an error is returned to the caller. This limit can be disabled + # by setting it to 0. + # max-concurrent-queries = 0 + + # The maximum time a query will is allowed to execute before being killed by the system. This limit + # can help prevent run away queries. Setting the value to 0 disables the limit. + # query-timeout = "0s" + + # The time threshold when a query will be logged as a slow query. This limit can be set to help + # discover slow or resource intensive queries. Setting the value to 0 disables the slow query logging. + # log-queries-after = "0s" + + # The maximum number of points a SELECT can process. A value of 0 will make + # the maximum point count unlimited. This will only be checked every second so queries will not + # be aborted immediately when hitting the limit. + # max-select-point = 0 + + # The maximum number of series a SELECT can run. A value of 0 will make the maximum series + # count unlimited. + # max-select-series = 0 + + # The maxium number of group by time bucket a SELECT can create. A value of zero will max the maximum + # number of buckets unlimited. + # max-select-buckets = 0 + +### +### [retention] +### +### Controls the enforcement of retention policies for evicting old data. +### + +[retention] + # Determines whether retention policy enforcement enabled. + # enabled = true + + # The interval of time when retention policy enforcement checks run. + # check-interval = "30m" + +### +### [shard-precreation] +### +### Controls the precreation of shards, so they are available before data arrives. +### Only shards that, after creation, will have both a start- and end-time in the +### future, will ever be created. Shards are never precreated that would be wholly +### or partially in the past. + +[shard-precreation] + # Determines whether shard pre-creation service is enabled. + # enabled = true + + # The interval of time when the check to pre-create new shards runs. + # check-interval = "10m" + + # The default period ahead of the endtime of a shard group that its successor + # group is created. + # advance-period = "30m" + +### +### Controls the system self-monitoring, statistics and diagnostics. +### +### The internal database for monitoring data is created automatically if +### if it does not already exist. The target retention within this database +### is called 'monitor' and is also created with a retention period of 7 days +### and a replication factor of 1, if it does not exist. In all cases the +### this retention policy is configured as the default for the database. + +[monitor] + # Whether to record statistics internally. + # store-enabled = true + + # The destination database for recorded statistics + # store-database = "_internal" + + # The interval at which to record statistics + # store-interval = "10s" + +### +### [http] +### +### Controls how the HTTP endpoints are configured. These are the primary +### mechanism for getting data into and out of InfluxDB. +### + +[http] + # Determines whether HTTP endpoint is enabled. + # enabled = true + + # The bind address used by the HTTP service. + # bind-address = ":8086" + + # Determines whether user authentication is enabled over HTTP/HTTPS. + # auth-enabled = false + + # The default realm sent back when issuing a basic auth challenge. + # realm = "InfluxDB" + + # Determines whether HTTP request logging is enabled. + # log-enabled = true + + # Determines whether detailed write logging is enabled. + # write-tracing = false + + # Determines whether the pprof endpoint is enabled. This endpoint is used for + # troubleshooting and monitoring. + # pprof-enabled = true + + # Determines whether HTTPS is enabled. + # https-enabled = false + + # The SSL certificate to use when HTTPS is enabled. + # https-certificate = "/etc/ssl/influxdb.pem" + + # Use a separate private key location. + # https-private-key = "" + + # The JWT auth shared secret to validate requests using JSON web tokens. + # shared-secret = "" + + # The default chunk size for result sets that should be chunked. + # max-row-limit = 0 + + # The maximum number of HTTP connections that may be open at once. New connections that + # would exceed this limit are dropped. Setting this value to 0 disables the limit. + # max-connection-limit = 0 + + # Enable http service over unix domain socket + # unix-socket-enabled = false + + # The path of the unix domain socket. + # bind-socket = "/var/run/influxdb.sock" + + # The maximum size of a client request body, in bytes. Setting this value to 0 disables the limit. + # max-body-size = 25000000 + + +### +### [ifql] +### +### Configures the ifql RPC API. +### + +[ifql] + # Determines whether the RPC service is enabled. + # enabled = true + + # Determines whether additional logging is enabled. + # log-enabled = true + + # The bind address used by the ifql RPC service. + # bind-address = ":8082" + + +### +### [subscriber] +### +### Controls the subscriptions, which can be used to fork a copy of all data +### received by the InfluxDB host. +### + +[subscriber] + # Determines whether the subscriber service is enabled. + # enabled = true + + # The default timeout for HTTP writes to subscribers. + # http-timeout = "30s" + + # Allows insecure HTTPS connections to subscribers. This is useful when testing with self- + # signed certificates. + # insecure-skip-verify = false + + # The path to the PEM encoded CA certs file. If the empty string, the default system certs will be used + # ca-certs = "" + + # The number of writer goroutines processing the write channel. + # write-concurrency = 40 + + # The number of in-flight writes buffered in the write channel. + # write-buffer-size = 1000 + + +### +### [[graphite]] +### +### Controls one or many listeners for Graphite data. +### + +[[graphite]] + # Determines whether the graphite endpoint is enabled. + # enabled = false + # database = "graphite" + # retention-policy = "" + # bind-address = ":2003" + # protocol = "tcp" + # consistency-level = "one" + + # These next lines control how batching works. You should have this enabled + # otherwise you could get dropped metrics or poor performance. Batching + # will buffer points in memory if you have many coming in. + + # Flush if this many points get buffered + # batch-size = 5000 + + # number of batches that may be pending in memory + # batch-pending = 10 + + # Flush at least this often even if we haven't hit buffer limit + # batch-timeout = "1s" + + # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. + # udp-read-buffer = 0 + + ### This string joins multiple matching 'measurement' values providing more control over the final measurement name. + # separator = "." + + ### Default tags that will be added to all metrics. These can be overridden at the template level + ### or by tags extracted from metric + # tags = ["region=us-east", "zone=1c"] + + ### Each template line requires a template pattern. It can have an optional + ### filter before the template and separated by spaces. It can also have optional extra + ### tags following the template. Multiple tags should be separated by commas and no spaces + ### similar to the line protocol format. There can be only one default template. + # templates = [ + # "*.app env.service.resource.measurement", + # # Default template + # "server.*", + # ] + +### +### [collectd] +### +### Controls one or many listeners for collectd data. +### + +[[collectd]] + enabled = true + bind-address = ":25826" # the bind address + database = "collectd" # Name of the database that will be written to + retention-policy = "" + batch-size = 5000 # will flush if this many points get buffered + batch-pending = 10 # number of batches that may be pending in memory + batch-timeout = "10s" + read-buffer = 0 # UDP read buffer size, 0 means to use OS default + typesdb = "/opt/collectd/share/collectd/types.db" + security-level = "none" # "none", "sign", or "encrypt" + + # enabled = false + # bind-address = ":25826" + # database = "collectd" + # retention-policy = "" + # + # The collectd service supports either scanning a directory for multiple types + # db files, or specifying a single db file. + # typesdb = "/usr/local/share/collectd" + # + # security-level = "none" + # auth-file = "/etc/collectd/auth_file" + + # These next lines control how batching works. You should have this enabled + # otherwise you could get dropped metrics or poor performance. Batching + # will buffer points in memory if you have many coming in. + + # Flush if this many points get buffered + # batch-size = 5000 + + # Number of batches that may be pending in memory + # batch-pending = 10 + + # Flush at least this often even if we haven't hit buffer limit + # batch-timeout = "10s" + + # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. + # read-buffer = 0 + + # Multi-value plugins can be handled two ways. + # "split" will parse and store the multi-value plugin data into separate measurements + # "join" will parse and store the multi-value plugin as a single multi-value measurement. + # "split" is the default behavior for backward compatability with previous versions of influxdb. + # parse-multivalue-plugin = "split" +### +### [opentsdb] +### +### Controls one or many listeners for OpenTSDB data. +### + +[[opentsdb]] + # enabled = false + # bind-address = ":4242" + # database = "opentsdb" + # retention-policy = "" + # consistency-level = "one" + # tls-enabled = false + # certificate= "/etc/ssl/influxdb.pem" + + # Log an error for every malformed point. + # log-point-errors = true + + # These next lines control how batching works. You should have this enabled + # otherwise you could get dropped metrics or poor performance. Only points + # metrics received over the telnet protocol undergo batching. + + # Flush if this many points get buffered + # batch-size = 1000 + + # Number of batches that may be pending in memory + # batch-pending = 5 + + # Flush at least this often even if we haven't hit buffer limit + # batch-timeout = "1s" + +### +### [[udp]] +### +### Controls the listeners for InfluxDB line protocol data via UDP. +### + +[[udp]] + # enabled = false + # bind-address = ":8089" + # database = "udp" + # retention-policy = "" + + # These next lines control how batching works. You should have this enabled + # otherwise you could get dropped metrics or poor performance. Batching + # will buffer points in memory if you have many coming in. + + # Flush if this many points get buffered + # batch-size = 5000 + + # Number of batches that may be pending in memory + # batch-pending = 10 + + # Will flush at least this often even if we haven't hit buffer limit + # batch-timeout = "1s" + + # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. + # read-buffer = 0 + +### +### [continuous_queries] +### +### Controls how continuous queries are run within InfluxDB. +### + +[continuous_queries] + # Determines whether the continuous query service is enabled. + # enabled = true + + # Controls whether queries are logged when executed by the CQ service. + # log-enabled = true + + # Controls whether queries are logged to the self-monitoring data store. + # query-stats-enabled = false + + # interval for how often continuous queries will be checked if they need to run + # run-interval = "1s" + + 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/files/opendaylight.service b/plugins/odl_cluster/roles/setup-odl/files/opendaylight.service index a6966d82..fe125ccf 100755 --- a/plugins/odl_cluster/roles/setup-odl/files/opendaylight.service +++ b/plugins/odl_cluster/roles/setup-odl/files/opendaylight.service @@ -10,7 +10,7 @@ Type=simple WorkingDirectory=/opt/opendaylight PermissionsStartOnly=true ExecStartPre= -ExecStart=/usr/lib/jvm/java-8-oracle/bin/java -Djava.security.properties=/opt/opendaylight/etc/odl.java.security -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+HeapDumpOnOutOfMemoryError -Dcom.sun.management.jmxremote -Djava.security.egd=file:/dev/./urandom -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/lib/endorsed:/opt/opendaylight/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/lib/jvm/java-8-oracle/lib/ext:/opt/opendaylight/lib/ext -Dkaraf.instances=/opt/opendaylight/instances -Dkaraf.home=/opt/opendaylight -Dkaraf.base=/opt/opendaylight -Dkaraf.data=/opt/opendaylight/data -Dkaraf.etc=/opt/opendaylight/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/opt/opendaylight/data/tmp -Djava.util.logging.config.file=/opt/opendaylight/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /opt/opendaylight/lib/boot/org.apache.karaf.diagnostic.boot-4.0.9.jar:/opt/opendaylight/lib/boot/org.apache.karaf.jaas.boot-4.0.9.jar:/opt/opendaylight/lib/boot/org.apache.karaf.main-4.0.9.jar:/opt/opendaylight/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main +ExecStart=/usr/lib/jvm/java-8-oracle/bin/java -Djava.security.properties=/opt/opendaylight/etc/odl.java.security -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+HeapDumpOnOutOfMemoryError -Dcom.sun.management.jmxremote -Djava.security.egd=file:/dev/./urandom -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/lib/endorsed:/opt/opendaylight/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/lib/jvm/java-8-oracle/lib/ext:/opt/opendaylight/lib/ext -Dkaraf.instances=/opt/opendaylight/instances -Dkaraf.home=/opt/opendaylight -Dkaraf.base=/opt/opendaylight -Dkaraf.data=/opt/opendaylight/data -Dkaraf.etc=/opt/opendaylight/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/opt/opendaylight/data/tmp -Djava.util.logging.config.file=/opt/opendaylight/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /opt/opendaylight/lib/boot/org.apache.karaf.diagnostic.boot-4.0.10.jar:/opt/opendaylight/lib/boot/org.apache.karaf.jaas.boot-4.0.10.jar:/opt/opendaylight/lib/boot/org.apache.karaf.main-4.0.10.jar:/opt/opendaylight/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main Restart=on-failure LimitNOFILE=65535 TimeoutStopSec=15 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/control-servers-2.yml b/plugins/odl_cluster/roles/setup-odl/tasks/control-servers-2.yml index 39d0312f..5faa4a22 100755 --- a/plugins/odl_cluster/roles/setup-odl/tasks/control-servers-2.yml +++ b/plugins/odl_cluster/roles/setup-odl/tasks/control-servers-2.yml @@ -3,7 +3,7 @@ - name: configure odl l3 driver shell: | crudini --set /etc/neutron/neutron.conf DEFAULT service_plugins \ - odl-router,metering; + odl-router_v2,metering,trunk; when: odl_l3_agent == "Enable" - name: configure opendaylight -> ml2 diff --git a/plugins/odl_cluster/roles/setup-odl/tasks/odl-pre.yml b/plugins/odl_cluster/roles/setup-odl/tasks/odl-pre.yml index 64631663..21f0e86b 100755 --- a/plugins/odl_cluster/roles/setup-odl/tasks/odl-pre.yml +++ b/plugins/odl_cluster/roles/setup-odl/tasks/odl-pre.yml @@ -35,9 +35,8 @@ {% set _ = compu_l2_list.append(l2_mapping) %} {% set _ = compu_l3_list.append(l3_mapping) %} {% endfor %} - {% set pub_l3_mapping = pub_l3_mapping[0].replace(pub_intf[0], compu_pub_intf) %} {% set _ = compu_l2_list.append(pub_l2_mapping[0]) %} - {% set _ = compu_l3_list.append(pub_l3_mapping) %} + {% set _ = compu_l3_list.append(pub_l3_mapping[0]) %} public_bridge: "{{ pub_bridge[0] }}" contr_public_intf: "{{ pub_intf[0] }}" contr_l2_mappings: "{{ ','.join(contr_l2_list) }}" diff --git a/plugins/odl_cluster/roles/setup-odl/templates/org.apache.karaf.features.cfg b/plugins/odl_cluster/roles/setup-odl/templates/org.apache.karaf.features.cfg index 86b2baec..fa0e87f7 100755 --- a/plugins/odl_cluster/roles/setup-odl/templates/org.apache.karaf.features.cfg +++ b/plugins/odl_cluster/roles/setup-odl/templates/org.apache.karaf.features.cfg @@ -37,9 +37,9 @@ # Comma separated list of features repositories to register by default # featuresRepositories = \ - mvn:org.opendaylight.integration/features-index/0.7.0/xml/features, \ - mvn:org.apache.karaf.features/framework/4.0.9/xml/features, \ - mvn:org.apache.karaf.features/standard/4.0.9/xml/features + mvn:org.opendaylight.integration/features-index/0.7.1/xml/features, \ + mvn:org.apache.karaf.features/framework/4.0.10/xml/features, \ + mvn:org.apache.karaf.features/standard/4.0.10/xml/features # # Comma separated list of features to install at startup diff --git a/plugins/odl_cluster/roles/setup-odl/vars/main.yml b/plugins/odl_cluster/roles/setup-odl/vars/main.yml index 45b6c5e1..c4723e9c 100755 --- a/plugins/odl_cluster/roles/setup-odl/vars/main.yml +++ b/plugins/odl_cluster/roles/setup-odl/vars/main.yml @@ -9,16 +9,18 @@ --- openstack_passwd_file: /etc/openstack_deploy/user_secrets.yml -os_ver: 16.0.5 -os_name: pike +# yamllint disable rule:line-length +os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" +# yamllint enable rule:line-length +os_name: queens odl_username: admin odl_password: admin odl_api_port: 8181 -odl_pkg_url: karaf-0.7.0.tar.gz -odl_pkg_name: karaf-0.7.0.tar.gz +odl_pkg_url: karaf-0.7.1.tar.gz +odl_pkg_name: karaf-0.7.1.tar.gz odl_home: "/opt/opendaylight/" odl_base_features: - config @@ -48,7 +50,7 @@ odl_extra_features: odl_features: "{{ odl_base_features + odl_extra_features }}" -sdn_package: http://artifacts.opnfv.org/compass4nfv/packages/master/sdn_package.tar.gz +sdn_package: http://artifacts.opnfv.org/compass4nfv/package/master/sdn_package.tar.gz jdk8_pkg_name: jdk-8u51-linux-x64.tar.gz jdk8_script_name: install_jdk8.tar diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/files/odl_pkg.sh b/plugins/odl_sfc/roles/setup-odl-sfc/files/odl_pkg.sh index d93da3fd..69f5cd63 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/files/odl_pkg.sh +++ b/plugins/odl_sfc/roles/setup-odl-sfc/files/odl_pkg.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #!/bin/bash rm -rf /home/networking diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/files/opendaylight.service b/plugins/odl_sfc/roles/setup-odl-sfc/files/opendaylight.service index a6966d82..fe125ccf 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/files/opendaylight.service +++ b/plugins/odl_sfc/roles/setup-odl-sfc/files/opendaylight.service @@ -10,7 +10,7 @@ Type=simple WorkingDirectory=/opt/opendaylight PermissionsStartOnly=true ExecStartPre= -ExecStart=/usr/lib/jvm/java-8-oracle/bin/java -Djava.security.properties=/opt/opendaylight/etc/odl.java.security -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+HeapDumpOnOutOfMemoryError -Dcom.sun.management.jmxremote -Djava.security.egd=file:/dev/./urandom -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/lib/endorsed:/opt/opendaylight/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/lib/jvm/java-8-oracle/lib/ext:/opt/opendaylight/lib/ext -Dkaraf.instances=/opt/opendaylight/instances -Dkaraf.home=/opt/opendaylight -Dkaraf.base=/opt/opendaylight -Dkaraf.data=/opt/opendaylight/data -Dkaraf.etc=/opt/opendaylight/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/opt/opendaylight/data/tmp -Djava.util.logging.config.file=/opt/opendaylight/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /opt/opendaylight/lib/boot/org.apache.karaf.diagnostic.boot-4.0.9.jar:/opt/opendaylight/lib/boot/org.apache.karaf.jaas.boot-4.0.9.jar:/opt/opendaylight/lib/boot/org.apache.karaf.main-4.0.9.jar:/opt/opendaylight/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main +ExecStart=/usr/lib/jvm/java-8-oracle/bin/java -Djava.security.properties=/opt/opendaylight/etc/odl.java.security -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+HeapDumpOnOutOfMemoryError -Dcom.sun.management.jmxremote -Djava.security.egd=file:/dev/./urandom -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/lib/endorsed:/opt/opendaylight/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/lib/jvm/java-8-oracle/lib/ext:/opt/opendaylight/lib/ext -Dkaraf.instances=/opt/opendaylight/instances -Dkaraf.home=/opt/opendaylight -Dkaraf.base=/opt/opendaylight -Dkaraf.data=/opt/opendaylight/data -Dkaraf.etc=/opt/opendaylight/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/opt/opendaylight/data/tmp -Djava.util.logging.config.file=/opt/opendaylight/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /opt/opendaylight/lib/boot/org.apache.karaf.diagnostic.boot-4.0.10.jar:/opt/opendaylight/lib/boot/org.apache.karaf.jaas.boot-4.0.10.jar:/opt/opendaylight/lib/boot/org.apache.karaf.main-4.0.10.jar:/opt/opendaylight/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main Restart=on-failure LimitNOFILE=65535 TimeoutStopSec=15 diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf b/plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf index acf2e2f4..6621a212 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf +++ b/plugins/odl_sfc/roles/setup-odl-sfc/files/sfc.conf @@ -1,6 +1,6 @@ [DEFAULT] -service_plugins = odl-router,metering,networking_sfc.services.sfc.plugin.SfcPlugin,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin +service_plugins = odl-router_v2,metering,trunk,networking_sfc.services.sfc.plugin.SfcPlugin,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin [sfc] drivers = odl diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-1.yml index 684f314c..13b4c571 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-1.yml @@ -8,7 +8,7 @@ - name: install networking-odl pip: name: networking-odl - virtualenv: /openstack/venvs/neutron-15.1.4 + virtualenv: /openstack/venvs/neutron-{{ os_ver }} - name: configure vsctl for dhcp agent shell: | diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-2.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-2.yml index 82a26005..39b501db 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-2.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-agents-2.yml @@ -70,7 +70,7 @@ - name: Set host OVS configurations command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-odl-ovs-hostconfig \ + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-odl-ovs-hostconfig \ --datapath_type=system --bridge_mappings={{ contr_l2_mappings }} when: - inventory_hostname not in groups['nova_compute'] @@ -78,7 +78,7 @@ - name: Set host OVS configurations command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-odl-ovs-hostconfig \ + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-odl-ovs-hostconfig \ --datapath_type=system --bridge_mappings={{ contr_l3_mappings }} when: - inventory_hostname not in groups['nova_compute'] @@ -86,14 +86,14 @@ - name: Set host OVS configurations command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-odl-ovs-hostconfig --datapath_type=system + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-odl-ovs-hostconfig --datapath_type=system when: - inventory_hostname in groups['nova_compute'] - odl_l3_agent == "Disable" - name: Set host OVS configurations command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-odl-ovs-hostconfig + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-odl-ovs-hostconfig --datapath_type=system --bridge_mappings={{ compu_l3_mappings }} when: - inventory_hostname in groups['nova_compute'] diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-repos-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-repos-1.yml index 7b699a35..0eacde6e 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-repos-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-repos-1.yml @@ -1,7 +1,7 @@ --- - name: copy download script - copy: - src: odl_pkg.sh + template: + src: odl_pkg.sh.j2 dest: /opt/odl_pkg.sh mode: 0777 diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-1.yml index 40149346..0269bb37 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-1.yml @@ -8,12 +8,12 @@ - name: install networking-odl pip: name: networking-odl - virtualenv: /openstack/venvs/neutron-15.1.4 # Todo: hardcode, need to modify + virtualenv: /openstack/venvs/neutron-{{ os_ver }} - name: install networking-sfc pip: name: networking-sfc - virtualenv: /openstack/venvs/neutron-15.1.4 + virtualenv: /openstack/venvs/neutron-{{ os_ver }} when: odl_sfc == "Enable" - name: turn off neutron-server on control node diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-2.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-2.yml index d8bcf154..be45567a 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-2.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-2.yml @@ -3,7 +3,7 @@ - name: configure odl l3 driver shell: | crudini --set /etc/neutron/neutron.conf DEFAULT service_plugins \ - odl-router,metering; + odl-router_v2,metering,trunk; when: odl_l3_agent == "Enable" - name: configure opendaylight -> ml2 diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml index 0c11e36f..1eb68871 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml @@ -2,7 +2,7 @@ - name: Perform a Neutron DB online upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade --expand @@ -11,7 +11,7 @@ - name: Perform a Neutron DB offline upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade --contract @@ -20,9 +20,16 @@ - name: SFC DB upgrade command: | - /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage + /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage --subproject networking-sfc upgrade head become: "yes" become_user: "neutron" when: odl_sfc == "Enable" + +- name: fetch ml2_conf.ini to compass-tasks + fetch: + src: /etc/neutron/plugins/ml2/ml2_conf.ini + dest: /tmp/ + flat: "yes" + when: odl_sfc == "Enable" diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml index c43b6dcc..f63edeaa 100644 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml @@ -3,6 +3,11 @@ - name: upgrade networking-sfc pip: name: networking-sfc - extra_args: -U - virtualenv: /openstack/venvs/tacker-15.1.4 + virtualenv: /openstack/venvs/tacker-{{ os_ver }} when: odl_sfc == "Enable" + +- name: stop the other two tacker servers + service: + name: tacker-server + state: stopped + when: inventory_hostname != groups['tacker_all'][0] diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-post.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-post.yml index 9f1cb79e..55b0e160 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-post.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-post.yml @@ -32,3 +32,21 @@ - name: restart opendaylight shell: sleep 60; service opendaylight restart; sleep 60; when: inventory_hostname in groups['network_hosts'] + +- name: creat ml2 directory on ODL hosts + file: + path: /etc/neutron/plugins/ml2/ + state: directory + mode: 0755 + when: + - inventory_hostname in groups['network_hosts'] + - odl_sfc == "Enable" + +- name: copy ml2_conf.ini to ODL hosts + copy: + src: /tmp/ml2_conf.ini + dest: /etc/neutron/plugins/ml2/ml2_conf.ini + mode: 0755 + when: + - inventory_hostname in groups['network_hosts'] + - odl_sfc == "Enable" diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/templates/odl_pkg.sh.j2 b/plugins/odl_sfc/roles/setup-odl-sfc/templates/odl_pkg.sh.j2 new file mode 100755 index 00000000..f8882b23 --- /dev/null +++ b/plugins/odl_sfc/roles/setup-odl-sfc/templates/odl_pkg.sh.j2 @@ -0,0 +1,19 @@ +#!/bin/bash + +rm -rf /home/networking +rm -rf /home/tmp + +mkdir -p /home/networking +mkdir -p /home/tmp + +cd /home/networking + +git clone https://github.com/openstack/networking-odl.git -b stable/{{ os_name }} +git clone https://github.com/openstack/networking-sfc.git -b stable/{{ os_name }} + +pip wheel /home/networking/networking-odl/ -w /home/tmp/ +pip wheel /home/networking/networking-sfc/ -w /home/tmp/ + +cp /home/tmp/networking* /var/www/repo/os-releases/{{ os_ver }}/ubuntu-16.04-x86_64/ + +sleep 30 diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/templates/org.apache.karaf.features.cfg b/plugins/odl_sfc/roles/setup-odl-sfc/templates/org.apache.karaf.features.cfg index afb7e6b5..05f7a7cd 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/templates/org.apache.karaf.features.cfg +++ b/plugins/odl_sfc/roles/setup-odl-sfc/templates/org.apache.karaf.features.cfg @@ -37,9 +37,9 @@ # Comma separated list of features repositories to register by default # featuresRepositories = \ - mvn:org.opendaylight.integration/features-index/0.7.0/xml/features, \ - mvn:org.apache.karaf.features/framework/4.0.9/xml/features, \ - mvn:org.apache.karaf.features/standard/4.0.9/xml/features + mvn:org.opendaylight.integration/features-index/0.7.1/xml/features, \ + mvn:org.apache.karaf.features/framework/4.0.10/xml/features, \ + mvn:org.apache.karaf.features/standard/4.0.10/xml/features # # Comma separated list of features to install at startup diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml b/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml index b3d71edb..bc870277 100755 --- a/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml +++ b/plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml @@ -9,6 +9,11 @@ --- openstack_passwd_file: /etc/openstack_deploy/user_secrets.yml +# yamllint disable rule:line-length +os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/inventory/group_vars/all/all.yml key=openstack_release') }}" +# yamllint enable rule:line-length +os_name: queens + odl_username: admin odl_password: admin odl_api_port: 8181 @@ -18,8 +23,8 @@ sfc_plugins: src: sfc.conf dst: /opt/sfc.conf -odl_pkg_url: karaf-0.7.0.tar.gz -odl_pkg_name: karaf-0.7.0.tar.gz +odl_pkg_url: karaf-0.7.1.tar.gz +odl_pkg_name: karaf-0.7.1.tar.gz odl_home: "/opt/opendaylight/" odl_base_features: - config @@ -49,19 +54,9 @@ odl_extra_features: odl_features: "{{ odl_base_features + odl_extra_features }}" -sdn_package: http://artifacts.opnfv.org/compass4nfv/packages/master/sdn_package.tar.gz - -# yamllint disable rule:line-length -networking_odl_url: https://launchpad.net/networking-odl/4.0-ocata/4.0.0/+download/networking-odl-4.0.0.tar.gz -# yamllint enable rule:line-length +sdn_package: http://artifacts.opnfv.org/compass4nfv/package/master/sdn_package.tar.gz jdk8_pkg_name: jdk-8u51-linux-x64.tar.gz jdk8_script_name: install_jdk8.tar common_packages_noarch: [] - -odl_pip: networking-odl-3.2.0 - -networking_odl_version: 4.0.0 - -networking_odl_pkg_name: networking-odl-3.2.0.tar.gz diff --git a/plugins/odl_sfc/roles/sfc-pre-2/files/odl_sfc.patch b/plugins/odl_sfc/roles/sfc-pre-2/files/odl_sfc.patch new file mode 100644 index 00000000..9e25214a --- /dev/null +++ b/plugins/odl_sfc/roles/sfc-pre-2/files/odl_sfc.patch @@ -0,0 +1,90 @@ +diff --git a/defaults/main.yml b/defaults/main.yml +index fd6fc37..3ae4bce 100644 +--- a/defaults/main.yml ++++ b/defaults/main.yml +@@ -381,3 +381,9 @@ dragonflow_ex_peer_patch_port: patch-int + dragonflow_int_peer_patch_port: patch-ex + dragonflow_external_network_bridge: br-ex + dragonflow_publisher_bind_address: "*" ++ ++# Install Openvswitch without NSH support ++ovs_nsh_support: True ++# ++# # Set higher priority to mardim PPA when ovs_nsh_support is True ++ovs_nsh_apt_pinned_packages: [{ package: "*", release: "LP-PPA-mardim-mardim-ppa"}] +diff --git a/meta/main.yml b/meta/main.yml +index 418b4a9..7a6739a 100644 +--- a/meta/main.yml ++++ b/meta/main.yml +@@ -39,7 +39,10 @@ galaxy_info: + - openstack + dependencies: + - pip_install +- - apt_package_pinning ++ - role: apt_package_pinning ++ apt_pinned_packages: "{{ ovs_nsh_support | ternary(ovs_nsh_apt_pinned_packages, omit) }}" ++ when: ++ - ansible_pkg_mgr == 'apt' + - galera_client + - openstack_openrc + - role: etcd +diff --git a/tasks/neutron_pre_install.yml b/tasks/neutron_pre_install.yml +index 59fd87f..1162a2b 100644 +--- a/tasks/neutron_pre_install.yml ++++ b/tasks/neutron_pre_install.yml +@@ -79,3 +79,12 @@ + mode: "0440" + owner: "root" + group: "root" ++ ++- name: add ovs-nsh repo ++ apt_repository: ++ repo: "ppa:mardim/mardim-ppa" ++ update_cache: True ++ state: present ++ when: ++ - ansible_pkg_mgr == 'apt' ++ - ovs_nsh_support | bool +diff --git a/vars/main.yml b/vars/main.yml +index dec0e36..afdff3f 100644 +--- a/vars/main.yml ++++ b/vars/main.yml +@@ -27,8 +27,12 @@ neutron_package_list: |- + {% if (neutron_services['neutron-openvswitch-agent']['group'] in group_names and neutron_services['neutron-openvswitch-agent'].service_en | bool) + or (neutron_services['dragonflow-controller-agent']['group'] in group_names and neutron_services['dragonflow-controller-agent'].service_en | bool) + or (neutron_services['dragonflow-l3-agent']['group'] in group_names and neutron_services['dragonflow-l3-agent'].service_en | bool) %} ++ {% if (ovs_nsh_support and ansible_pkg_mgr in ['apt', 'zypper']) %} ++ {% set _ = packages.extend(neutron_ovs_nsh_required_packages) %} ++ {% else %} + {% set _ = packages.extend(neutron_ovs_distro_packages) %} + {% endif %} ++ {% endif %} + {% if neutron_services['neutron-linuxbridge-agent']['group'] in group_names and neutron_services['neutron-linuxbridge-agent'].service_en | bool %} + {% set _ = packages.extend(neutron_lxb_distro_packages) %} + {% endif %} +@@ -50,6 +54,8 @@ calico_felix_bin: /usr/local/bin/calico-felix + ### Python code details + ### + ++neutron_ovs_nsh_distro_packages: [] ++ + neutron_requires_pip_packages: + - virtualenv + - virtualenv-tools +diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml +index eb52ebf..a2c6275 100644 +--- a/vars/ubuntu-16.04.yml ++++ b/vars/ubuntu-16.04.yml +@@ -25,6 +25,12 @@ neutron_vpnaas_service_provider: VPN:strongswan:neutron_vpnaas.services.vpn.serv + ## APT Cache options + cache_timeout: 600 + ++neutron_ovs_nsh_required_packages: ++ - openvswitch-datapath-dkms ++ - openvswitch-common ++ - openvswitch-switch ++ - python-openvswitch ++ + neutron_distro_packages: + - conntrack + - dnsmasq-base diff --git a/plugins/odl_sfc/roles/sfc-pre-2/tasks/setup_sfc.yml b/plugins/odl_sfc/roles/sfc-pre-2/tasks/setup_sfc.yml index a80a81ef..039d5460 100644 --- a/plugins/odl_sfc/roles/sfc-pre-2/tasks/setup_sfc.yml +++ b/plugins/odl_sfc/roles/sfc-pre-2/tasks/setup_sfc.yml @@ -7,28 +7,14 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -- name: add ovs package in neutron - lineinfile: - dest: /etc/ansible/roles/os_neutron/vars/ubuntu-16.04.yml - insertbefore: 'openvswitch-common' - line: ' - openvswitch-datapath-dkms' -- name: add ovs package in neutron - lineinfile: - dest: /etc/ansible/roles/os_neutron/vars/ubuntu-16.04.yml - insertafter: 'openvswitch-switch' - line: ' - python-openvswitch' +- name: copy patch file + copy: + src: odl_sfc.patch + dest: /opt/odl_sfc.patch -- name: modify ovs installation in neutron - blockinfile: - dest: /etc/ansible/roles/os_neutron/tasks/neutron_install.yml - insertafter: '^# limitations' - block: | - - name: add ovs-nsh repo - apt_repository: - repo: "ppa:mardim/mardim-ppa" - update_cache: True - state: present - when: - - inventory_hostname in groups['neutron_openvswitch_agent'] - - inventory_hostname not in groups['nova_compute'] +- name: apply odl_sfc patch to os_neutron + shell: | + cd /etc/ansible/roles/os_neutron; + patch -p1 < /opt/odl_sfc.patch; + cd - diff --git a/plugins/onap/roles/tasks/Ubuntu.yml b/plugins/onap/roles/tasks/Ubuntu.yml new file mode 100644 index 00000000..a51e5f17 --- /dev/null +++ b/plugins/onap/roles/tasks/Ubuntu.yml @@ -0,0 +1,117 @@ +--- +- name: download helm + get_url: + url: "{{ helm_url }}" + dest: /tmp/helm.tar.gz + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: prepare helm + shell: + tar -zxf /tmp/helm.tar.gz -C /tmp; + mv /tmp/linux-amd64/helm /usr/local/bin/helm + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: install tiller + shell: > + kubectl create serviceaccount --namespace kube-system tiller; + kubectl create clusterrolebinding tiller-cluster-rule + --clusterrole=cluster-admin + --serviceaccount=kube-system:tiller; + helm init --service-account tiller + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: git clone oom + git: + repo: "{{ oom_repo }}" + dest: "{{ oom_dest }}" + version: "{{ oom_version }}" + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: prepare local repo + shell: + nohup /bin/sh -c "helm serve &" + while true; do curl -s 127.0.0.1:8879 > /dev/null; if [ $? -eq 0 ]; then break; fi; done + helm repo add local http://127.0.0.1:8879 + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: add helm plugin + shell: + cp -rf "{{ oom_dest }}/kubernetes/helm/plugins" ~/.helm/ + when: inventory_hostname == groups['kube_master'][0] + run_once: true + +- name: make + shell: + make all + args: + chdir: "{{ oom_dest }}/kubernetes" + when: inventory_hostname == groups['kube_master'][0] + +- name: install nfs master + apt: + pkg: "nfs-kernel-server" + state: "present" + update_cache: "yes" + when: inventory_hostname == groups['kube_master'][0] + +- name: create /dockerdata-nfs + file: + path: /dockerdata-nfs + owner: nobody + group: nogroup + state: directory + mode: 0777 + when: inventory_hostname == groups['kube_master'][0] + +- name: install nfs slave + apt: + pkg: "nfs-common" + state: "present" + update_cache: "yes" + when: inventory_hostname != groups['kube_master'][0] + +- name: create /dockerdata-nfs + file: + path: /dockerdata-nfs + state: directory + when: inventory_hostname != groups['kube_master'][0] + +- name: render /etc/exports + template: + src: exports.j2 + dest: /etc/exports + when: inventory_hostname == groups['kube_master'][0] + +- name: restart nfs service + shell: + exportfs -a; + systemctl restart nfs-kernel-server + when: inventory_hostname == groups['kube_master'][0] + +- name: register master hostname + debug: + msg: "{{ ip_settings[groups['kube_master'][0]]['external']['ip'] }}" + register: master_ip + +- name: + shell: + mount {{ master_ip.msg }}:/dockerdata-nfs /dockerdata-nfs/ + when: inventory_hostname != groups['kube_master'][0] + +# yamllint disable rule:line-length +- name: add mount info + lineinfile: + path: /etc/fstab + line: "{{ master_ip.msg }}:/dockerdata-nfs /dockerdata-nfs nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0" + when: inventory_hostname != groups['kube_master'][0] +# yamllint enable rule:line-length + +- name: deploy onap + shell: + helm deploy dev local/onap --namespace onap + when: inventory_hostname == groups['kube_master'][0] diff --git a/plugins/onap/roles/tasks/main.yml b/plugins/onap/roles/tasks/main.yml new file mode 100644 index 00000000..c9e80427 --- /dev/null +++ b/plugins/onap/roles/tasks/main.yml @@ -0,0 +1,11 @@ +############################################################################# +# Copyright (c) 2019 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################# +--- +- include: "{{ ansible_distribution }}.yml" + when: onap is defined and onap == "Enable" diff --git a/plugins/onap/roles/templates/exports.j2 b/plugins/onap/roles/templates/exports.j2 new file mode 100644 index 00000000..8f5a3f65 --- /dev/null +++ b/plugins/onap/roles/templates/exports.j2 @@ -0,0 +1 @@ +/dockerdata-nfs{% for host in groups.all %}{% if host != groups.kube_master[0] %} {{ ip_settings[host]['external']['ip'] }}(rw,sync,no_root_squash,no_subtree_check){% endif %}{% endfor %} diff --git a/plugins/onap/roles/vars/main.yml b/plugins/onap/roles/vars/main.yml new file mode 100644 index 00000000..83b591a5 --- /dev/null +++ b/plugins/onap/roles/vars/main.yml @@ -0,0 +1,13 @@ +############################################################################# +# Copyright (c) 2019 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +helm_url: https://storage.googleapis.com/kubernetes-helm/helm-v2.9.1-linux-amd64.tar.gz +oom_repo: https://gerrit.onap.org/r/oom +oom_dest: /home/oom +oom_version: casablanca diff --git a/plugins/opencontrail/plugin.desc b/plugins/opencontrail/plugin.desc new file mode 100644 index 00000000..82ccd5ee --- /dev/null +++ b/plugins/opencontrail/plugin.desc @@ -0,0 +1,43 @@ +# Plugin for opencontrail service for Compass4nfv. +# opencontrail provides a sdn network for k8s. +# +# More details can be found in the development document. +# ############################################################## +--- +plugin: + # plugin name,it is also as the switch to enable/disable plugin in scenario + # files + name: opencontrail + + description: provide a sdn solution for k8s + + maintainers: + + # host os type: centos + os_version: centos + + # true: this plugin is deployed separately on a new node + # false: this plugin is deployed on controller or compute node + independent_hosts: false + + # artifact: package download url for this plugin + artifacts: + url: + + # orchestration + # A plugin can have mutiple components, each component may need to be + # installed on different inventory or have its own configuration. + # due to Compass4nfv currently only supports ansible, so each component + # of the installation and configuration script need to be use ansible. + # cm : congfiguration management tool : only ansible support + # role: each component corresponds to ansible script that locates in the same + # directory as plugin.desc. + # phrase: + # inventory: + orchestration: + cm: ansible + roles: + - role: opencontrail + phrase: post_k8s + inventory: + - localhost diff --git a/plugins/opencontrail/roles/install-k8s-opencontrail/files/bms-instances.yaml b/plugins/opencontrail/roles/install-k8s-opencontrail/files/bms-instances.yaml new file mode 100644 index 00000000..7fb70374 --- /dev/null +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/files/bms-instances.yaml @@ -0,0 +1,32 @@ +--- +provider_config: + bms: + ssh_pwd: root + ssh_user: root + ssh_public_key: /root/.ssh/id_rsa.pub + ssh_private_key: /root/.ssh/id_rsa + domainsuffix: local +instances: + bms1: + provider: bms + roles: + config_database: + config: + control: + analytics_database: + analytics: + webui: + k8s_master: + kubemanager: + ip: 192.16.1.211 + bms2: + provider: bms + roles: + k8s_node: + vrouter: + ip: 192.16.1.212 + +contrail_configuration: + CONTAINER_REGISTRY: opencontrailnightly + CONTRAIL_VERSION: latest + KUBERNETES_CLUSTER_PROJECT: {} diff --git a/plugins/opencontrail/roles/install-k8s-opencontrail/files/kvm-instances.yaml b/plugins/opencontrail/roles/install-k8s-opencontrail/files/kvm-instances.yaml new file mode 100644 index 00000000..b2f9e6dd --- /dev/null +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/files/kvm-instances.yaml @@ -0,0 +1,32 @@ +--- +provider_config: + kvm: + ssh_pwd: root + ssh_user: root + ssh_public_key: /root/.ssh/id_rsa.pub + ssh_private_key: /root/.ssh/id_rsa + domainsuffix: local +instances: + kvm1: + provider: kvm + roles: + config_database: + config: + control: + analytics_database: + analytics: + webui: + k8s_master: + kubemanager: + ip: 10.1.0.50 + kvm2: + provider: kvm + roles: + k8s_node: + vrouter: + ip: 10.1.0.51 + +contrail_configuration: + CONTAINER_REGISTRY: opencontrailnightly + CONTRAIL_VERSION: latest + KUBERNETES_CLUSTER_PROJECT: {} diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors.repo b/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors.repo index 4900db69..4900db69 100644 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors.repo +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors.repo diff --git a/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors_aarch64.repo b/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors_aarch64.repo new file mode 100644 index 00000000..1d622d3c --- /dev/null +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/files/mirrors_aarch64.repo @@ -0,0 +1,22 @@ +[base] +name=CentOS-$releasever - Base +baseurl=http://mirror.centos.org/altarch/$releasever/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 + +#released updates +[updates] +name=CentOS-$releasever - Updates +baseurl=http://mirror.centos.org/altarch/$releasever/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +baseurl=http://mirror.centos.org/altarch/$releasever/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 diff --git a/plugins/opencontrail/roles/install-k8s-opencontrail/tasks/main.yml b/plugins/opencontrail/roles/install-k8s-opencontrail/tasks/main.yml new file mode 100644 index 00000000..712ebfa7 --- /dev/null +++ b/plugins/opencontrail/roles/install-k8s-opencontrail/tasks/main.yml @@ -0,0 +1,92 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +- name: clean local repo conf + file: + path: /etc/yum.repos.d + state: absent + run_once: "True" + when: ansible_os_family == 'RedHat' + +- name: create local repo conf dir + file: + path: /etc/yum.repos.d + state: directory + run_once: "True" + when: ansible_os_family == 'RedHat' + +- name: configure local mirror repo + copy: + src: "{{ item }}" + dest: /etc/yum.repos.d/mirrors.repo + with_first_found: + - mirrors_{{ ansible_architecture }}.repo + - mirrors.repo + run_once: "True" + when: ansible_os_family == 'RedHat' + +- name: clean local pip conf to use official pip repo + file: + path: /root/.pip/pip.conf + state: absent + run_once: "True" + +- name: install dependency for ansible update + yum: + name: "{{ item }}" + state: latest + with_items: + - git + - libffi-devel + - openssl-devel + - python-devel + run_once: "True" + when: ansible_os_family == 'RedHat' + +- name: update python packages + pip: + name: "{{ item }}" + state: latest + with_items: + - netaddr + - jinja2 + +- name: git clone contrail-ansible-deployer repo + shell: | + rm -rf /opt/contrail-ansible-deployer + git clone https://github.com/Juniper/contrail-ansible-deployer.git \ + /opt/contrail-ansible-deployer + +- name: copy overrided variables + copy: + src: "{{ item }}" + dest: /opt/contrail-ansible-deployer/config/instances.yaml + with_first_found: + - kvm-instances.yaml + +- name: do not restart network + shell: | + cd /opt/contrail-ansible-deployer + sed -i '9, 13d' playbooks/roles/configure_instances/tasks/RedHat.yml + +- name: run config playbook + shell: | + cd /opt/contrail-ansible-deployer + ansible-playbook -i inventory/ playbooks/configure_instances.yml \ + -b -v 2>&1 | tee config-contrail.log + tags: + - ansible + +- name: run install playbook + shell: | + cd /opt/contrail-ansible-deployer + ansible-playbook -e orchestrator=kubernetes -i inventory/ playbooks/install_contrail.yml \ + -b -v 2>&1 | tee install-contrail.log + tags: + - ansible diff --git a/plugins/stor4nfv/plugin.desc b/plugins/stor4nfv/plugin.desc new file mode 100644 index 00000000..e0a1e690 --- /dev/null +++ b/plugins/stor4nfv/plugin.desc @@ -0,0 +1,49 @@ +# Plugin for Stor4nfv service for Compass4nfv. +# Stor4NFV provides a storage solution based on Ceph and +# OpenSDS, and focuses on the optimization for storage +# intensive use cases of NFV, like I/O performance improvements. +# +# More details can be found in the development document. +# ############################################################## +--- +plugin: + # plugin name,it is also as the switch to enable/disable plugin in scenario + # files + name: stor4nfv + + description: provide a storage solution based on Ceph and OpenSDS + + maintainers: + + # host os type: ubuntu/centos + os_version: ubuntu + + # true: this plugin is deployed separately on a new node + # false: this plugin is deployed on controller or compute node + independent_hosts: false + + # artifact: package download url for this plugin + artifacts: + url: + + # orchestration + # A plugin can have mutiple components, each component may need to be + # installed on different inventory or have its own configuration. + # due to Compass4nfv currently only supports ansible, so each component + # of the installation and configuration script need to be use ansible. + # cm : congfiguration management tool : only ansible support + # role: each component corresponds to ansible script that locates in the same + # directory as plugin.desc. + # phrase: + # inventory: + orchestration: + cm: ansible + roles: + - role: stor4nfv + 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 new file mode 100644 index 00000000..89432135 --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/files/configure_vars.sh @@ -0,0 +1,60 @@ +#!/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/stor4nfv/stor4nfv/ci/ansible + +sed -i 's/^container_enabled.*/container_enabled: false/g' group_vars/common.yml + +sed -i 's/^nbp_plugin_type.*/nbp_plugin_type: csi/g' group_vars/common.yml + +sed -i 's/^workplace.*/workplace: \/root/g' group_vars/common.yml + +sed -i 's/^enabled_backend.*/enabled_backend: ceph/g' group_vars/osdsdock.yml + +sed -i 's/^ceph_origin.*/ceph_origin: repository/g' group_vars/ceph/all.yml + +sed -i 's/^ceph_repository.*/ceph_repository: community/g' group_vars/ceph/all.yml + +sed -i 's/^ceph_stable_release.*/ceph_stable_release: luminous/g' group_vars/ceph/all.yml + +sed -i 's|^public_network.*|public_network: '"$1"'|g' group_vars/ceph/all.yml + +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/all.yml + +sed -i '/dev\/sda/s/^/#/g' group_vars/ceph/all.yml + +sed -i 's/^osd_scenario.*/osd_scenario: collocated/g' group_vars/ceph/osds.yml + +sed -i 's/^db_endpoint.*/db_endpoint: localhost:62379,localhost:62380/g' group_vars/osdsdb.yml + +sed -i 's/^etcd_host.*/etcd_host: 127.0.0.1/g' group_vars/osdsdb.yml + +sed -i 's/^etcd_port.*/etcd_port: 62379/g' group_vars/osdsdb.yml + +sed -i 's/^etcd_peer_port.*/etcd_peer_port: 62380/g' group_vars/osdsdb.yml + +sed -i 's/^opensds_auth_strategy.*/opensds_auth_strategy: noauth/g' group_vars/auth.yml + +sed -i '/check_ansible_version/a \ ignore_errors: yes\' roles/common/tasks/main.yml + +sed -i '/- dashboard-installer/s/^/#/g' site.yml + +# comment csi create pods in Stor4nfv +sed -i '/kubectl create/s/^/#/g' roles/nbp-installer/scenarios/csi.yml + +sed -i 's/^opensds_endpoint.*/opensds_endpoint: http:\/\/'"$1"':50040/g' group_vars/common.yml + +sed -i '/and service_ceph_osd_status.rc == 0/s/^/#/g' roles/osdsdock/scenarios/ceph.yml +sed -i '/and service_ceph_osd_status.rc == 0/a \ when: service_ceph_mon_status.rc == 0\' \ + roles/osdsdock/scenarios/ceph.yml diff --git a/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh b/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh new file mode 100644 index 00000000..d921d4e2 --- /dev/null +++ b/plugins/stor4nfv/roles/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/stor4nfv/tasks/main.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml new file mode 100644 index 00000000..dbaa8d6b --- /dev/null +++ b/plugins/stor4nfv/roles/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/stor4nfv/tasks/opensds.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml new file mode 100644 index 00000000..e84ce0aa --- /dev/null +++ b/plugins/stor4nfv/roles/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: + - make + - gcc + - gawk + +- 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" + +- name: fetch stor4nfv source code + remote_user: root + shell: | + mkdir -p $HOME/gopath/src/github.com/stor4nfv && cd $HOME/gopath/src/github.com/stor4nfv; + git clone https://gerrit.opnfv.org/gerrit/stor4nfv.git + +- name: copy configure_vars script + remote_user: root + copy: + src: configure_vars.sh + dest: /opt/configure_vars.sh + mode: 0777 + +- name: configure variables for ceph, opensds + remote_user: root + shell: | + cd /opt; + ./configure_vars.sh {{ mgmt_cidr }} {{ external_cidr }} + +- name: render ceph inventory + remote_user: root + template: + src: ceph.hosts.j2 + dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/group_vars/ceph/ceph.hosts + +- name: render opensds, nbp inventory + remote_user: root + template: + src: opensds-nbp.hosts.j2 + dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/local.hosts + +- name: force to run the second etcd cluster + remote_user: root + lineinfile: + dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/roles/osdsdb/scenarios/etcd.yml + state: absent + regexp: 'when: service_etcd_status.rc != 0' + +- name: run playbook + remote_user: root + shell: | + cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible; + ansible-playbook site.yml -i local.hosts | tee /var/log/stor4nfv.log diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml new file mode 100644 index 00000000..501d3baa --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml @@ -0,0 +1,69 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- + +- name: define image architecture + set_fact: + imgarch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" + +- name: ensure ceph-ansible dir exists + stat: + path: /opt/ceph-ansible + ignore_errors: "true" + register: ceph_ansible_exists + +- name: copy post-install.yml to /opt/ceph-ansible + remote_user: root + template: + src: post-install.yml.j2 + dest: /opt/ceph-ansible/post-install.yml + when: + - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists + +- name: run post-install playbook + shell: ansible-playbook post-install.yml -i ceph.hosts + become: true + args: + chdir: /opt/ceph-ansible + ignore_errors: "true" + when: + - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists + +- name: remove post-install.yml + file: + path: /opt/ceph-ansible/post-install.yml + state: absent + when: + - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists + +- name: ensure osdsctl exists + stat: + path: /opt/opensds-hotpot-linux-{{ imgarch }}/bin/osdsctl + ignore_errors: "true" + register: osdsctl_exists + +- name: ensure opensds csi directory exists + stat: + path: /opt/opensds-sushi-linux-{{ imgarch }} + ignore_errors: "true" + register: csi_dir_exists + +- name: create opensds default profile, create csi pods + remote_user: root + shell: | + cp /opt/opensds-hotpot-linux-{{ imgarch }}/bin/osdsctl /usr/local/bin; + export OPENSDS_ENDPOINT=http://{{ public_vip.ip }}:50040; + export OPENSDS_AUTH_STRATEGY=noauth; + osdsctl profile create '{"name": "default", "description": "default policy"}'; + cd /opt/opensds-sushi-linux-{{ imgarch }}; + kubectl create -f csi/deploy/kubernetes + ignore_errors: "true" + when: + - osdsctl_exists.stat.exists is defined and osdsctl_exists.stat.exists + - csi_dir_exists.stat.exists is defined and csi_dir_exists.stat.exists diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/stor4nfv.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/stor4nfv.yml new file mode 100644 index 00000000..57bae793 --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/tasks/stor4nfv.yml @@ -0,0 +1,12 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- +- include: opensds.yml + +- include: post-install.yml diff --git a/plugins/stor4nfv/roles/stor4nfv/templates/ceph.hosts.j2 b/plugins/stor4nfv/roles/stor4nfv/templates/ceph.hosts.j2 new file mode 100644 index 00000000..fda313d4 --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/templates/ceph.hosts.j2 @@ -0,0 +1,14 @@ +[mons] +{% for controller in hostvars[inventory_hostname]['groups']['kube_master'] %} +{{ controller }} ansible_ssh_host={{ hostvars[controller]['ansible_ssh_host'] }} +{% endfor %} + +[osds] +{% for controller in hostvars[inventory_hostname]['groups']['storage_node'] %} +{{ controller }} ansible_ssh_host={{ hostvars[controller]['ansible_ssh_host'] }} +{% endfor %} + +[mgrs] +{% for controller in hostvars[inventory_hostname]['groups']['kube_master'] %} +{{ controller }} ansible_ssh_host={{ hostvars[controller]['ansible_ssh_host'] }} +{% endfor %} diff --git a/plugins/stor4nfv/roles/stor4nfv/templates/opensds-nbp.hosts.j2 b/plugins/stor4nfv/roles/stor4nfv/templates/opensds-nbp.hosts.j2 new file mode 100644 index 00000000..c93f2b77 --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/templates/opensds-nbp.hosts.j2 @@ -0,0 +1,14 @@ +[controllers] +{% for controller in hostvars[inventory_hostname]['groups']['storage_master'] %} +{{ controller }} ansible_ssh_host={{ hostvars[controller]['ansible_ssh_host'] }} +{% endfor %} + +[docks] +{% for dock in hostvars[inventory_hostname]['groups']['storage_master'] %} +{{ dock }} ansible_ssh_host={{ hostvars[dock]['ansible_ssh_host'] }} +{% endfor %} + +[worker-nodes] +{% for worker in hostvars[inventory_hostname]['groups']['storage_master'] %} +{{ worker }} ansible_ssh_host={{ hostvars[worker]['ansible_ssh_host'] }} +{% endfor %} diff --git a/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2 b/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2 new file mode 100644 index 00000000..662abc34 --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2 @@ -0,0 +1,20 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- + +- hosts: + - mons + - osds + - mgrs + + tasks: + - name: run modprobe rbd + remote_user: root + command: modprobe rbd + ignore_errors: "true" diff --git a/quickstart.sh b/quickstart.sh index db56ee2f..f872abfd 100755 --- a/quickstart.sh +++ b/quickstart.sh @@ -7,6 +7,13 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## + +COMPASS_ARCH=$(uname -m) +if [ "$COMPASS_ARCH" = "aarch64" ]; then + echo "Not support aarch64, please try quickstart_k8s.sh instead" + exit 1 +fi + sudo apt-get update sudo apt-get install -y git diff --git a/quickstart_k8s.sh b/quickstart_k8s.sh index 2745cdb9..49a8432c 100755 --- a/quickstart_k8s.sh +++ b/quickstart_k8s.sh @@ -7,6 +7,15 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## + +COMPASS_ARCH=$(uname -m) +if [ "$COMPASS_ARCH" = "aarch64" ]; then + echo "Running on aarch64 host, make sure your jump host is configured okay" + echo "Please reference docs/release/installation/k8s-deploy-arm.rst" + export ADAPTER_OS_PATTERN='(?i)CentOS-7.*arm.*' + SCENARIO=${SCENARIO:-k8-nosdn-nofeature-noha.yml} +fi + sudo apt-get update sudo apt-get install -y git diff --git a/util/check_valid.py b/util/check_valid.py index e6a72e71..9348d272 100644 --- a/util/check_valid.py +++ b/util/check_valid.py @@ -98,25 +98,19 @@ def check_dha_file(dha): invalid = False if dha['TYPE'] == 'baremetal': for i in dha['hosts']: - if not is_valid_mac(i['mac']): - err_print('''invalid address: - hosts: - - name: %s - mac: %s''' % (i['name'], i['mac'])) - invalid = True for j in i['interfaces']: - if not is_valid_mac(j.values()[0]): + if not is_valid_mac(i['interfaces'].get(j)): err_print('''invalid address: hosts: - name: %s interfaces: - - %s: %s''' % (i['name'], j.keys()[0], j.values()[0])) # noqa: E501 + - %s: %s''' % (i['name'], j, i['interfaces'].get(j))) # noqa: E501 invalid = True - if not is_valid_ip(i['ipmiIp']): + if not is_valid_ip(i['power_ip']): err_print('''invalid address: hosts: - name: %s - ipmiIp: %s''' % (i['name'], i['ipmiIp'])) + power_ip: %s''' % (i['name'], i['power_ip'])) invalid = True if not invalid: diff --git a/util/docker-compose/group_vars/all b/util/docker-compose/group_vars/all index 1dafe814..d43d659d 100755 --- a/util/docker-compose/group_vars/all +++ b/util/docker-compose/group_vars/all @@ -19,7 +19,7 @@ install_ip_range: 10.1.0.100 10.1.0.250 pip_pkg_name: pip-openstack.tar.gz feature_pkg_name: packages.tar.gz -distros: +distros_x86_64: ubuntu-16.04.3: breed: "ubuntu" kickstart: "default16.seed" @@ -29,7 +29,9 @@ distros: aliase: "xenial" version: "ubuntu" iso_name: ubuntu-16.04.3-server-amd64 - ppa_name: xenial-pike-ppa + ppa_name: xenial-queens-ppa + cobbler_name: ubuntu-16.04.3-server + cobbler_arch: x86_64 CentOS-7: breed: "redhat" @@ -37,5 +39,30 @@ distros: aliase: "centos7" version: "centos" iso_name: CentOS-7-x86_64-Minimal-1708 - ppa_name: centos7-pike-ppa + ppa_name: centos7-queens-ppa + cobbler_name: CentOS-7-Minimal-1708 + cobbler_arch: x86_64 +distros_aarch64: + ubuntu-16.04: + breed: "ubuntu" + kickstart: "default16-aarch64.seed" + kopts: "netcfg/choose_interface=auto console=ttyS0 console=ttyAMA0 net.ifnames=0" + kopts_post: "console=ttyS0 console=ttyAMA0 net.ifnames=0" + extra: "--apt-dists=xenial --apt-components=main" + aliase: "xenial" + version: "ubuntu" + iso_name: ubuntu-16.04-server-arm64 + ppa_name: xenial-queens-ppa + cobbler_name: ubuntu-16.04-server + cobbler_arch: arm + + CentOS-7: + breed: "redhat" + kickstart: "default-aarch64.ks" + aliase: "centos7" + version: "centos" + iso_name: CentOS-7-aarch64-Minimal-1708 + ppa_name: centos7-queens-ppa + cobbler_name: CentOS-7-Minimal-1708 + cobbler_arch: arm diff --git a/util/docker-compose/roles/cobbler/tasks/main.yml b/util/docker-compose/roles/cobbler/tasks/main.yml index e3f13088..e4e2cf30 100755 --- a/util/docker-compose/roles/cobbler/tasks/main.yml +++ b/util/docker-compose/roles/cobbler/tasks/main.yml @@ -44,23 +44,22 @@ docker cp "{{ compass_dists_dir }}/{{ item.value.ppa_name }}.tar.gz" compass-cobbler:/tmp docker exec compass-cobbler bash -c \ "mkdir -p /var/lib/cobbler/repo_mirror/{{ item.value.ppa_name }}" - with_dict: "{{ distros }}" + with_dict: "{{ vars['distros_' + ansible_architecture] }}" run_once: "True" ignore_errors: "True" - name: cobbler import iso shell: | - name=`basename {{ item.value.iso_name }} | \ - sed -e 's/.iso//g' -e 's/-amd64//g' -e 's/-x86_64//g'` + name="{{ item.value.cobbler_name }}" docker exec compass-cobbler bash -c \ "service cobblerd restart; sleep 3; cobbler import --name $name \ --path /mnt/{{ item.value.iso_name }} \ - --arch x86_64 \ + --arch {{ item.value.cobbler_arch }} \ --kickstart /var/lib/cobbler/kickstarts/{{ item.value.kickstart }} \ --breed {{ item.value.breed }}" - with_dict: "{{ distros }}" + with_dict: "{{ vars['distros_' + ansible_architecture] }}" run_once: "True" register: result2 until: result2.rc == 0 @@ -73,14 +72,14 @@ "cobbler repo add --name {{ item.value.ppa_name }} \ --mirror /var/lib/cobbler/repo_mirror/{{ item.value.ppa_name }} \ --mirror-locally True \ - --arch=x86_64 {{ item.value.extra | default()}}" - with_dict: "{{ distros }}" + --arch={{ item.value.cobbler_arch }} \ + {{ item.value.extra | default() }}" + with_dict: "{{ vars['distros_' + ansible_architecture] }}" run_once: "True" -- name: edit profiles +- name: edit profiles for x86_64 shell: | - name=`basename {{ item.value.iso_name }} | \ - sed -e 's/.iso//g' -e 's/-amd64//g' -e 's/-x86_64//g'`-x86_64 + name="{{ item.value.cobbler_name }}-x86_64" docker exec compass-cobbler bash -c \ "cobbler profile edit --name $name \ --name-servers '' \ @@ -88,8 +87,38 @@ --ksmeta \"tree=http://{{ host_ip }}/cobbler/ks_mirror/$name\" \ --kopts \"{{ item.value.kopts | default('') }}\" \ --kopts-post \"{{ item.value.kopts_post | default('') }}\"" - with_dict: "{{ distros }}" + with_dict: "{{ distros_x86_64 }}" run_once: "True" + when: ansible_architecture == "x86_64" + +- name: edit profile for aarch64 + shell: | + # Cobbler naming on Arm is a mess + # Imported name: + # - CentOS-7-Minimal-1611 + # - ubuntu-16.04-server + # Profile name: + # - CentOS-7-Minimal-1611-arm-arm + # - ubuntu-16.04-server-arm-arm64-arm + # Kickstart meta url name + # - http://x.x.x.x/cobbler/ks_mirror/CentOS-7-Minimal-1611-arm + # - http://x.x.x.x/cobbler/ks_mirror/ubuntu-16.04-server-arm + name="{{ item.value.cobbler_name }}-arm" + profiles=`docker exec compass-cobbler bash -c \ + "cobbler profile list | grep $name"` + for profile_name in $profiles; do + docker exec compass-cobbler bash -c \ + "cobbler profile edit \ + --name $profile_name \ + --name-servers '' \ + --repos {{ item.value.ppa_name }} \ + --ksmeta \"tree=http://{{ host_ip }}/cobbler/ks_mirror/$name\" \ + --kopts \"{{ item.value.kopts | default('') }}\" \ + --kopts-post \"{{ item.value.kopts_post | default('') }}\"" + done + with_dict: "{{ distros_aarch64 }}" + run_once: "True" + when: ansible_architecture == "aarch64" - name: cobbler sync shell: | diff --git a/util/docker-compose/roles/cobbler/templates/dhcp.template.j2 b/util/docker-compose/roles/cobbler/templates/dhcp.template.j2 index 0665f2fe..8b1f2a61 100755 --- a/util/docker-compose/roles/cobbler/templates/dhcp.template.j2 +++ b/util/docker-compose/roles/cobbler/templates/dhcp.template.j2 @@ -42,6 +42,8 @@ subnet {{ install_subnet }} netmask {{ install_netmask }} { filename "grub/grub-x86.efi"; } else if option pxe-system-type = 00:07 { filename "grub/grub-x86_64.efi"; + } else if option pxe-system-type = 00:0B { + filename "grub/grub-aarch64.efi"; } else { filename "pxelinux.0"; } 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/compass/tasks/main.yml b/util/docker-compose/roles/compass/tasks/main.yml index 9ee7902e..d03a7bf2 100755 --- a/util/docker-compose/roles/compass/tasks/main.yml +++ b/util/docker-compose/roles/compass/tasks/main.yml @@ -1,5 +1,8 @@ --- -- include_vars: "{{ compass_dists_dir }}/build.yaml" +- include_vars: "{{ item }}" + with_first_found: + - "{{ compass_dists_dir }}/build-{{ ansible_architecture }}.yaml" + - "{{ compass_dists_dir }}/build.yaml" - set_fact: image_name: "{{ item.name | regex_replace('-', '_') }}" @@ -16,7 +19,11 @@ {% for item in compass_images.results %} {% if "ansible_facts" in item %} {% set facts = item.ansible_facts %} - {% set _ = image_dict.update({facts.image_name: facts.image_repo}) %} + {% set image_name = facts.image_name %} + {% if "compass_tasks" in image_name %} + {% set image_name = "compass_tasks" %} + {% endif %} + {% set _ = image_dict.update({image_name: facts.image_repo}) %} {% endif %} {% endfor %} {% for key in image_dict %} @@ -92,6 +99,11 @@ "{{ docker_compose_dir }}"/ansible/$i done +- name: copy ansible plugins + copy: + src: "{{ compass_dir }}/deploy/ansible_plugins" + dest: "{{ docker_compose_dir }}" + - name: create run dir file: path: "{{ docker_compose_dir }}/ansible/run" @@ -120,16 +132,6 @@ tags: - redploy -- name: add ansible callback - shell: | - docker cp "{{ item }}" \ - compass-deck:/root/compass-deck/bin/ansible_callbacks - docker cp "{{ item }}" \ - compass-tasks:/opt/ansible_callbacks - with_items: - - "{{ compass_dir }}/deploy/status_callback.py" - - "{{ compass_dir }}/deploy/playbook_done.py" - - name: rm ansible run shell: | docker exec compass-tasks bash -c "rm -rf /var/ansible/run/*" diff --git a/util/docker-compose/roles/compass/templates/docker-compose.yml.j2 b/util/docker-compose/roles/compass/templates/docker-compose.yml.j2 index 7fc8ea3a..f7748634 100755 --- a/util/docker-compose/roles/compass/templates/docker-compose.yml.j2 +++ b/util/docker-compose/roles/compass/templates/docker-compose.yml.j2 @@ -43,6 +43,7 @@ services: volumes: - {{ docker_compose_dir }}/compass_conf:/etc/compass - {{ docker_compose_dir }}/ansible:/var/ansible + - {{ docker_compose_dir }}/ansible_plugins:/opt/ansible_plugins command: - /usr/local/bin/start.sh {% endif %} 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 |