Commit 10aa2ac0 authored by Pierre Kim's avatar Pierre Kim
Browse files

Edit some messages

parent 92b71140
No related merge requests found
Showing with 13 additions and 18 deletions
+13 -18
......@@ -11,12 +11,8 @@ Script syntax: move_vm.sh origin_datastore vm_name destination_datastore
## Example
[root@esxi:/vmfs/volumes/5c84813a-fed5e5c0-dbfa-d05099c274e1] ./move_vm.sh "500GB EVO" testvm RAID
#####################################
###VMWare Thin VM migration script###
#####################################
#########Author: manatails###########
#####################################
VMWare Thin VM migration script written by manatails
Version 1.0
Moving VM testvm from datastore 500GB EVO to VM testvm at datastore RAID
Creating destination directory...
Copying VMDK file...
......@@ -26,7 +22,7 @@ Script syntax: move_vm.sh origin_datastore vm_name destination_datastore
Copying extra VMDK file...
Copying other files...
Copying snapshots...
copy finished.
Delete the original VM (y/n)? y
Removing origin VM...
Copy finished.
Remove origin VM files from disk (y/n)? y
Removing origin VM files...
Migration finished.
#!/bin/sh
set -e
echo "#####################################"
echo "###VMWare Thin VM migration script###"
echo "#####################################"
echo "#########Author: manatails###########"
echo "#####################################"
VERSION="1.0"
echo "VMWare Thin VM migration script written by manatails"
echo "Version $VERSION"
print_help() {
echo "Syntax: move_vm.sh origin_datastore vm_name destination_datastore"
......@@ -13,7 +12,7 @@ print_help() {
if [ -z "$3" ]
then
echo "Insufficent arguments."
echo "Insufficent number of arguments."
print_help
exit 1
fi
......@@ -59,10 +58,10 @@ find "/vmfs/volumes/$1/$2" -maxdepth 1 -type f | grep -v ".vmdk" | while read fi
echo "Copying snapshots..."
find "/vmfs/volumes/$1/$2" -maxdepth 1 -type f | grep [0123456789][0123456789][0123456789][0123456789][0123456789][0123456789] | grep ".vmdk" | while read file; do cp "$file" "/vmfs/volumes/$3/$2"; done
echo "copy finished."
read -p "Delete the original VM (y/n)? " CONT
echo "Copy finished."
read -p "Remove origin VM files from disk (y/n)? " CONT
if [ "$CONT" = "y" ]; then
echo "Removing origin VM..."
echo "Removing origin VM files..."
rm -rf "/vmfs/volumes/$1/$2"
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment