summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml2
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml2
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml6
-rw-r--r--deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh1
-rw-r--r--deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_config.yml2
-rw-r--r--deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml4
-rw-r--r--deploy/adapters/ansible/roles/cinder-controller/tasks/main.yml1
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf2
-rw-r--r--deploy/adapters/ansible/roles/glance/tasks/main.yml2
-rw-r--r--deploy/adapters/ansible/roles/neutron-controller/tasks/main.yml1
-rw-r--r--deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_config.yml2
-rw-r--r--deploy/adapters/ansible/roles/nova-controller/tasks/main.yml1
-rw-r--r--deploy/compass_vm.sh4
-rw-r--r--deploy/conf/base.conf2
-rw-r--r--deploy/host_virtual.sh6
-rwxr-xr-xdeploy/network.sh173
-rw-r--r--deploy/template/network/bridge_nic.xml6
-rw-r--r--deploy/template/vm/compass.xml8
-rw-r--r--deploy/template/vm/host.xml8
19 files changed, 66 insertions, 167 deletions
diff --git a/deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml b/deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml
index 4fddd1e6..cb78acb6 100644
--- a/deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml
@@ -3,7 +3,7 @@
- name: install ceilometer packages
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: "{{ ceilometer_packages }}| union(packages_noarch)"
+ with_items: ceilometer_packages | union(packages_noarch)
- name: copy ceilometer configs
template: src={{ item.src}} dest=/opt/os_templates
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml
index 4fddd1e6..cb78acb6 100644
--- a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml
@@ -3,7 +3,7 @@
- name: install ceilometer packages
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: "{{ ceilometer_packages }}| union(packages_noarch)"
+ with_items: ceilometer_packages | union(packages_noarch)
- name: copy ceilometer configs
template: src={{ item.src}} dest=/opt/os_templates
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml b/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
index 8317a3eb..9aeacfa7 100644
--- a/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
@@ -18,9 +18,11 @@ ceilometer_services:
ceilometer_configs_templates:
- src: ceilometer.j2
- dest: /etc/ceilometer/ceilometer.conf
+ dest:
+ - /etc/ceilometer/ceilometer.conf
- src: cinder.j2
- dest: /etc/cinder/cinder.conf
+ dest:
+ - /etc/cinder/cinder.conf
- src: glance.j2
dest:
- /etc/glance/glance-api.conf
diff --git a/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh b/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh
index f2a40663..02860bde 100644
--- a/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh
+++ b/deploy/adapters/ansible/roles/ceph-deploy/files/create_osd.sh
@@ -30,7 +30,6 @@ vgremove -f ceph-volumes
rm -r /dev/ceph-volumes
fi
-losetup -d /dev/loop0
echo "vgcreate"
vgcreate -y ceph-volumes $(losetup --show -f /ceph/images/ceph-volumes.img)
diff --git a/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_config.yml b/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_config.yml
index 5bce443c..69850846 100644
--- a/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_config.yml
+++ b/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_config.yml
@@ -6,5 +6,3 @@
cinder_manage: action=dbsync
notify:
- restart cinder control serveice
-
-- meta: flush_handlers
diff --git a/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml b/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml
index 24981e9c..686ce1f5 100644
--- a/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml
+++ b/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml
@@ -7,3 +7,7 @@
shell: echo {{ item }} >> /opt/service
with_items: services | union(services_noarch)
+- name: upload cinder conf
+ template: src=cinder.conf dest=/etc/cinder/cinder.conf
+ notify:
+ - restart cinder control serveice
diff --git a/deploy/adapters/ansible/roles/cinder-controller/tasks/main.yml b/deploy/adapters/ansible/roles/cinder-controller/tasks/main.yml
index e6a5f04f..5491dcf0 100644
--- a/deploy/adapters/ansible/roles/cinder-controller/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/cinder-controller/tasks/main.yml
@@ -8,6 +8,7 @@
- cinder
- include: cinder_config.yml
+ when: inventory_hostname == groups['controller'][0]
tags:
- config
- cinder-config
diff --git a/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf b/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf
index 86422e93..0b855da5 100644
--- a/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf
+++ b/deploy/adapters/ansible/roles/cinder-volume/templates/cinder.conf
@@ -7,7 +7,7 @@ volume_group = cinder-volumes
verbose = True
auth_strategy = keystone
state_path = /var/lib/cinder
-lock_path = /var/lock/cinder
+lock_path = /var/lib/cinder/tmp
notification_driver=cinder.openstack.common.notifier.rpc_notifier
volumes_dir = /var/lib/cinder/volumes
diff --git a/deploy/adapters/ansible/roles/glance/tasks/main.yml b/deploy/adapters/ansible/roles/glance/tasks/main.yml
index 7cbcfa96..f5ec3c79 100644
--- a/deploy/adapters/ansible/roles/glance/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/glance/tasks/main.yml
@@ -12,7 +12,7 @@
- nfs
- include: glance_config.yml
- run_once: True
+ when: inventory_hostname == groups['controller'][0]
tags:
- config
- glance_config
diff --git a/deploy/adapters/ansible/roles/neutron-controller/tasks/main.yml b/deploy/adapters/ansible/roles/neutron-controller/tasks/main.yml
index 5b3640d7..5825c5fe 100644
--- a/deploy/adapters/ansible/roles/neutron-controller/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/neutron-controller/tasks/main.yml
@@ -6,6 +6,7 @@
- neutron
- include: neutron_config.yml
+ when: inventory_hostname == groups['controller'][0]
tags:
- config
- neutron_config
diff --git a/deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_config.yml b/deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_config.yml
index 26758f58..3912752b 100644
--- a/deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_config.yml
+++ b/deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_config.yml
@@ -11,10 +11,8 @@
- name: restart first neutron-server
service: name=neutron-server state=restarted enabled=yes
- when: inventory_hostname == groups['controller'][0]
- name: restart other neutron-server
service: name=neutron-server state=restarted enabled=yes
- when: inventory_hostname != groups['controller'][0]
- meta: flush_handlers
diff --git a/deploy/adapters/ansible/roles/nova-controller/tasks/main.yml b/deploy/adapters/ansible/roles/nova-controller/tasks/main.yml
index de2563d7..da820c35 100644
--- a/deploy/adapters/ansible/roles/nova-controller/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/nova-controller/tasks/main.yml
@@ -6,6 +6,7 @@
- nova
- include: nova_config.yml
+ when: inventory_hostname == groups['controller'][0]
tags:
- config
- nova_config
diff --git a/deploy/compass_vm.sh b/deploy/compass_vm.sh
index 944c6cff..9e192281 100644
--- a/deploy/compass_vm.sh
+++ b/deploy/compass_vm.sh
@@ -100,8 +100,8 @@ function launch_compass() {
-e "s#REPLACE_IMAGE#$compass_vm_dir/disk.img#g" \
-e "s#REPLACE_ISO#$compass_vm_dir/centos.iso#g" \
-e "s/REPLACE_NET_MGMT/mgmt/g" \
- -e "s/REPLACE_BRIDGE_INSTALL/br_install/g" \
- -e "s/REPLACE_BRIDGE_EXTERNAL/br_external/g" \
+ -e "s/REPLACE_NET_INSTALL/install/g" \
+ -e "s/REPLACE_NET_EXTERNAL/external/g" \
$COMPASS_DIR/deploy/template/vm/compass.xml \
> $WORK_DIR/vm/compass/libvirt.xml
diff --git a/deploy/conf/base.conf b/deploy/conf/base.conf
index c48aca64..d3d535dc 100644
--- a/deploy/conf/base.conf
+++ b/deploy/conf/base.conf
@@ -9,7 +9,7 @@ export MGMT_MASK=${MAGMT_MASK:-255.255.252.0}
export MGMT_GW=${MAGMT_GW:-192.168.200.1}
export MGMT_IP_START=${MGMT_IP_START:-192.168.200.3}
export MGMT_IP_END=${MGMT_IP_END:-192.168.200.254}
-export EXTERNAL_NIC=${EXTERNAL_NIC:-eth3}
+export EXTERNAL_NIC=${EXTERNAL_NIC:-eth0}
export CLUSTER_NAME="opnfv2"
export DOMAIN="ods.com"
export PARTITIONS="/=70%,/home=5%,/tmp=5%,/var=20%"
diff --git a/deploy/host_virtual.sh b/deploy/host_virtual.sh
index 35ab4352..d769010b 100644
--- a/deploy/host_virtual.sh
+++ b/deploy/host_virtual.sh
@@ -30,10 +30,8 @@ function launch_host_vms() {
-e "s/REPLACE_NAME/$host/g" \
-e "s#REPLACE_IMAGE#$vm_dir/disk.img#g" \
-e "s/REPLACE_BOOT_MAC/${mac_array[i]}/g" \
- -e "s/REPLACE_BRIDGE_MGMT/br_install/g" \
- -e "s/REPLACE_BRIDGE_TENANT/br_external/g" \
- -e "s/REPLACE_BRIDGE_PUBLIC/br_install/g" \
- -e "s/REPLACE_BRIDGE_STORAGE/br_install/g" \
+ -e "s/REPLACE_NET_INSTALL/install/g" \
+ -e "s/REPLACE_NET_TENANT/external/g" \
$COMPASS_DIR/deploy/template/vm/host.xml\
> $vm_dir/libvirt.xml
diff --git a/deploy/network.sh b/deploy/network.sh
index e5133c9e..ac0a73e2 100755
--- a/deploy/network.sh
+++ b/deploy/network.sh
@@ -1,163 +1,54 @@
-function destroy_nat() {
- sudo virsh net-destroy $1 2>&1
- sudo virsh net-undefine $1 2>&1
- rm -rf $COMPASS_DIR/deploy/work/network/$1.xml
-}
-
-function destroy_bridge()
-{
- bridge=$1
- nic=$2
- ip="$3"
-
- brige_info=$(ip addr show $bridge 2>/dev/null)
- if [[ -z $brige_info ]]; then
- return
- fi
-
- if [[ -n $ip ]]; then
- ip addr delete $ip dev $bridge | true
- fi
-
- ips=`echo "$brige_info" | grep 'inet ' | sed "s/inet //g"`
-
- routes=$(ip route show | grep $bridge)
-
- ip link set $bridge down
-
- brctl delbr $bridge
-
- if [[ -n $ips ]]; then
- echo "$ips" | while read line; do
- echo $line | sed "s/$bridge/dev $nic/g" | xargs ip addr add | true
- done
- fi
-
- if [[ -n $routes ]]; then
- echo "$routes" | while read line; do
- echo $line | sed "s/$bridge/$nic/g" | xargs ip route add | true
- done
- fi
-}
-
-function get_broadcast_addr()
-{
- ip=(${1//[!0-9]/ })
- mask=(${2//[!0-9]/ })
-
- for i in {0..3}; do
- num=$((${ip[$i]} | $((${mask[$i]} ^ 255))))
- if [[ -z $broadcast ]]; then
- broadcast="$num"
- else
- broadcast="$broadcast.$num"
- fi
- done
- echo ${broadcast}
-}
-function get_mask_len()
+function setup_bridge_net()
{
- mask=`echo $1 | awk -F'.' '{print ($1*(2^24)+$2*(2^16)+$3*(2^8)+$4)}'`
- mask_len=`echo "obase=2;${mask}"|bc|awk -F'0' '{print length($1)}'`
- echo $mask_len
-}
-
-function create_bridge()
-{
- bridge=$1
+ net_name=$1
nic=$2
- ips=$(ip addr show $nic | grep 'inet ' | sed "s/inet //g")
- routes=$(ip route show | grep $nic)
- ip addr flush $nic
-
- brctl addbr $bridge
- brctl addif $bridge $nic
- ip link set $bridge up
-
- if [[ -n $ips ]]; then
- echo "$ips" | while read line; do
- echo $line | sed -e "s/$nic/dev $bridge/g" | xargs ip addr add
- done
- fi
+ sudo virsh net-destroy $net_name
+ sudo virsh net-undefine $net_name
+ sed -e "s/REPLACE_NAME/$net_name/g" \
+ -e "s/REPLACE_NIC/$nic/g" \
+ $COMPASS_DIR/deploy/template/network/bridge_nic.xml \
+ > $WORK_DIR/network/$net_name.xml
- if [[ -n $routes ]]; then
- echo "$routes" | while read line; do
- echo $line | sed "s/$nic/$bridge/g" | xargs ip route add | true
- done
- fi
+ sudo virsh net-define $WORK_DIR/network/$net_name.xml
+ sudo virsh net-start $net_name
}
-function add_install_ip() {
- mask_len=`get_mask_len $INSTALL_MASK`
- broadcast=`get_broadcast_addr $INSTALL_GW $INSTALL_MASK`
- ip addr add $INSTALL_GW/$mask_len brd $broadcast dev $bridge
-}
+function setup_nat_net() {
+ net_name=$1
+ gw=$2
+ mask=$3
+ ip_start=$4
+ ip_end=$5
-function setup_install_bridge() {
- destroy_bridge br_install $INSTALL_NIC $INSTALL_GW
- create_bridge br_install $INSTALL_NIC
- add_install_ip
-}
-
-function setup_external_net() {
- if [[ -z `brctl show br_external 2>/dev/null` ]]; then
- brctl addbr br_external
- fi
-
- if [[ -z $EXTERNAL_NIC ]]; then
- return
- fi
-
- if [[ $TYPE == baremetal && $EXTERNAL_NIC == $INSTALL_NIC ]]; then
- exit 1
- fi
-
- destroy_bridge br_external $EXTERNAL_NIC ""
- create_bridge br_external $EXTERNAL_NIC
-}
-
-function setup_install_nat() {
- destroy_nat install
+ sudo virsh net-destroy $net_name
+ sudo virsh net-undefine $net_name
# create install network
- sed -e "s/REPLACE_BRIDGE/br_install/g" \
- -e "s/REPLACE_NAME/install/g" \
- -e "s/REPLACE_GATEWAY/$INSTALL_GW/g" \
- -e "s/REPLACE_MASK/$INSTALL_MASK/g" \
- -e "s/REPLACE_START/$INSTALL_IP_START/g" \
- -e "s/REPLACE_END/$INSTALL_IP_END/g" \
+ sed -e "s/REPLACE_BRIDGE/br_$net_name/g" \
+ -e "s/REPLACE_NAME/$net_name/g" \
+ -e "s/REPLACE_GATEWAY/$gw/g" \
+ -e "s/REPLACE_MASK/$mask/g" \
+ -e "s/REPLACE_START/$ip_start/g" \
+ -e "s/REPLACE_END/$ip_end/g" \
$COMPASS_DIR/deploy/template/network/nat.xml \
- > $WORK_DIR/network/install.xml
+ > $WORK_DIR/network/$net_name.xml
- sudo virsh net-define $WORK_DIR/network/install.xml
- sudo virsh net-start install
+ sudo virsh net-define $WORK_DIR/network/$net_name.xml
+ sudo virsh net-start $net_name
}
function create_nets() {
- destroy_nat mgmt
- # create mgmt network
- sed -e "s/REPLACE_BRIDGE/br_mgmt/g" \
- -e "s/REPLACE_NAME/mgmt/g" \
- -e "s/REPLACE_GATEWAY/$MGMT_GW/g" \
- -e "s/REPLACE_MASK/$MGMT_MASK/g" \
- -e "s/REPLACE_START/$MGMT_IP_START/g" \
- -e "s/REPLACE_END/$MGMT_IP_END/g" \
- $COMPASS_DIR/deploy/template/network/nat.xml \
- > $WORK_DIR/network/mgmt.xml
-
- sudo virsh net-define $WORK_DIR/network/mgmt.xml
- sudo virsh net-start mgmt
+ setup_nat_net mgmt $MGMT_GW $MGMT_MASK $MGMT_IP_START $MGMT_IP_END
# create install network
- if [[ ! -z $VIRT_NUMBER ]];then
- setup_install_nat
+ if [[ -n $INSTALL_NIC ]]; then
+ setup_bridge_net install $INSTALL_NIC
else
- setup_install_bridge
+ setup_nat_net install $INSTALL_GW $INSTALL_MASK
fi
# create external network
- setup_external_net
+ setup_bridge_net external $EXTERNAL_NIC
}
-
diff --git a/deploy/template/network/bridge_nic.xml b/deploy/template/network/bridge_nic.xml
new file mode 100644
index 00000000..055845fb
--- /dev/null
+++ b/deploy/template/network/bridge_nic.xml
@@ -0,0 +1,6 @@
+<network>
+<name>REPLACE_NAME</name>
+<forward mode="bridge">
+ <interface dev="REPLACE_NIC"/>
+</forward>
+</network>
diff --git a/deploy/template/vm/compass.xml b/deploy/template/vm/compass.xml
index 453e728d..182232f4 100644
--- a/deploy/template/vm/compass.xml
+++ b/deploy/template/vm/compass.xml
@@ -41,13 +41,13 @@
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
- <interface type='bridge'>
- <source bridge='REPLACE_BRIDGE_INSTALL'/>
+ <interface type='network'>
+ <source network='REPLACE_NET_INSTALL'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</interface>
- <interface type='bridge'>
- <source bridge='REPLACE_BRIDGE_EXTERNAL'/>
+ <interface type='network'>
+ <source network='REPLACE_NET_EXTERNAL'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</interface>
diff --git a/deploy/template/vm/host.xml b/deploy/template/vm/host.xml
index 11b29f0c..e6eca551 100644
--- a/deploy/template/vm/host.xml
+++ b/deploy/template/vm/host.xml
@@ -25,14 +25,14 @@
<source file='REPLACE_IMAGE'/>
<target dev='vda' bus='virtio'/>
</disk>
- <interface type='bridge'>
+ <interface type='network'>
<mac address=REPLACE_BOOT_MAC/>
- <source bridge='REPLACE_BRIDGE_MGMT'/>
+ <source network='REPLACE_NET_INSTALL'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</interface>
- <interface type='bridge'>
- <source bridge='REPLACE_BRIDGE_TENANT'/>
+ <interface type='network'>
+ <source network='REPLACE_NET_TENANT'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>