VMware Cloud Community
muos_o_-_-_o
Enthusiast
Enthusiast

3i to 3i replication ?

Is there any software on the market that you can replicate your vm's within a 3i environment? Only having the free serial ver? I know that ranger and vreplicator are not supported. Any help welcome

0 Kudos
18 Replies
lamw
Community Manager
Community Manager

If you enable the non-supported SSH console on ESXi, you can write small script that snapshots your VMs and then vmkfstools copy them off to either to a SAN or NFS, this way you can keep your VMs running while this process happens, once the copy has finished, you can then delete the snapshot. If you don't need your VMs to be running, then you can just vmkfstools copy your VMs onto the shared storage or NFS (remember to mont your NFS via the VIC or using vim-cmd, else vmkfstools will fail when trying to copyt he full vmdk instead of breaking it up into 2gb sparse since it requires the mount to be under the /vmfs/volumes ). This is basically what VCB does but talks directly to the SAN without impacting the performance and using resources on your ESX Host.

0 Kudos
SuryaVMware
Expert
Expert

You could download and install the free trail version of VC wich will work for about 60 days and in full. Use the cloning option from Server 1 to Server 2.

-Surya

0 Kudos
muos_o_-_-_o
Enthusiast
Enthusiast

lamw wrote:If you enable the non-supported SSH console on ESXi, you can write small script that snapshots your VMs and then vmkfstools copy them off to either to a SAN or NFS, this way you can keep your VMs running while this process happens, once the copy has finished, you can then delete the snapshot. +

Lamw that sound like a plan a very nice plan B-)What I would like it to do is take the snapshot at say 12pm then push it to a small ML115 server's esx3i data store in case the main server fall's over. I can just start the ML115 with the other esx3i's snapshot all be it the snapshot will be a few hours out but it's better then nothing in my book. Can you script be set to delete after the snapshot is finished? Also can you advise me on where I could get info on how to write this script? thanks for the help !

+

0 Kudos
lamw
Community Manager
Community Manager

Actually I have a script that does that exact thing, though I haven't had a chance to clean it up, but I can post a link to it shortly. The script just takes a text file of the Virtual Machine names and you configurre the backup path within the script and you can just cron it to occur everday, I know there's crontabs running on ESXi for backups/etc. but I haven't figure out how to automate that on the ESXi hosts, haven't looked into it. Though if you're going to enable SSH console, you could have another system cron a job that'll use SSH public/private keys to SSH in and execute the script.

0 Kudos
muos_o_-_-_o
Enthusiast
Enthusiast

Actually I have a script that does that exact thing, though I haven't had a chance to clean it up, but I can post a link to it shortly. The script just takes a text file of the Virtual Machine names and you configurre the backup path within the script and you can just cron it to occur everday, I know there's crontabs running on ESXi for backups/etc. but I haven't figure out how to automate that on the ESXi hosts, haven't looked into it. Though if you're going to enable SSH console, you could have another system cron a job that'll use SSH public/private keys to SSH in and execute the script.

Lamw: If you post that script that would be first class for a lot of people not just me I'm sure Smiley Happy Can I ask what is cron? I thought you could not link into esx3i with SSH only though the VI client only?

0 Kudos
lamw
Community Manager
Community Manager

Answer to question 1: Cron is just a program that allows you to automate the execution of certain tasks/scripts at a specified date/time, for more information go onto any UNIX/LINUX or full fledge ESX w/SC and type "man cron".

Answer to question 2: SSH Console access is not a supported feature by VMware, hence enabling it will cause a MOTD to state this is unsupported, but if you need console access, it's possible to open it up, please refer to this link:

you'll want to follow the process for ESX 3.5u2,3 unless you're still on u1

I actually found out how to edit the crontab that's setup, I guess they don't have the binary or its located in another location but the crontab if you need to edit/update can be found at: /var/spool/cron/crontab/root

~ # cat /var/spool/cron/crontabs/root

#syntax : minute hour day month dayofweek command

01 01 * * * /sbin/tmpwatch.sh

01 * * * * /sbin/auto-backup.sh #first minute of every hour (run every hour)

00,10,20,30,40,50 * * * * /sbin/decodeSel.sh #Every 10 minutes, translate the latest IPMI SEL data

The second line is the auto-backup script that ESXi runs and backups to the local filesystem under /tmp/local.tgz, so if you wanted to automate backup of your VM, you would just leave the script on the ESXi server and just append a line to have it run a certain time/day for your backups. I'll post the script later this evening

