summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2016-03-08 16:19:04 -0500
committerDan Radez <dradez@redhat.com>2016-04-01 19:12:25 -0400
commit9a96f371f290fdf8530239a4c0df591527fe636f (patch)
tree7450d1b1e6023adf1cc82de5b3523518ce421590 /ci
parent53003f9fef6b49304f37e5fbb5d15bc4f1316948 (diff)
Migrating to Mitaka
- Only support for NOSDN for this patch - Other SDN controllers will not be tested for this patch - AODH is now upstream and not needed to be carried in Apex - puppet-cinder-quota-fix.patch is now upstream and not needed to be carried in Apex - puppet-neutron-force-metadata.patch is now upstream and not needed to be carried in Apex - removing the catalog of nic files and creating a templatization for them JIRA: APEX-108 JIRA: APEX-93 JIRA: APEX-92 Change-Id: Ic1a24baec7ef295e9dc1b8b72ac36ca5b05578ea Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/clean.sh29
-rwxr-xr-xci/deploy.sh30
2 files changed, 31 insertions, 28 deletions
diff --git a/ci/clean.sh b/ci/clean.sh
index 40ae6edd..2a91b7ce 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -11,7 +11,9 @@
#Clean script to uninstall provisioning server for Apex
#author: Dan Radez (dradez@redhat.com)
#author: Tim Rozet (trozet@redhat.com)
-CONFIG=/var/opt/opnfv
+
+# Use default if no param passed
+CONFIG=${1-"/var/opt/opnfv"}
##LIBRARIES
source $CONFIG/lib/common-functions.sh
@@ -21,31 +23,26 @@ ovs_bridges="br-admin br-private br-public br-storage"
# Clean off instack/undercloud VM
for vm in instack undercloud; do
- virsh destroy $vm 2> /dev/null || echo -n ''
- virsh undefine $vm 2> /dev/null || echo -n ''
- if ! virsh vol-delete ${vm}.qcow2 --pool default 2> /dev/null; then
- if [ ! -e /var/lib/libvirt/images/${vm}.qcow2 ]; then
- /usr/bin/touch /var/lib/libvirt/images/${vm}.qcow2
- virsh vol-delete ${vm}.qcow2 --pool default
- fi
- fi
+ virsh destroy $vm 2> /dev/null | xargs echo -n
+ virsh undefine $vm 2> /dev/null | xargs echo -n
+ /usr/bin/touch /var/lib/libvirt/images/${vm}.qcow2
+ virsh vol-delete ${vm}.qcow2 --pool default 2> /dev/null | xargs echo -n
+ rm -f /var/lib/libvirt/images/${vm}.qcow2 2> /dev/null
done
-rm -f /var/lib/libvirt/images/undercloud.qcow2 2> /dev/null
-
# Clean off baremetal VMs in case they exist
for i in $(seq 0 $vm_index); do
- virsh destroy baremetal$i 2> /dev/null || echo -n ''
- virsh undefine baremetal$i 2> /dev/null || echo -n ''
+ virsh destroy baremetal$i 2> /dev/null | xargs echo -n
+ virsh undefine baremetal$i 2> /dev/null | xargs echo -n
/usr/bin/touch /var/lib/libvirt/images/baremetal${i}.qcow2
- virsh vol-delete baremetal${i}.qcow2 --pool default 2> /dev/null
+ virsh vol-delete baremetal${i}.qcow2 --pool default 2> /dev/null | xargs echo -n
rm -f /var/lib/libvirt/images/baremetal${i}.qcow2 2> /dev/null
done
# Clean off created bridges
for bridge in ${ovs_bridges}; do
- virsh net-destroy ${bridge} 2> /dev/null
- virsh net-undefine ${bridge} 2> /dev/null
+ virsh net-destroy ${bridge} 2> /dev/null | xargs echo -n
+ virsh net-undefine ${bridge} 2> /dev/null | xargs echo -n
if detach_interface_from_ovs ${bridge} 2> /dev/null; then
ovs-vsctl del-br ${bridge} 2> /dev/null
fi
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 8aeb5f5f..9e317c8a 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -29,6 +29,7 @@ ntp_server="pool.ntp.org"
net_isolation_enabled="TRUE"
post_config="TRUE"
debug="FALSE"
+nics_cfg=''
declare -i CNT
declare UNDERCLOUD
@@ -648,7 +649,7 @@ function define_vm () {
if virsh vol-list default | grep ${1}.qcow2 2>&1> /dev/null; then
volume_path=$(virsh vol-path --pool default ${1}.qcow2 || echo "/var/lib/libvirt/images/${1}.qcow2")
echo "Volume ${1} exists. Deleting Existing Volume $volume_path"
- virsh vol-dumpxml ${1}.qcow2 --pool default
+ virsh vol-dumpxml ${1}.qcow2 --pool default > /dev/null || echo '' #ok for this to fail
touch $volume_path
virsh vol-delete ${1}.qcow2 --pool default
fi
@@ -674,9 +675,8 @@ function define_vm () {
##Set network-environment settings
##params: network-environment file to edit
function configure_network_environment {
- local tht_dir nic_ext
+ local tht_dir
tht_dir=/usr/share/openstack-tripleo-heat-templates/network
- nic_ext=''
sed -i '/ControlPlaneSubnetCidr/c\\ ControlPlaneSubnetCidr: "'${admin_network_cidr##*/}'"' $1
sed -i '/ControlPlaneDefaultRoute/c\\ ControlPlaneDefaultRoute: '${admin_network_provisioner_ip}'' $1
@@ -692,7 +692,7 @@ function configure_network_environment {
sed -i 's#^.*Compute::Ports::TenantPort:.*$# OS::TripleO::Compute::Ports::TenantPort: '${tht_dir}'/ports/tenant.yaml#' $1
sed -i "/TenantAllocationPools/c\\ TenantAllocationPools: [{'start': '${private_network_usable_ip_range%%,*}', 'end': '${private_network_usable_ip_range##*,}'}]" $1
sed -i '/TenantNetCidr/c\\ TenantNetCidr: '${private_network_cidr}'' $1
- nic_ext+=_private
+ nics_cfg+=_private
else
sed -i 's#^.*Network::Tenant.*$# OS::TripleO::Network::Tenant: '${tht_dir}'/noop.yaml#' $1
sed -i 's#^.*Controller::Ports::TenantPort:.*$# OS::TripleO::Controller::Ports::TenantPort: '${tht_dir}'/ports/noop.yaml#' $1
@@ -702,27 +702,24 @@ function configure_network_environment {
# check for storage network
if [[ ! -z "$storage_network_enabled" && "$storage_network_enabled" == "true" ]]; then
sed -i 's#^.*Network::Storage:.*$# OS::TripleO::Network::Storage: '${tht_dir}'/storage.yaml#' $1
+ sed -i 's#^.*Network::Ports::StorageVipPort:.*$# OS::TripleO::Network::Ports::StorageVipPort: '${tht_dir}'/ports/storage.yaml#' $1
sed -i 's#^.*Controller::Ports::StoragePort:.*$# OS::TripleO::Controller::Ports::StoragePort: '${tht_dir}'/ports/storage.yaml#' $1
sed -i 's#^.*Compute::Ports::StoragePort:.*$# OS::TripleO::Compute::Ports::StoragePort: '${tht_dir}'/ports/storage.yaml#' $1
sed -i "/StorageAllocationPools/c\\ StorageAllocationPools: [{'start': '${storage_network_usable_ip_range%%,*}', 'end': '${storage_network_usable_ip_range##*,}'}]" $1
sed -i '/StorageNetCidr/c\\ StorageNetCidr: '${storage_network_cidr}'' $1
- nic_ext+=_storage
+ nics_cfg+=_storage
else
sed -i 's#^.*Network::Storage:.*$# OS::TripleO::Network::Storage: '${tht_dir}'/noop.yaml#' $1
+ sed -i 's#^.*Network::Ports::StorageVipPort:.*$# OS::TripleO::Network::Ports::StorageVipPort: '${tht_dir}'/ports/noop.yaml#' $1
sed -i 's#^.*Controller::Ports::StoragePort:.*$# OS::TripleO::Controller::Ports::StoragePort: '${tht_dir}'/ports/noop.yaml#' $1
sed -i 's#^.*Compute::Ports::StoragePort:.*$# OS::TripleO::Compute::Ports::StoragePort: '${tht_dir}'/ports/noop.yaml#' $1
fi
- sed -i 's#^.*Controller::Net::SoftwareConfig:.*$# OS::TripleO::Controller::Net::SoftwareConfig: nics/controller'${nic_ext}'.yaml#' $1
-
# check for ODL L3
if [ "${deploy_options_array['sdn_l3']}" == 'true' ]; then
- nic_ext+=_br-ex_no-public-ip
+ nics_cfg+=_br-ex_no-public-ip
fi
- # set nics appropriately
- sed -i 's#^.*Compute::Net::SoftwareConfig:.*$# OS::TripleO::Compute::Net::SoftwareConfig: nics/compute'${nic_ext}'.yaml#' $1
-
}
##Copy over the glance images and instackenv json file
##params: none
@@ -735,8 +732,16 @@ function configure_undercloud {
echo -e "${blue}Network Environment set for Deployment: ${reset}"
cat $CONFIG/network-environment.yaml
scp ${SSH_OPTIONS[@]} $CONFIG/network-environment.yaml "stack@$UNDERCLOUD":
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI
+mkdir nics/
+cat > nics/controller.yaml << EOF
+$(nics_cfg=$nics_cfg sh $CONFIG/nics-controller.yaml.template)
+EOF
+cat > nics/compute.yaml << EOF
+$(nics_cfg=$nics_cfg sh $CONFIG/nics-compute.yaml.template)
+EOF
+EOI
fi
- scp ${SSH_OPTIONS[@]} -r $CONFIG/nics/ "stack@$UNDERCLOUD":
# ensure stack user on Undercloud machine has an ssh key
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "if [ ! -e ~/.ssh/id_rsa.pub ]; then ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa; fi"
@@ -878,6 +883,7 @@ function undercloud_prep_overcloud_deploy {
fi
echo "Copying overcloud image to Undercloud"
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f overcloud-full.qcow2"
scp ${SSH_OPTIONS[@]} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2
# make sure ceph is installed