Last active
June 15, 2018 15:19
-
-
Save odyssey4me/a3e5cfccdec4f69bdb99919573f2120d to your computer and use it in GitHub Desktop.
MNAIO snapshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update && \ | |
apt-get purge -y nano && \ | |
apt-get install -y git vim tmux fail2ban | |
echo 'set-option -g history-limit 9999' > ~/.tmux.conf | |
tmux new -s odyssey4me | |
cd /opt | |
git clone https://github.com/openstack/openstack-ansible-ops.git | |
cd openstack-ansible-ops/multi-node-aio | |
# configure git | |
# add the UCA queens patch for an upgraded libvirt | |
git fetch https://git.openstack.org/openstack/openstack-ansible-ops refs/changes/57/575757/3 && git cherry-pick FETCH_HEAD | |
./bootstrap.sh | |
source ansible-env.rc | |
ansible-playbook -i playbooks/inventory -e default_vm_disk_mode='file' playbooks/setup-host.yml | |
ansible-playbook -i playbooks/inventory playbooks/deploy-acng.yml playbooks/deploy-pxe.yml playbooks/deploy-dhcp.yml | |
ansible-playbook -i playbooks/inventory -e default_vm_disk_mode='file' playbooks/deploy-vms.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update && \ | |
apt-get purge -y nano && \ | |
apt-get install -y git vim tmux fail2ban | |
echo 'set-option -g history-limit 9999' > ~/.tmux.conf | |
tmux new -s odyssey4me | |
# ensure we get access to libvirt v4 (same as bionic) | |
add-apt-repository cloud-archive:queens | |
cd /opt | |
git clone https://github.com/rcbops/rpc-openstack.git | |
cd rpc-openstack | |
export RE_JOB_NAME="PM_rpc-openstack-xenial_mnaio_no_artifacts-swift-deploy" | |
export RE_JOB_IMAGE="xenial_mnaio_no_artifacts" | |
export RE_JOB_FLAVOR="onmetal-io2" | |
./gating/check/run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TIMESTAMP=`date +%s` | |
SNAPSHOT_NAME=$TIMESTAMP | |
VM_FOLDER="/opt" | |
for DOMAIN in $(virsh list --name); do | |
SNAPSHOT_FOLDER="${VM_FOLDER}/snapshots/${TIMESTAMP}/${DOMAIN}" | |
mkdir -p ${SNAPSHOT_FOLDER} | |
MEM_FILE="${SNAPSHOT_FOLDER}/mem.qcow2" | |
DISK_FILE="${SNAPSHOT_FOLDER}/disk.qcow2" | |
# Find out if running or not | |
STATE=`virsh dominfo ${DOMAIN} | grep "State" | cut -d " " -f 11` | |
if [ "${STATE}" = "running" ]; then | |
virsh snapshot-create-as \ | |
--domain ${DOMAIN} ${SNAPSHOT_NAME} \ | |
--diskspec vda,file=${DISK_FILE},snapshot=external \ | |
--memspec file=${MEM_FILE},snapshot=external \ | |
--atomic | |
else | |
virsh snapshot-create-as \ | |
--domain ${DOMAIN} ${SNAPSHOT_NAME} \ | |
--diskspec vda,file=${DISK_FILE},snapshot=external \ | |
--disk-only \ | |
--atomic | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VM_FOLDER="/opt" | |
for DOMAIN in $(virsh list --name); do | |
virsh snapshot-list \ | |
--domain ${DOMAIN} | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VM_FOLDER="/opt" | |
SNAPSHOT_FOLDER="${VM_FOLDER}/snapshots" | |
if [ $(ls -1 "${SNAPSHOT_FOLDER}" | wc -l) -gt 1 ]; then | |
echo "More than one snapshot exists." | |
exit 1 | |
fi | |
SNAPSHOT_NAME="$(ls -1 ${SNAPSHOT_FOLDER})" | |
for DOMAIN in $(virsh list --name); do | |
virsh snapshot-revert \ | |
--domain ${DOMAIN} \ | |
--snapshotname ${SNAPSHOT_NAME} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment