Hi,
For a while now we have been testing various 3rd party tools to backup our vmware servers. Most of them are doing snapshot or some other ninja stuff, which i dislike due to my old schoolness.
I finally had some brain space to think about this issue and this is what I came up with.
From a putty shell on the console. (Don’t forget the case sentivitiy & make sure your servers are running vmwaretools)
switch to root
su
create a directory in the vmfs
cd /
mkdir /vmfs/volumes/XenApp/backup
create a local scripts directory
mkdir /myscripts
using vi I created a script
cd /myscripts
vi vmbackup.cgi
Code:
#!/bin/sh | |
echo Clearing Backup | |
rm -f /vmfs/volumes/XenApp/backup/*.* | |
echo Shutting Down Server | |
vmware-cmd /vmfs/volumes/XenApp/SRV1/SRV1.vmx stop trysoft | |
echo waiting 10m | |
sleep 10m | |
echo Performing Backup to Local Disk | |
cp /vmfs/volumes/XenApp/SRV1/*.* /vmfs/volumes/XenApp/backup | |
echo Starting Server Up | |
vmware-cmd /vmfs/volumes/XenApp/SRV1/SRV1.vmx start |
I did a chmod to allow root the excute the file, i used 0777 because i am lazy
chmod 0777 vmbackup.cgi
ESX uses crontab, to setup the scheduled job
crontab -e
Code:
MAILTO=team@ozctx.local | |
30 23 * * * /myscripts/vmbackup.cgi |
I believe the crontab works best with cgi, i added to sleep to make sure, also i am unsure if the MAILTO will acutally work.
Now you can sit back and relax! ![]()
Handy Crontab Header MAILTO=mycronic@example.com # minute (0-59), # | hour (0-23), # | | day of the month (1-31), # | | | month of the year (1-12), # | | | | day of the week (0-6 with 0=Sunday). # | | | | | commands 3 2 * * 0,6 /some/command/to/run 3 2 * * 1-5 /another/command/to/run Shortcut Crontab Header Instead of the first five fields as above, one of these special strings may be used: string meaning ------ ------- @yearly Run once a year, "0 0 1 1 *". @annually (same as @yearly) @monthly Run once a month, "0 0 1 * *". @weekly Run once a week, "0 0 * * 0". @daily Run once a day, "0 0 * * *". @midnight (same as @daily) @hourly Run once an hour, "0 * * * *".3 comments | Permalink
Aspired by Citrix Conference, decided to go VIRTUAL. Look at my desk, the only physical thing (you have more, mate, keyboard, mouse…) I have is the desktop PC. So……XenServer is the solution.
…Install XenServer 4.1 on a HP7800 (E6550)
…Push XP CD in the CD Rom to make a Template VM
…Copy the XP image and customize my own
…Decommission my desktop PC (!!!)
Wait, you have got a 250GB hard disk there, with NTFS format, what about that?
…Put on the XenServer PC, can see /dev/sdb
…Mount as a NTFS disk, READONLY
Googling…Tired…The only thing I can do is to format it as Linux format (ext3) and use it as a Storage Repository.
…BACKUP the 250GB somewhere
…dd if=/dev/zero of=/dev/sdb bs=512 count=1 (change to your own device)
…fdisk /dev/sdb (to create the partition)
…pvcreate /dev/sdb
…xe sr-create content-type="Local SR” host-uuid=YOUR_XENServer_UUID
type=ext device-config-device=/dev/sdb1 shared=false name-label="Second HDD”
Done, now I can see from XenCenter the second Storage Repository.
…xe sr-list (let me have a look what has been created)
A lot of fun, isn’t it.
Reference:
How To Add Disk Storage to the XenServer Host http://support.citrix.com/article/ctx116176
How to Create a Local File-based Storage Repository http://support.citrix.com/article/CTX116322
Please note, when you read the second KB from Citrix, you do not need to remove the current SR (which can be disastrous), just create one with the “xe sr-create” command will suffice. You can change the new SR as the default by either command line tool, or in XenCenter GUI.
Leave a comment | Permalink
For my test of Windows 2008, i have installed on my vista pc Vmware Server Beta 2.0 with the hope of being about to use vmware under ubuntu (but that is a another story).
Installation is normal, it even chose my largest drive for the datastore.
Once completed you access the server via web based console. Everything is present like ESX VI 3.x web base console, but is rather slow and i have had issues importing 3rd party VMs.
After a bit of googling i found out that you could use the Virtual infrastructure client to connect to the server on port 8333.
This has made life much easier.
Performance is not to bad, but i have yet to test with all my vm’s running.
DC, FPS + IIS, WinXP, WinVis, thinstation, ubuntu.
later nerds
Update !
Found out that by default vmware beta product all run in debug mode.
looking at some forum stuff and having a look in the directory for vmware server.
stop all vmware services…
ren vmware-vmx-debug.exe vmware-vmx-debug.old
copy vmware-vmx.exe vmware-vmx-debug.exe
ren vmware-remotemks-debug.exe vmware-remotemks-debug.old
copy vmware-remotemks.exe vmware-remotemks-debug.exe
much much better…
Leave a comment | Permalink
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||