-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of lvm and guests management
Signed-off-by: Michal Čihař <michal@cihar.com>
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |
This file contains 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
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 |
This file contains 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
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 |