Skip to content
Snippets Groups Projects
Commit fe8da389 authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

Detach and Remove Staging Volumes

This commit optimizes the process of detaching and removing staging volumes from the staging instance. It replaces the previous approach of using a single staging volume with a new approach that involves two distinct volumes. 
parent 69294b12
No related branches found
No related tags found
3 merge requests!47Integration Testing: Sequential Merge and Validation of Four Feature Branches (PR #43,#44, #45,#46),!43feat: Add new data volume for XDMod queue data,!34feat: Add new data volume for XDMod queue data
Pipeline #9061 failed with stages
in 33 seconds
......@@ -158,6 +158,24 @@ production-deploy:
- ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$staging_floating_ip sudo umount /var/lib/mysql && df -h
- openstack server remove volume $instance_id $staging_volume
# Exporting Staging Volume IDs
- export staging_volume1=$(openstack server show $instance_id -c volumes_attached -f value | awk -F"'" '{print $4}' | awk 'NR==1')
- export staging_volume2=$(openstack server show $instance_id -c volumes_attached -f value | awk -F"'" '{print $4}' | awk 'NR==2')
# Logging Information
- echo "Detaching staging_volume1_id=${staging_volume1} and staging_volume2_id=${staging_volume2} from staging_instance_id=${instance_id}"
# Stopping MariaDB Service on Staging Instance
- ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$staging_floating_ip sudo systemctl stop mariadb
# Unmounting MySQL Data Directories
- ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$staging_floating_ip sudo umount /var/lib/mysql1 && df -h
- ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$staging_floating_ip sudo umount /data/xdmod/queues && df -h
# Removing Volumes from Server
- openstack server remove volume $instance_id $staging_volume1
- openstack server remove volume $instance_id $staging_volume2
- echo "Attach prod volume $xdmod-prod-vol-$BUILD_DATE to staging instance $instance_id"
- openstack volume snapshot create --volume $prod_volume xdmod-prod-data-vol-snapshot-$BUILD_DATE
- openstack volume create --snapshot xdmod-prod-data-vol-snapshot-$BUILD_DATE --size 150 xdmod-prod-vol-$BUILD_DATE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment