Yet another VM blog http://www.vmprofessional.com/
Archive for November, 2007
VM Professional
Friday, November 30th, 2007Quiesce your live VMware VMs before you snapshot them
Wednesday, November 28th, 2007Make sure you quiesce any services such as Oracle 10g DB in your VMware VMs before you snap them:
- Install VMware Tools in your VM
- Create /usr/sbin/pre-freeze-script
- Create /usr/sbin/post-thaw-script
Use vcbMounter to snapshot your live VMware VM which will call /usr/sbin/pre-freeze-script just BEFORE creating the snap and /usr/sbin/post-thaw-script approx 1 second AFTER the delta/diff/redo file has been created BUT before the original VMDK has been been exported via vmkfstools.
# cat /usr/sbin/pre-freeze-script
#!/bin/sh
#####################################
# DO NOT modify this file directly as it will be overwritten the next
# time the VMware Tools are installed.
#####################################
echo frez$(date) >> /var/log/snap
# cat /usr/sbin/post-thaw-script
#!/bin/sh
#####################################
# DO NOT modify this file directly as it will be overwritten the next
# time the VMware Tools are installed.
#####################################
echo thaw$(date) >> /var/log/snap
# tail /var/log/snap
frezWed Nov 28 11:26:20 GMT 2007
thawWed Nov 28 11:26:21 GMT 2007
VMware Tools guest VM freeze & thaw scripts for VCB
Wednesday, November 28th, 2007To get the most out of your VMs and backup and restore them in the most reliable way you must install VMware tools in your guests.
As well as providing better mouse & video drivers it provides an API to the host providing IP, clock information and installs VM startup, VM shutdown, VM freeze & VM thaw scripts /usr/sbin/pre-freeze-script and /usr/bin/post-thaw-script.
Mirror two VMware ESX servers using just NFS and vcb utils
Tuesday, November 27th, 2007Setup NFS
Setup SSH RSA login
Setup mailx
Setup host,username,password in /etc/vmware/backuptools.conf
Create vcbBack, vcbRest and vcbCron
Create cronjob
Sit back and relax
backup-vms-between-two-vmware-esx-servers-using-just-nfs-ssh-and-vcb-utilities
VMware ESX 3 vcbRestore quick restore
Monday, November 26th, 2007After backing up a VMWESX VM with vcbMounter you can use vcbRestore to perform a quick restore on another ESX server
Edit the catalog file
- change SOURCE hostname to DEST hostname
- check the same “resource pool” exists on DEST host (if not change it so it does)
for example
- host=myserver.mydomain
- resourcepool= “/ha-folder-root/ha-datacenter/host/myserver.mydomain/Resources”
VMware ESX 3 snapshots
Monday, November 26th, 2007Here’s a CentOS 4 VM with 4 snapshots, in each snapshot I added a 40M file and in two of the snapshots i snapped the memeory as well.
Note a memory snapshot file is ALWAYS created if it doesn’t contain anything !
The .VMSD contains a snapshot definition !

-rw——-   1 root    root        8.0G Nov 26 17:26 cent4-flat.vmdk
-rw——-   1 root    root         334 Nov 21 12:39 cent4.vmdk
-rw——-   1 root    root        1.4K Nov 26 17:31 cent4.vmsd
-rw——-   1 root    root         48M Nov 26 17:28 cent4-000001-delta.vmdk
-rw——-   1 root    root         219 Nov 26 17:27 cent4-000001.vmdk
-rw——-   1 root    root         18K Nov 26 17:27 cent4-Snapshot1.vmsn
-rw——-   1 root    root         48M Nov 26 17:29 cent4-000002-delta.vmdk
-rw——-   1 root    root         226 Nov 26 17:28 cent4-000002.vmdk
-rw——-   1 root    root        257M Nov 26 17:28 cent4-Snapshot2.vmsn
-rw——-   1 root    root         48M Nov 26 17:31 cent4-000003-delta.vmdk
-rw——-   1 root    root         226 Nov 26 17:29 cent4-000003.vmdk
-rw——-   1 root    root        257M Nov 26 17:29 cent4-Snapshot3.vmsn
-rw——-   1 root    root         16M Nov 26 17:31 cent4-000004-delta.vmdk
-rw——-   1 root    root         226 Nov 26 17:31 cent4-000004.vmdk
-rw——-   1 root    root         18K Nov 26 17:31 cent4-Snapshot4.vmsn
VMware ESX 2 v VMware ESX 3 live VM backups
Monday, November 26th, 2007Basically during the VMware ESX two phase live backup process
ESX 2 uses .redo and .redo.redo “redo files” while
ESX 3 uses -0001-delta.vmdk and -0002-delta.vmdk “snapshots”
In VMWESX 2 .redo and .redo.redo are used for live backups
Running
var.vmdk
Backup started
var.redo
var.vmdk
Backup completed (applying redo)
var.redo.redo
var.redo
var.vmdk
In VMWESX 3 snapshots -000001-delta.vmdk and -000002-delta.vmdk are used
Running VM
var-flat.vmdk
var.vmbk
Backup started
var-000001-delta.vmdk
var-000001.vmdk
Backup completed (applying, commiting, delete all, removing snapshots)
var-000002-delta.vmdk
var-000002.vmdk
var-000001-delta.vmdk
var-000001.vmdk
var-flat.vmdk
var.vmdk
VMware ESX 3i is not the same as VMware ESX 3
Monday, November 26th, 2007VMW ESX 3i is “functionally equivalent but the servers “local” service console has been removed. VMW ESX 3i uses only 32M so it can even be embedded in the hosts firmware.Since you can no longer login locally you must administer it remotely by using VMWVC, VMWVIC, remote command line or an agent that uses VIMAPI or CIM.
For example
- esxcfg-* is replaced by vicfg-*
- esxtop is replaced by resxtop