diff options
Diffstat (limited to 'deploy')
14 files changed, 425 insertions, 25 deletions
diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index 199c14ab..bb468c56 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -1,6 +1,42 @@ --- - hosts: all remote_user: root + pre_tasks: + - name: make sure ssh dir exist + file: + path: '{{ item.path }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + state: directory + mode: 0755 + with_items: + - path: /root/.ssh + owner: root + group: root + + - name: write ssh config + copy: + content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no" + dest: '{{ item.dest }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + mode: 0600 + with_items: + - dest: /root/.ssh/config + owner: root + group: root + + - name: generate ssh keys + shell: if [ ! -f ~/.ssh/id_rsa.pub ]; then ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""; else echo "already gen ssh key!"; fi; + + - name: fetch ssh keys + fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/ssh-keys-{{ ansible_hostname }} flat=yes + + - authorized_key: + user: root + key: "{{ lookup('file', 'item') }}" + with_fileglob: + - /tmp/ssh-keys-* roles: - common @@ -38,8 +74,8 @@ - hosts: all remote_user: root accelerate: true - roles: - - storage + roles: + - storage - hosts: compute remote_user: root @@ -91,3 +127,48 @@ accelerate: true roles: - secgroup + +- hosts: all + remote_user: root + accelerate: true + tasks: + - name: set bash to nova + user: + name: nova + shell: /bin/bash + + - name: make sure ssh dir exist + file: + path: '{{ item.path }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + state: directory + mode: 0755 + with_items: + - path: /var/lib/nova/.ssh + owner: nova + group: nova + + - name: copy ssh keys for nova + shell: cp -rf /root/.ssh/id_rsa /var/lib/nova/.ssh; + + - name: write ssh config + copy: + content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no" + dest: '{{ item.dest }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + mode: 0600 + with_items: + - dest: /var/lib/nova/.ssh/config + owner: nova + group: nova + + - authorized_key: + user: nova + key: "{{ lookup('file', 'item') }}" + with_fileglob: + - /tmp/ssh-keys-* + + - name: chown ssh file + shell: chown -R nova:nova /var/lib/nova/.ssh; diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml index a6ee0000..5ed7163e 100644 --- a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml +++ b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml @@ -9,6 +9,7 @@ template: src={{ item.src}} dest=/opt/os_templates with_items: "{{ ceilometer_configs_templates }}" + - name: update ceilometer configs shell: crudini --merge {{ item.1 }} < /opt/os_templates/{{ item.0.src }} with_subelements: @@ -16,6 +17,13 @@ - dest notify: restart ceilometer relation service +- name: change meter polling interval to 300s + replace: + dest: /etc/ceilometer/pipeline.yaml + regexp: 'interval: .+' + replace: 'interval: 300' + notify: restart ceilometer relation service + - name: write services to monitor list lineinfile: dest=/opt/service create=yes line='{{ item }}' with_items: ceilometer_services diff --git a/deploy/adapters/ansible/roles/ha/templates/haproxy.cfg b/deploy/adapters/ansible/roles/ha/templates/haproxy.cfg index 1bca5e39..3ff63689 100644 --- a/deploy/adapters/ansible/roles/ha/templates/haproxy.cfg +++ b/deploy/adapters/ansible/roles/ha/templates/haproxy.cfg @@ -56,7 +56,6 @@ listen proxy-glance_registry_cluster bind {{ public_vip.ip }}:9191 option tcpka option tcplog - option httpchk balance source {% for host,ip in haproxy_hosts.items() %} server {{ host }} {{ ip }}:9191 weight 1 check inter 2000 rise 2 fall 5 @@ -78,7 +77,6 @@ listen proxy-nova-novncproxy bind {{ public_vip.ip }}:6080 option tcpka option tcplog - option httpchk balance source {% for host,ip in haproxy_hosts.items() %} server {{ host }} {{ ip }}:6080 weight 1 check inter 2000 rise 2 fall 5 @@ -144,7 +142,6 @@ listen proxy-nova_metadata_api_cluster bind {{ public_vip.ip }}:8775 option tcpka option tcplog - option httpchk balance source {% for host,ip in haproxy_hosts.items() %} server {{ host }} {{ ip }}:8775 weight 1 check inter 2000 rise 2 fall 5 @@ -180,7 +177,6 @@ listen proxy-dashboarad cookie SERVERID insert indirect nocache option forwardfor option httpchk - option httpchk option httpclose rspidel ^Set-cookie:\ IP= {% for host,ip in haproxy_hosts.items() %} diff --git a/deploy/adapters/ansible/roles/onos_cluster/tasks/main.yml b/deploy/adapters/ansible/roles/onos_cluster/tasks/main.yml index 3cd4421b..77e06586 100755 --- a/deploy/adapters/ansible/roles/onos_cluster/tasks/main.yml +++ b/deploy/adapters/ansible/roles/onos_cluster/tasks/main.yml @@ -30,6 +30,7 @@ ovs-vsctl del-br br-int ; ovs-vsctl del-br br-tun ; ovs-vsctl del-manager ; + ip link delete onos_port1 type veth peer name onos_port2; when: groups['onos']|length !=0 ignore_errors: True diff --git a/deploy/adapters/ansible/roles/onos_cluster/tasks/onos_controller.yml b/deploy/adapters/ansible/roles/onos_cluster/tasks/onos_controller.yml index 0606fad9..c22ba7cc 100755 --- a/deploy/adapters/ansible/roles/onos_cluster/tasks/onos_controller.yml +++ b/deploy/adapters/ansible/roles/onos_cluster/tasks/onos_controller.yml @@ -47,6 +47,7 @@ - name: create new jar repository command: su -s /bin/sh -c "mkdir ~/.m2" + ignore_errors: True - name: download jar repository get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/repository.tar" dest=~/.m2/ diff --git a/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml b/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml index f8ed551f..0e7c0eb6 100755 --- a/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml +++ b/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml @@ -29,8 +29,21 @@ # dpkg -i openvswitch-common_2.3.0-1_amd64.deb; # dpkg -i openvswitch-switch_2.3.0-1_amd64.deb; -- name: start up onos-external nic - command: su -s /bin/sh -c "ifconfig eth2 0 up" +#- name: start up onos-external nic +# command: su -s /bin/sh -c "ifconfig eth2 0 up" +- name: set veth port + shell: > + ip link add onos_port1 type veth peer name onos_port2; + ifconfig onos_port1 up; + ifconfig onos_port2 up; + ignore_errors: True + +- name: set veth to ovs + shell: > + export externamMac=`ifconfig eth1 | grep "HWaddr" | awk '{print $5}'`; + ifconfig onos_port2 hw ether $externamMac; + ovs-vsctl add-port br-prv onos_port1; + ignore_errors: True #- name: wait for onos start time # shell: "sleep 200" @@ -41,20 +54,19 @@ - name: add openflow-base feature command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-openflow-base'"; - when: inventory_hostname == groups['onos'][0] + when: inventory_hostname in groups['onos'] - name: add openflow feature command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-openflow'"; - when: inventory_hostname == groups['onos'][0] + when: inventory_hostname in groups['onos'] - name: add vtn feature command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-app-vtn-onosfw'"; - when: inventory_hostname == groups['onos'][0] - + when: inventory_hostname in groups['onos'] - name: set public eth card start - command: su -s /bin/sh -c "/opt/onos/bin/onos 'externalportname-set -n eth2'" - when: inventory_hostname == groups['onos'][0] + command: su -s /bin/sh -c "/opt/onos/bin/onos 'externalportname-set -n onos_port2'" + when: inventory_hostname in groups['onos'] - name: Set ONOS as the manager command: su -s /bin/sh -c "ovs-vsctl set-manager tcp:{{ ip_settings[groups['onos'][0]]['mgmt']['ip'] }}:6640;" @@ -66,7 +78,7 @@ export OS_AUTH_URL=http://{{ internal_vip.ip }}:35357/v2.0; export OS_USERNAME=ADMIN; neutron net-create ext-net --shared --router:external=True; - neutron subnet-create ext-net --name ext-subnet {{ public_net_info.floating_ip_cidr }}; + neutron subnet-create ext-net {{ public_net_info.floating_ip_cidr }} --name ext-subnet --allocation-pool start={{ public_net_info.floating_ip_start }},end={{ public_net_info.floating_ip_end }}; when: inventory_hostname == groups['controller'][0] - name: set gateway mac address @@ -74,7 +86,7 @@ ping -c 1 {{ ansible_default_ipv4.gateway }}; gatewayMac=`arp -a {{ ansible_default_ipv4.gateway }} | awk '{print $4}'`; /opt/onos/bin/onos "externalgateway-update -m $gatewayMac"; - when: inventory_hostname == groups['onos'][0] + when: inventory_hostname in groups['onos'] - name: delete default gateway shell: > diff --git a/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/network.yml b/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/network.yml new file mode 100644 index 00000000..154f4150 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/network.yml @@ -0,0 +1,90 @@ +nic_mappings: [] +bond_mappings: [] + +provider_net_mappings: + - name: br-prv + network: physnet + interface: eth1 + type: ovs + role: + - controller + - compute + +sys_intf_mappings: + - name: mgmt + interface: eth1 + vlan_tag: 101 + type: vlan + role: + - controller + - compute + + - name: storage + interface: eth1 + vlan_tag: 102 + type: vlan + role: + - controller + - compute + + - name: external + interface: br-prv + type: ovs + role: + - controller + - compute + +ip_settings: + - name: mgmt + ip_ranges: + - - "172.16.1.1" + - "172.16.1.254" + cidr: "172.16.1.0/24" + role: + - controller + - compute + + - name: storage + ip_ranges: + - - "172.16.2.1" + - "172.16.2.254" + 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: 172.16.1.222 + netmask: "24" + interface: mgmt + +public_vip: + ip: 192.168.10.51 + netmask: "24" + interface: external + +onos_nic: eth2 +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-us-deploy-bare-1/os-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/os-nosdn-nofeature-ha.yml new file mode 100644 index 00000000..47df7ff7 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/os-nosdn-nofeature-ha.yml @@ -0,0 +1,39 @@ + +TYPE: baremetal +FLAVOR: cluster +POWER_TOOL: ipmitool + +ipmiUser: root +ipmiVer: '2.0' + +hosts: + - name: host2 + mac: 'E0:24:7F:02:15:A3' + ipmiIp: 172.16.130.28 + ipmiPass: huawei@123 + roles: + - controller + - ha + + - name: host3 + mac: 'D8:49:0B:DA:2A:28' + ipmiIp: 172.16.130.29 + ipmiPass: Huawei@123 + roles: + - controller + - ha + + - name: host4 + mac: 'D8:49:0B:DA:5B:5D' + ipmiIp: 172.16.130.30 + ipmiPass: Huawei@123 + roles: + - compute + + - name: host5 + mac: 'D8:49:0B:DA:56:85' + ipmiIp: 172.16.130.31 + ipmiPass: Huawei@123 + roles: + - compute + diff --git a/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/os-odl_l2-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/os-odl_l2-nofeature-ha.yml new file mode 100644 index 00000000..f5f9ae3a --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/os-odl_l2-nofeature-ha.yml @@ -0,0 +1,41 @@ + +TYPE: baremetal +FLAVOR: cluster +POWER_TOOL: ipmitool + +ipmiUser: root +ipmiVer: '2.0' + +hosts: + - name: host2 + mac: 'E0:24:7F:02:15:A3' + ipmiIp: 172.16.130.28 + ipmiPass: huawei@123 + roles: + - controller + - ha + - odl + + - name: host3 + mac: 'D8:49:0B:DA:2A:28' + ipmiIp: 172.16.130.29 + ipmiPass: Huawei@123 + roles: + - controller + - ha + - odl + + - name: host4 + mac: 'D8:49:0B:DA:5B:5D' + ipmiIp: 172.16.130.30 + ipmiPass: Huawei@123 + roles: + - compute + + - name: host5 + mac: 'D8:49:0B:DA:56:85' + ipmiIp: 172.16.130.31 + ipmiPass: Huawei@123 + roles: + - compute + diff --git a/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/os-onos-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/os-onos-nofeature-ha.yml new file mode 100644 index 00000000..88f261d7 --- /dev/null +++ b/deploy/conf/hardware_environment/huawei-us-deploy-bare-1/os-onos-nofeature-ha.yml @@ -0,0 +1,41 @@ + +TYPE: baremetal +FLAVOR: cluster +POWER_TOOL: ipmitool + +ipmiUser: root +ipmiVer: '2.0' + +hosts: + - name: host2 + mac: 'E0:24:7F:02:15:A3' + ipmiIp: 172.16.130.28 + ipmiPass: huawei@123 + roles: + - controller + - ha + - onos + + - name: host3 + mac: 'D8:49:0B:DA:2A:28' + ipmiIp: 172.16.130.29 + ipmiPass: Huawei@123 + roles: + - controller + - ha + - onos + + - name: host4 + mac: 'D8:49:0B:DA:5B:5D' + ipmiIp: 172.16.130.30 + ipmiPass: Huawei@123 + roles: + - compute + + - name: host5 + mac: 'D8:49:0B:DA:56:85' + ipmiIp: 172.16.130.31 + ipmiPass: Huawei@123 + roles: + - compute + diff --git a/deploy/conf/vm_environment/huawei-us-deploy-vm-1/network.yml b/deploy/conf/vm_environment/huawei-us-deploy-vm-1/network.yml index cc694611..7fce6381 100644 --- a/deploy/conf/vm_environment/huawei-us-deploy-vm-1/network.yml +++ b/deploy/conf/vm_environment/huawei-us-deploy-vm-1/network.yml @@ -55,10 +55,10 @@ ip_settings: - name: external ip_ranges: - - - "192.168.105.210" - - "192.168.105.220" - cidr: "192.168.105.0/24" - gw: "192.168.105.1" + - - "192.168.107.210" + - "192.168.107.220" + cidr: "192.168.107.0/24" + gw: "192.168.107.1" role: - controller - compute @@ -69,7 +69,7 @@ internal_vip: interface: mgmt public_vip: - ip: 192.168.105.222 + ip: 192.168.107.222 netmask: "24" interface: external @@ -84,7 +84,7 @@ public_net_info: router: router-ext enable_dhcp: False no_gateway: False - external_gw: "192.168.105.1" - floating_ip_cidr: "192.168.105.0/24" - floating_ip_start: "192.168.105.101" - floating_ip_end: "192.168.105.199" + external_gw: "192.168.107.1" + floating_ip_cidr: "192.168.107.0/24" + floating_ip_start: "192.168.107.101" + floating_ip_end: "192.168.107.199" diff --git a/deploy/conf/vm_environment/os-nosdn-nofeature-ha.yml b/deploy/conf/vm_environment/os-nosdn-nofeature-ha.yml new file mode 100644 index 00000000..aa2a1b3e --- /dev/null +++ b/deploy/conf/vm_environment/os-nosdn-nofeature-ha.yml @@ -0,0 +1,32 @@ +TYPE: virtual +FLAVOR: cluster + +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-odl_l2-nofeature-ha.yml b/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml new file mode 100644 index 00000000..e2ee19c6 --- /dev/null +++ b/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml @@ -0,0 +1,29 @@ +TYPE: virtual +FLAVOR: cluster + +hosts: + - name: host1 + roles: + - controller + - ha + - odl + + - name: host2 + roles: + - controller + - ha + - odl + + - name: host3 + roles: + - controller + - ha + - odl + + - name: host4 + roles: + - compute + + - name: host5 + roles: + - compute diff --git a/deploy/conf/vm_environment/os-onos-nofeature-ha.yml b/deploy/conf/vm_environment/os-onos-nofeature-ha.yml new file mode 100644 index 00000000..fcd07efc --- /dev/null +++ b/deploy/conf/vm_environment/os-onos-nofeature-ha.yml @@ -0,0 +1,29 @@ +TYPE: virtual +FLAVOR: cluster + +hosts: + - name: host1 + roles: + - controller + - ha + - onos + + - name: host2 + roles: + - controller + - ha + - onos + + - name: host3 + roles: + - controller + - ha + - onos + + - name: host4 + roles: + - compute + + - name: host5 + roles: + - compute |