VMware Cloud Community
Backdoor32
Contributor
Contributor

ghettovcb.sh & ghettovcb-restore.sh

hi,

I have to backup some VMs and I try to use ghetto script for that. I have ESXi4

The ghettoVCB.sh script backup the VM (wiki01.vmx wiki01-flat.vmk wiki01.vmdk). It seem to be correct...

The ghetto-restore.sh script restore the VM on the server and it seem to be correcte to.

After that i tried to poweron my restored VM and it doesn't work correctly.

  • the VM is blocked

  • i have to say "i copied the VM"

  • the VM power on but it is in readonly mode

  • a lot off services can't switch on

can you help me?

thanks

0 Kudos
12 Replies
Backdoor32
Contributor
Contributor

Hi

I tried again... And i found the problem... My file system is read only...

is it an error in my ghettovcb-restore.sh configuration?

  • ./ghettovcb-restore.sh -c retoreVM -l log_retore

  • retoreVM:

"/backup/san/monthly/0;/vmfs/volumes/Storage2RAID;1"

  • is thre a mistake (i saw most people use : in the path)

0 Kudos
lamw
Community Manager
Community Manager

Nope, the syntax is correct and if you're able to properly register the VM and bring it up then the restore was okay. Again, this is assuming the backup was okay which I've not had anyone mention issues with. There might have been something wrong with the OS that caused it to go into read-only mode. Have you tried to cleanly shutdown the OS and tried to boot it backup? You may also want to do a fsck on the disk when the OS boots up.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

Backdoor32
Contributor
Contributor

Thanks for your help

i think that my backup is clean...

i use ghettoVBC.sh

  • i mount a smb disk

  • run the ghettovcb.sh script

  • delete the vm on my vmware server

  • run ghettovcb-restore.sh

I have 3 files

  • wiki01-0-flat.vmdk wiki01-0.vmdk wiki01-0.vmx

my ghettoVCB.sh config:

LAST_MODIFIED_DATE=11/14/2009

  1. Format output of VMDK backup

  2. zeroedthick

  3. 2gbsparse

  4. thin

  5. eagerzeroedthick

DISK_BACKUP_FORMAT=zeroedthick

  1. Number of backups for a given VM before deleting

VM_BACKUP_ROTATION_COUNT=3

  1. Shutdown guestOS prior to running backups and power them back on afterwards

  2. This feature assumes VMware Tools are installed, else they will not power down and loop forever

  3. 1=on, 0 =off

POWER_VM_DOWN_BEFORE_BACKUP=0

  1. enable shutdown code 1=on, 0 = off

ENABLE_HARD_POWER_OFF=0

  1. if the above flag "ENABLE_HARD_POWER_OFF "is set to 1, then will look at this flag which is the # of iterations

  2. the script will wait before executing a hard power off, this will be a multiple of 60seconds

  3. (e.g) = 3, which means this will wait up to 180seconds (3min) before it just powers off the VM

ITER_TO_WAIT_SHUTDOWN=3

  1. Number of iterations the script will wait before giving up on powering down the VM and ignoring it for backup

  2. this will be a multiple of 60 (e.g) = 5, which means this will wait up to 300secs (5min) before it gives up

POWER_DOWN_TIMEOUT=5

  1. enable compression with gzip+tar 1=on, 0=off

ENABLE_COMPRESSION=0

############################

              1. NEW PARAMS #########

############################

  1. Disk adapter type: buslogic, lsilogic or ide

ADAPTER_FORMAT=buslogic

  1. Include VMs memory when taking snapshot

VM_SNAPSHOT_MEMORY=0

  1. Quiesce VM when taking snapshot (requires VMware Tools to be installed)

VM_SNAPSHOT_QUIESCE=0

##########################################################

  1. NON-PERSISTENT NFS-BACKUP ONLY

  2. ENABLE NON PERSISTENT NFS BACKUP 1=on, 0=off

ENABLE_NON_PERSISTENT_NFS=0

  1. umount NFS datastore after backup is complete 1=yes, 0=no

UNMOUNT_NFS=0

  1. IP Address of NFS Server

NFS_SERVER=172.30.0.195

  1. Path of exported folder residing on NFS Server (e.g. /some/mount/point )

NFS_MOUNT=/nfsshare

  1. Non-persistent NFS datastore display name of choice

NFS_LOCAL_NAME=nfs_storage_backup

  1. Name of backup directory for VMs residing on the NFS volume

NFS_VM_BACKUP_DIR=mybackups

                                                    1. DO NOT MODIFY PAST THIS LINE ##########################

0 Kudos
lamw
Community Manager
Community Manager

In the future you may want to enable VM_SNAPSHOT_QUIESCE which flushes all data to disk prior to creating the snapshot, this will help get it into a consistent state prior to the backup. Other than that, I can't see any issues with the backup. Is this a general system (OS ?) or database/app server? So I go back to my initial question, have you tried to restart the system and tried to do a disk check to ensure no other issues persists in the OS? read-only filesystem usually points to other issues and I don't think it was the backup that caused it directly but perhaps something else that might have been going on.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

Backdoor32
Contributor
Contributor

yes i rebooted many times...

i try to restore agian and i will check the disk (in 15 min)...

Quiesce will suspen my VM?

It's just simple Debian server

0 Kudos
lamw
Community Manager
Community Manager

If you still have your original, you may want to consider testing this before deleting the main VM and also for just verifications sake, try doing a power down backup to ensure that it isn't the system.

Take a look at this VMware KB for understanding how snapshots work and the various options that goes with taking a snapshot, including quiescing a snapshot: http://kb.vmware.com/kb/1015180

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
Backdoor32
Contributor
Contributor

fsck said me that /dev/sda1 is clean!

is that possible that doesn't work because of the mysql server who is running on my server?

0 Kudos
lamw
Community Manager
Community Manager

database servers are iffy....I know some users have been able to get their MS SQL but using VSS/etc. live database backups will vary based on the transactions going at the given moment/etc. You'll have to do your own testing to see if this would work as a backup solution, else you may need to script something that'll shut down the db before the backup/etc.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
Backdoor32
Contributor
Contributor

so it will be the same for my ldap server and mail server and so on?

0 Kudos
lamw
Community Manager
Community Manager

afaik, databases are the only iffy ones (again, this will be prove by doing a test, you should never implement anything into production environment until it's been fully tested). I'll say the same for the rest, but generally db's are the ones that may not be as clean and you may want to look at using database backup utilities versus backing up the VM or using quiescing the VM prior to snapshot.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
Backdoor32
Contributor
Contributor

I'm not in production now...

but i configure all my server now and i need to backup it!

Have you an advice? should i stop the service and backup the vm after that (with quiescing)?

It's not so good because if my ldap is down all my network willnot work...

Thanks for your help

0 Kudos
lamw
Community Manager
Community Manager

As mentioned, I'm only aware of some users having problems backing up their databases, you'll have to further investigate to see if this solution works for you (I'm not a dba). For all other systems, I've not heard of any other type of application that has issues, again this will be vented out by doing some testing. I'm pretty confident that it should work for all your other infrastructure system backups and you should not have to take them down for a backup. I do recommend that you have the latest VMware Tools installed and enable quiesce option.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos