Archive for February, 2008

I have updated the vmware server backup script. The changes this version are:

Added a large number of command line options. It is now possible to make changes to the backups without editing the script. The command line options are as follows:

backup [--all] [--excludevm vm] [--includevm vm] [--hot] [--cold] [--format tgz|tbz2] [--help]
–all Backup all registered VMs, except VMs that have been excluded
–excludevm Exclude a VM from backup
–includevm Add a VM to the list of VMs to back up
–hot Perform a hot backup (Backup using a snapshot)
The VM will remain running while the backup is happening
–cold Perform a cold backup (Backup using suspend)
The VM will be unavailable during the backup when this method is used.
–format Choose the output format, available formats are:
tgz – Create a gziped archive of the VM in the current directory
tbz2 – Create a bzip2 archive of the VM in the current directory, this option is much slower and uses more CPU than the tgz option

Examples:
Create a hot (online) backup of all registered VMs
backup –all –hot

Create a cold backup of a VM named foobar.com with the maximum compression
backup –includevm foobar.com –cold –format tbz2

The new script is here

I have put up an experimental version of the cleanvideo script. A significant portion of the script has been re-written to hopefully make it easier to make changes going forward. The changes made are:

  • Most operations have been moved into their own python class.
  • Added an option that allows commercial cropping a second time. This was primarily added to fix cropping on videos in which the main video is 4:3 format with black borders on all sides, but has a small horizontal line at the top or bottom that runs the width of the video. The line keeps the crop from cropping off the side bars. With the new second crop option, the horizontal line is cropped out during the first crop operation and the second crop removes the black bars from the sides.
  • This script now cleans up after itself by default, there is an added option to keep the originals around. In the future I plan on querying/using the mythtv “keep old files” option as the default, so this will likely change soon.
  • Changed the options passed to mplayer for the crop detection, this speeds up the detection of the crop boundries significantly.

This new version has not been fully tested, it may not work properly. If it breaks, you may keep both pieces.

The new version of the script is available here

I have put a script in the downloads section that generates a host file from DNS. This is very useful where a group of systems are clustered and it is undesirable for a DNS issue to cause name service problems. Such as is the case with most clustering/ha solutions including VMware ESX, Symantec/Veritas VCS, SunCluster, TrueCluster, and most Linux based clustering software.

The output is sent to stdout and can be redirected to a file.

Options:
-d, –dnsdomain Set the DNS domain to use
-b, –basename Set the base of the server (hostname without the node number at the end)
-s, –static Add static address line, format: ipaddr hostname.domain hostname
-h, –help Print this useful help screen

Examples:
makeclusterhost.py > /etc/hosts –dnsdomain foo.com –basename server –static “192.168.10.3 virtualcenter.foo.com virtualcenter” –static “192.168.10.4 otherhost”

The /etc/host file contains the following:
# This file generated by makeclusterhost.py
# Do not edit, changes will be overwritten
127.0.0.1 localhost.foo.com localhost

#Static IP addresses (from command line)
192.168.10.3 virtualcenter.foo.com virtualcenter
192.168.10.4 otherhost

# Cluster IP addresses found in DNS
192.168.10.11 server01.foo.com server01
192.168.0.12 server02.foo.com server02

The script can be downloaded here

I have corrected a bug in the cleanvideo script that caused it to attempt to clean up a non-existent temp file.

The new version is in the download area here