0 Kudos
muos_o_-_-_o
Enthusiast
Enthusiast

I'm getting my head round it a bit.......I'll do some testing can't wait to see the script, every days a school day........... thanks for the help and the link :smileygrin:

0 Kudos
lamw
Community Manager
Community Manager

Please refer to the script here: http://communities.vmware.com/docs/DOC-8760

The script basically accepts a list of Virtual Machines and you'll want to configure the backup for either NFS or SAN/LOCAL within the shell script, so currently the NFS backup method has been disabled, but if you want to test NFS, then just enable it by changing the flag = 0 and you don't have to worry about the VM_BACK_DIR variable unless you want to backup to your SAN/LOCAL then you would need that variable set and disable NFS. Let me know if you have any questions, I did not have much time to clean up the code but it should do its job

s1xth
VMware Employee
VMware Employee

Can you explain how this script can backup to a second ESXi server? Where do you specify the server information/destination information for the ESXi server you are copying the data to? The second ESXi server can't be a NFS/SAN so what would you specify?

thanks!

http://www.virtualizationimpact.com http://www.handsonvirtualization.com Twitter: @jfranconi
0 Kudos
lamw
Community Manager
Community Manager

In the initial comment from the requestor, the user was looking to backup the VMs in case a failure and was looking at utilizing SAN storage. This method allows you to backup the Virtual Machines to say a backup LUN which can be seen by the other ESXi Server. If you're looking for host-to-host replication within it's local storage, you'll probably have to export that local storage and share that out via iSCSI. There's a virtual appliance that xtravirt created: http://engineering.xtravirt.com/products/xtravirt-virtual-san.html but I'm not sure if it only supports ESX 3.5 w/SC or does it support ESXi. This solution is just one that allows you to run backups of your existing Virtual Machines using similar methodology to VMware's VCB which can run on both ESX 3.5+ or ESXi

0 Kudos
muos_o_-_-_o
Enthusiast
Enthusiast

lamw : Your a ESX god!!! I will be testing your script next week within a text environment when I get my other esxi up and running and keep you update 100%. Thanks 100% for your help I'm sure this will help loads of esx3i users.

All the best

muos o(-_-)o

0 Kudos
muos_o_-_-_o
Enthusiast
Enthusiast

lamw : Your a ESX god!!! I will be testing your script next week within a text environment when I get my other esxi up and running and keep you update 100%. Thanks 100% for your help I'm sure this will help loads of esx3i users.

All the best

muos o(-_-)o

0 Kudos
lamw
Community Manager
Community Manager

I should just clarify, since s1xth had previously commented thinking this might be a script to help replicate Virtual machines between two ESXi Servers running only on local storage, that is not the case.

Though if you’re trying to use ESXi out of the box without any advanced features from VMware and would like to run a pretty cheap setup and you have a spare ESXi as hotbackup. Then one possibly solution is to have an NFS Server and run backups of your Virtual Machines and in case of a failure, you could easily bring up your secondary ESXi server, mount the Virtual Machines from the NFS volume and be up in running pretty quickly. You can even speed that up by having your ESXi image be a stateless PXE boot and your VMs would be stored on either shared storage or on an NFS volume that could be quickly mounted / de-mounted in case you need to swap to another ESXi host. The script solution would work for this or it can be used as a free method of running backups to any type of storage without having to bring your VMs down for the backups.

0 Kudos
mike_laspina
Champion
Champion

Hi,

This may be of interest if your are looking for free methods

Regards,

Mike

http://blog.laspina.ca/ vExpert 2009
0 Kudos
ceemour
Enthusiast
Enthusiast

I cant get this script to work on esx 3.5 u3 or esxi 3.5 u3 default installs, all i have to do is set the backup path right.....

complains about missing files

is there some better explanation of how to get it to work

0 Kudos
lamw
Community Manager
Community Manager

Correct, you just need to specify the full /vmfs/volume back to where you want your backups to be (e.g. /vmfs/volumes/SOME_LUN/mybackupdir )

Can you output the error about the missing file, if it's not specific, you can always run sh -x script.sh and it'll provide further debug information, I can't tell off hand what's failing. Also ensure you're passing in a text file seperated by a newline of displayName for your VMs.

Let me know if you need more assistance.

0 Kudos
ceemour
Enthusiast
Enthusiast

ahh okay, i seem to have missed that bit

so i go script.sh vms.txt

then in vms.txt

vm1

vm2

vm3

etc

Regards

0 Kudos
lamw
Community Manager
Community Manager

Correct.

0 Kudos