How to build a WormBase Virtual Machine
WormBase Virtual Machines are created for each release of the database. This process is almost entirely scripted. Virtual Machines are created from base machines running on one of the WormBase back end machines. Once created, each virtual machine contains a simple script that keeps the software up-to-date. New databases must be installed by the user on-demand.
Creation of a new VM requires three steps:
1. Syncing the software to the staging rsync module hosted on the main WormBase development site.
2. Creation of VMDKs for available databases.
3. Tarring and gzipping.
The process is described in more detail below.
Base Virtual Machines
The base virtual machines are located at:
wormbase-live-server : CentOS 5, configured in particular for server use IP: 192.168.20.100
wormbase-live-desktop : Ubuntu 6.06 IP: 192.168.
Updating the software
Log onto the appropriate guest Virtual Machine.
Updating the software after distribution
Once distributed Wormbase virtual machines can be kept up-to-date by a simple script. This has several advantages.
1. It keeps download sizes small
2. It keeps local configuation from being rewritten with every update.
3. It modularizes required databases so that users can choose what databases they wish to install.
Establishing the Virtual Machine
Build and install VMware Server (currently vers 1.0.3)
cd ~/build tar xzf ../src/vmware-server-1.0.3.tar.gz sudo ./vmware-install.pl
For WormBase, I place the virtual machines in /usr/local/vmx.
Installing the OS
Fetch a suitable ISO. From the console interface, edit options for the CD-ROM. Attach the ISO and make sure the "Connect on Startup" option is checked.
Users and groups
WormBase virtual machines have a slightly different user and group arrangment than we have traditionally used.
The main user is WormBase User:
Login: wormbase pass: wormbase home: /home/wormbase
To keep things copacetic with WormBase proper, I've created a symlink: /usr/local/wormbase -> /home/wormbase
Preparing a VMX for release
1. Start the guest OS.
2. In the guest, purge things like access logs, tarballs, etc
3. Shrink the disk in the disk by first zeroing empty space
sudo dd if=/dev/zero of=/empty_file rm /empty_file
4. Set the VMX to graphical runlevel 5 (/etc/inittab)
5. Shutdown the guest
6. Copy the current wormbase-live to a directory named by release:
cp -r wormbase-live wormbase-WSXXX.YYYY.MM.DD
7. In the console, set the version and release date
WormBase (WSXXX; DD Feb YYYY)
8. Defragment the disk from the VMWare console:
Edit options > Hard Disk > Defrag the disk
9. In the VMWare console, set networking to NAT (assume desktop usage) and restart the guest.
10. Start the new VMX.
11. Reset the MAC address
12. Finish shrinking the disk using the vmware-toolbox:
$ vmware-toolbox (select shrink)
13. When complete, shut down the VMX
tar czf wormbase-WSXXX.YYYY.MM.DD.tgz
15. Symlink to make it available via http
cd /usr/local/wormbase/html/vmx ln -s /usr/local/vmx/wormbase-WSXXX.YYYY.MM.DD.tgz wormbase-WSXXXX.YYYY.MM.DD.tgz
16. Upload the new VM to BitTorrent
17. Update the [[Virtual_Machines Virtual Machines] page on the Wiki
Configuring VMXs as hosted frozen releases
To use a Virtual Machine as a server, a few small modifications need to be made.
1. From the VMWare Server console, launch the virtual machine
2. Set a static IP (must be assigned!)
In this example, the guest OS IP is 22.214.171.124. This should be changed to whatever your assigned IP address is.
ifconfig eth0:0 126.96.36.199 netmask 255.255.255.0 broadcast 188.8.131.52 route add -host 184.108.40.206 dev eth0
You can also do this from the GUI if you prefer, under System Settings -> Network. Double click on the network adaptor.
Address: Your assigned IP address Subnet mask: 255.255.255.0 Default gateway: 220.127.116.11 Broadcast host: 18.104.22.168 (not explicitly set in the GUI)
3. Reset the MAC ID of the guest
System Tools > Network
Double click on the network adaptor and select the "Hardware" tab. Click on "Probe", then "OK"
4. Add the following lines to /etc/resolve.conf for DNS
search cshl.edu nameserver 22.214.171.124 nameserver 126.96.36.199
5. Set the hostname
This can be done either in the GUI under the Network panel, or using the following command line terms.
If you have a static IP address, then /etc/hosts is configured as follows:
127.0.0.1 localhost.localdomain localhost 143.488.220.44 mybox.mydomain.com mybox
After updating the /etc/hosts file correctly, the "hostname" command should be run as follows to set your hostname:
6. Edit /usr/local/wormbase/conf/localdefs.pm and httpd.conf with the appropriate hostname
8. Shutdown the virtual machine and copy it as a backup
I append "server" to the name to indicate that it is configured as a server
tar czf wormbase-WS100.2003.05.13-server.tgz wormbase-WS100.2003.05.13