Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
vmware [2008/09/26 20:13] a |
vmware [2009/01/16 13:56] cyc |
||
---|---|---|---|
Line 2: | Line 2: | ||
[[: | [[: | ||
+ | |||
===== Fixing time-management in vm-instances on VMware ===== | ===== Fixing time-management in vm-instances on VMware ===== | ||
Line 14: | Line 15: | ||
<note important> | <note important> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Backing up virtual machines on VMware Server 2.0 ===== | ||
+ | |||
+ | Because WMware' | ||
+ | |||
+ | You can create a user on a virtual machine and grant permission to shut down via sudo: | ||
+ | * '' | ||
+ | * add '' | ||
+ | * Create a script, that will shut down virtual machines, check with ping after one minute if it is really shut down and then copy VM's files from datastore to TARGET location and after finishing that, power virtual machine back on. Of course you run it on your VMware Server host - where you have the datastore. | ||
+ | |||
+ | Here is an example of the script. You will have to modify at least usernames and paths, maybe more, but it will give you an idea of how it can be done. | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | # | ||
+ | # Backup virtual machines | ||
+ | # | ||
+ | # In file / | ||
+ | # DNS records for the same names must exist too! | ||
+ | # | ||
+ | TARGET=/ | ||
+ | # | ||
+ | for VM in `cat / | ||
+ | do | ||
+ | ssh username@${VM} sudo / | ||
+ | sleep 60 | ||
+ | ping -c 2 ${VM} | ||
+ | TARGET_PATH=${TARGET}/ | ||
+ | mkdir $TARGET_PATH | ||
+ | if [ $? -eq 1 ] | ||
+ | then | ||
+ | cp / | ||
+ | / | ||
+ | else | ||
+ | echo Host $VM not shut down yet! >> / | ||
+ | fi | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ |