The xen-vm-autosnapshot.py script has been updated. It can now accept strings for –log-level (e.g. –log-level=debug), and the –test option has been renamed to –dry-run (since that’s the convention everyone else in the world seems to be used to).
Some of you have been asking about the problem where snapshots get locked and can’t be deleted from NetApp volumes. Unfortunately, this appears to be related to the way the XenServer API interacts with NetApp’s DATA OnTap API. Unless someone out there can enlighten me, I don’t think there’s much we can do, other than wait for Citrix to fix their API. =(
A new version of SMTP Tester has been released with some minor bug fixes and miscellaneous code refactoring.
Since I keep finding SMTP Tester so useful, I figured I should finish it up, create the obligatory Win32 installer, and release it to the world. The only issue I’m having right now is that the Win32 executable created by py2exe is HUGE (~17MB). Luckily, the resulting NSIS package is only ~4MB, but even that seems pretty ridiculous for what the tool is/does. Needless to say, I’m very interested in suggestions for compressing this down further.
Okay, It’s about time I document this trick since I use it so often and have to keep looking it up!
I like to make life easy for my successors, so whenever I write a program that needs to access files in or below its current directory, I avoid absolute paths like the plague. I find that it’s almost always better to use a relative path, so that if the program needs to be moved someday, it will continue to run with the expected behavior, regardless of where it lives on the filesystem.
The problem is that when a program is executed, all relative paths are relative to the current working directory of the user who executed it instead of the directory that the program actually lives in. To work around this, you just need to prefix your relative paths with a variable containing the absolute location of the program itself:
PHP:
Python:
cwd = os.path.abspath(sys.path[0])
Note that the above won’t work when your program is “frozen” (e.g. compiled with py2exe).
Windows Shell:
My new Xen Tools project page is up, and my first tool is ready for wide-spread use. xen-vm-autosnapshot.py is a command line program (written in Python, of course) that will take automatic, rotating snapshots of virtual machines running on a Xen host. Enjoy!