Skip to content

Commit

Permalink
Initial version of lvm and guests management
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Dec 18, 2013
1 parent b411189 commit ca073bc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions demo/maintenance/make-snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# Script to make a LVM snapshot of a demo server

if [ -z "$1" ] ; then
echo "Usage: make-snapshot NAME"
exit 1
fi

lvcreate -s -n demo-$1-snapshot -L 4G /dev/mapper/pma-demo--$1
13 changes: 13 additions & 0 deletions demo/maintenance/reset-demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# Script to reset demo virtual machine to snapshot

if [ -z "$1" ] ; then
echo "Usage: reset-demo NAME"
exit 1
fi

virsh destroy demo-$1
sleep 5
./restore-snapshot $1
./make-snapshot $1
virsh start demo-$1
9 changes: 9 additions & 0 deletions demo/maintenance/restore-snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# Script to merge LVM snapshot into original volume

if [ -z "$1" ] ; then
echo "Usage: restore-snapshot NAME"
exit 1
fi

lvconvert --merge /dev/mapper/pma-demo--$1--snapshot

0 comments on commit ca073bc

Please sign in to comment.