Preparing a Virtual Machine image

Start by copying a VM image from the ETICS VM repository to the :

cp -R /afs/cern.ch/project/etics/internal/public/VMWareImages/*SomeImage* /home/vmwareImages/

Naming convention

The VM's in the repository must follow a naming convention according to the platform name used by the submission infrastructure invoking the VMLoader.

When copying a VM from the ETICS VM repository some directories might be pointing to another location. Remember to add a "/" at the end of the directory you want to copy - so that the directory are copied and not the link.

Modifications to the VM outside the VM.

VMware properties is configured through the .vmx-file - which is explained here.

KVM and Xen does not rely on the .vmx-file but must be configured through the launch commands specified in the VMLoader.xml file.

Modifications inside the VM

Requirements:

  • You will need a computer with VMware Server 2.0 installed, which can be downloaded for free here (Require registration).

The virtual machine must be registered in the [standard] VM pool. This is set when installing VMware Server 2.0 and the default location is "/var/lib/vmware/Virtual Machines/". Move the VM folder to this location and register it in the web-interface of the physical machine:

Example


   * Connect and log in to the physical machine running the VMware Server 2.0 by pointing your browser to https://PHYSICALMACHINE:8333
   * Select the "Virtual Machine"-tab and choose "Add Virtual Machine to Inventory".
   * Browse the virtual machine repository and select the .vmx file of the virtual machine.
   * Open the virtual machine console by selecting it in the "Inventory" and then selecting the "Console"-tab.
   * Start the virtual machine and open the console window.
   * When it is up and running you can proceed with the setup in the next section

Console redirection

The console output of the virtual machine must be redirected to its serial port. Add "console=ttyS0,9600n8" to the kernel parameters in order to redirect the console of the VM to the physical machine.

Example /boot/grub/menu.lst or /boot/grub/grub.conf

default=0
title Scientific Linux CERN SLC (2.6.9-89.0.3.EL.cernsmp)
          root (hd0,0)
          kernel /boot/vmlinuz-2.6.9-89.0.3.EL.cernsmp ro root=LABEL=/ rhgb quiet console=ttyS0,9600n8
          initrd /boot/initrd-2.6.9-89.0.3.EL.cernsmp.img

Make sure that this is the same alternative that is set as default item to boot. Also make sure that the editor does not break the line after editing so that the console parameter is not handled.

Add the agent update

Add download of the VMLoader-agent and its libraries to the rc.local script or a similar start-up script.

Example /etc/rc.local

echo "
wget -t 1 -N http://eticssoft.web.cern.ch/eticssoft/builds/default/org.etics/org.etics.submission.vmloader-agent/1.0.0/slc4_ia32_gcc346/etics-submission-vmloader-agent-1.0.0-1.tar.gz -P /root/vmloaderagent
tar -zxvf /root/vmloaderagent/etics-submission-vmloader-agent-1.0.0-1.tar.gz -C /root/vmloaderagent/
mv /root/vmloaderagent/lib/eticsVMLoaderAgent.jar /root/vmloaderagent/
/usr/java/latest/bin/java -jar /root/vmloaderagent/eticsVMLoaderAgent.jar &
" >> /etc/rc.local

Open firewall port

Start the graphic environment to punch a hole in the firewall port 49152 or add the exception using the command line.

Graphic environment can usually be started with:

startx

Example

On SLC4_64 you can edit this in: "System settings" -> "Security level" -> set 49152:tcp to the "Other ports" section.

Shut down the virtual machine with

shutdown -h now

Optional modification

Some VM's are configured to start the "sendmail" service, which is slowing down the boot process - it can be disabled.
chkconfig --del sendmail

Finally

Move the virtual machine image to the VMLoader cache for testing.

Example

mv /home/vmwareImages/*SomeImage* /tmp/

Make sure that the virtual machine files has the right permissions so that they are accessible to the user running the VMLoader.

Example

chown -R VMLoaderUser:VMLoaderUser /tmp/%IMAGENAME%/

When the virtual machine image is ready it can be copied to the virtual machine image repository.

Be aware that the /tmp folder can be deleted during a reboot and the virtual machine could be lost!

-- OeyvindValenSendstad - 04 Aug 2009

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2010-01-06 - OEyvindValenSendstad
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    ETICS All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback