Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
vmware [2008/04/19 00:56] a created |
vmware [2009/12/14 23:39] (current) 193.164.137.40 |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== VMware tips ====== | ====== VMware tips ====== | ||
- | [[: | ||
+ | ===== Fixing time-management in vm-instances on VMware ===== | ||
+ | |||
+ | Install the VMware tools in the guest os, then in the .vmx-file set the following parameters to TRUE: | ||
+ | |||
+ | * **tools.syncTime** - sync periodically | ||
+ | * **time.synchronize.continue** - sync after snapshot | ||
+ | * **time.synchronize.restore** - sync after reverting to a snapshot | ||
+ | * **time.synchronize.resume.disk** - sync after resume | ||
+ | * **time.synchronize.shrink** - sync after defragmenting a virtual disk | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | |||
+ | |||
+ | ===== Converting ' | ||
+ | |||
+ | example: | ||
+ | $ cd / | ||
+ | $ for i in `ls *[0-9].vmdk`; | ||
+ | $ cat *.raw >> guestos.img | ||
+ | |||
+ | ===== Migration with vmware-vdiskmanager (from vmware to KVM) ===== | ||
+ | **vmware files** | ||
+ | < | ||
+ | $ ls | ||
+ | nvram | ||
+ | opt-zimbra-s001.vmdk | ||
+ | opt-zimbra-s002.vmdk | ||
+ | opt-zimbra-s003.vmdk | ||
+ | opt-zimbra-s004.vmdk | ||
+ | opt-zimbra-s005.vmdk | ||
+ | opt-zimbra-s006.vmdk | ||
+ | opt-zimbra-s007.vmdk | ||
+ | opt-zimbra-s008.vmdk | ||
+ | </ | ||
+ | |||
+ | creating a temp disk and convert allocated - non-parted VMware disks | ||
+ | |||
+ | $ mkdir haha | ||
+ | $ vmware-vdiskmanager -r Zimbra-Training-VM.vmdk -t 2 haha/ | ||
+ | $ vmware-vdiskmanager -r opt-zimbra.vmdk -t 2 haha/ | ||
+ | |||
+ | and get | ||
+ | |||
+ | $ ls haha/ | ||
+ | | ||
+ | |||
+ | Converting .. | ||
+ | |||
+ | $ qemu-img convert -c -O qcow2 haha/ | ||
+ | $ qemu-img convert -c -O qcow2 haha/ | ||
+ | |||
+ | after sucessful run under KVM (uinstall vmware-tools) | ||
+ | |||
+ | # vmware-uninstall-tools.pl | ||
+ | # reboot | ||
+ | |||
+ | ===== 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|f backup.sh> | ||
+ | #!/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 | ||
+ | </ | ||
+ | |||
+ | '' | ||