Skip Headers
Oracle® VM Template Builder Installation and User's Guide
Release 2.1

Part Number E14391-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

2 Installing Oracle VM Template Builder

This Chapter contains information on installing, configuring and logging in to Oracle VM Template Builder. This Chapter contains:

2.1 Prerequisites

To install and use Oracle VM Template Builder, you need the following prerequisites, which can be downloaded from http://www.oracle.com/edelivery:

2.2 Installing the Oracle VM Template Builder Template

You can install Oracle VM Template Builder from a template, or as an RPM-based install on and computer running Oracle Enterprise Linux. This Guide assumes you are using the template-based install, which is the preferred installation type. This section describes the Oracle VM Template Builder template installation. For information on installing Oracle VM Template Builder as an RPM-based install, see Section 2.10, "Installing Oracle VM Template Builder on Oracle Enterprise Linux as an RPM".

To install the Oracle VM Template Builder template:

  1. Copy the downloaded Oracle VM Template Builder template file to the /OVS/seed_pool directory of an Oracle VM Server.

  2. Unzip the template file:

    # cd /OVS/seed_pool
    # unzip OVM_EL5U2_X86_64_TMPLBUILDER_PVM.zip
    

    This step creates an OVM_EL5U2_X86_64_TMPLBUILDER_PVM.tgz file.

  3. Uncompress the template file:

    # tar -xzf OVM_EL5U2_X86_64_TMPLBUILDER_PVM.tgz
    

    This step creates an OVM_EL5U2_X86_64_TMPLBUILDER_PVM directory under the /OVS/seed_pool directory.

The template is ready to be imported into Oracle VM Manager and used to create the Oracle VM Template Builder guest virtual machine. You can also use the template to create the Oracle VM Template Builder guest virtual machine in Oracle VM Server. Oracle recommends you use Oracle VM Manager to create and manage the Oracle VM Template Builder guest virtual machine.

2.3 Creating the Oracle VM Template Builder Guest Virtual Machine

You can import the template and create the guest virtual machine using Oracle VM Manager. Alternatively, you can use Oracle VM Server to create the guest virtual machine with the xm command-line tool. Oracle recommends you use Oracle VM Manager to import, create and manage guest virtual machines, although this section discusses both options.

2.3.1 Creating the Guest Virtual Machine With Oracle VM Manager

To create the Oracle VM Template Builder guest virtual machine with Oracle VM Manager, you must first import the template into Oracle VM Manager, then create the guest virtual machine. To import the template into Oracle VM Manager and create the virtual machine:

  1. Log in to Oracle VM Manager and navigate to the Resources tab. The Virtual Machine Templates page is displayed. Click Import. The Source page is displayed.

  2. Choose Select from Server Pool (Discover and register) and click Next. The General Information page is displayed.

  3. Enter or select the following information:

    Server Pool Name: Select the Server Pool on which the virtual machine is to be located.

    Virtual Machine Template Name: Select the Oracle VM Template Builder template.

    Operating System: Select Oracle Enterprise Linux 5 64-bit as the operating system of the virtual machine.

    Virtual Machine System Username: Enter the username root, which is used to log in to the virtual machine.

    Virtual Machine System Password: Enter the password ovsroot, which is used to log in to the virtual machine.

    Description: Enter a description of the virtual machine.

    Click Next. The Confirm Information page is displayed.

  4. Click Confirm. The Virtual Machine Template page is displayed with a message to confirm the template is imported.

  5. To make the virtual machine template available for use, select the virtual machine template and click Approve. The View Virtual Machine Template page is displayed. Click Approve.

  6. Click the Virtual Machines tab. The Virtual Machines page is displayed.

  7. Click Create Virtual Machine. The Creation Method page is displayed.

  8. Select Create virtual machine based on virtual machine template. Click Next. The Server Pool page is displayed.

  9. Select the Server Pool in which to create the virtual machine. Select an option from the Preferred Server drop down. Click Next. The Source page is displayed.

  10. Select the template you imported in Step 1, and click Next. The Virtual Machine Information page is displayed.

  11. Enter the virtual machine name in the Virtual Machine Name field.

    Enter a password for the console in the Console Password field.

    Confirm the console password by entering it again in the Confirm Console Password field.

    Select the Network Interface Card. Click Next. The Confirm Information page is displayed.

  12. Confirm the virtual machine information, and click Confirm. The Virtual Machine page is displayed with the message Creating Virtual Machine.

  13. When the virtual machine is created, the Status changes from Creating to Powered Off. To power on the virtual machine, click Power On.

The Oracle VM Template Builder guest virtual machine is started.

When the Oracle VM Template Builder guest virtual machine is started for the first time, you must configure the guest virtual machine networking. See Section 2.3.3, "Configuring Oracle VM Template Builder" for information on how to configure the networking.

2.3.2 Creating the Guest Virtual Machine With Oracle VM Server

If the Oracle VM Template Builder template is imported and the virtual machine created by Oracle VM Manager, the network MAC address is configured automatically by Oracle VM Manager. If the template is used to create a virtual machine from the Oracle VM Server command line, the network MAC address must first be configured before the guest virtual machine is started.

To configure the network MAC address of the guest virtual machine in Oracle VM Server:

  1. Change directory to where the virtual machine files are located:

    # cd /OVS/seed_pool/OVM_EL5U2_X86_64_TMPLBUILDER_PVM
    
  2. Run the following command to generate a new MAC address:

    # PYTHONPATH=/opt/ovs-agent-2.2 python -c "from OVSCommons import randomMAC; print randomMAC()"
    
  3. Edit the /OVS/seed_pool/OVM_EL5U2_X86_64_TMPLBUILDER_PVM/vm.cfg file and change the line starting with 'vif' to:

    vif = [ 'mac=00:16:3E:xx:xx:xx', ]
    

    Where 00:16:3E:xx:xx:xx is the MAC address generated in step 2.

The network MAC address is now configured for the guest virtual machine.

To create and start the guest virtual machine, enter:

# xm create vm.cfg

The Oracle VM Template Builder guest virtual machine is started.

When Oracle VM Template Builder is started for the first time, you must configure the guest virtual machine networking. See Section 2.3.3, "Configuring Oracle VM Template Builder" for information on how to configure the networking.

2.3.3 Configuring Oracle VM Template Builder

When Oracle VM Template Builder is started for the first time, you must configure the guest virtual machine. Prompts are displayed for the configuration on the initial startup of the guest virtual machine. To configure Oracle VM Template Builder:

  1. Log in to the Oracle VM Template Builder guest virtual machine console. If you are using Oracle VM Manager, click the Console button on the Virtual Machines screen. If you are using Oracle VM Server, connect to the VNC session using VNCViewer. See the Oracle VM Server User's Guide for more information on connecting to a guest virtual machine using VNC.

  2. The following question is displayed requesting whether to use a static IP address, or have DHCP assign one:

    Do you want to enable dynamic IP configuration (DHCP) Y/n?
    

    The decision to use DHCP or a static IP address depends entirely on the requirements of your template. Enter Y to use DHCP, or n to use a static IP address. If you do not enter anything, after a period of time, DHCP is selected automatically.

  3. If you selected to use DHCP to assign an IP address, an IP address is acquired and configured in the guest. If you selected to use a static IP address, the following questions are displayed:

    Enter a static IP addresss:
    Enter netmask:
    Enter gateway:
    Enter DNS server:
    Enter hostname (e.g, host.domain.com):
    

    Enter a static IP address, the netmask for your network, the IP address for the default gateway for your network, the IP address for the DNS server for your network, and the host name to use for the guest virtual machine.

  4. The Oracle VM Template Builder configuration completes, and displays a message with the URL to use to connect to Oracle VM Template Builder web interface. Press any key to acknowledge the message. The Oracle VM Template Builder command-line login screen is displayed.

Oracle VM Template Builder network configuration is complete. You can now log in to the Oracle VM Template Builder web interface.

2.4 Accessing Oracle VM Template Builder Web Interface

To access Oracle VM Template Builder web interface, open a web browser and enter the URL for the application:

http://host/ovmtb

The Oracle VM Template Builder login screen is displayed.

2.5 Creating an Oracle VM Template Builder User

There is no default Oracle VM Template Builder user. You must create one or more using Oracle VM Template Builder. There are severalseveral methods to create a user:

2.6 Logging in to Oracle VM Template Builder Web Interface

To log in to Oracle VM Template Builder, enter your username and password in the Login screen and click Login. You are logged into Oracle VM Template Builder. See Section 3.1, "Logging In" in Chapter 3, "Logging In" for more information on logging in.

If you do not have a username and password for Oracle VM Template Builder, see Section 2.5, "Creating an Oracle VM Template Builder User".

2.7 Logging in to Oracle VM Template Builder Guest Virtual Machine

To log in to the Oracle VM Template Builder guest virtual machine operating system:

  1. Log in to Oracle VM Manager.

  2. Select the Oracle VM Template Builder virtual machine in the Virtual Machines list. Click Console. The guest virtual machine console is displayed.

  3. Enter the console password. The console password is the password you set when you created the guest virtual machine. The guest login screen is displayed.

  4. Log in to the Oracle VM Template Builder guest virtual machine.

    Note:

    The default operating system username and password for the Oracle VM Template Builder guest virtual machine is:

    Username: root

    Password: ovsroot

You are logged into the Oracle VM Template Builder guest virtual machine operating system.

2.8 Starting and Stopping Oracle VM Template Builder

To start and stop Oracle VM Template Builder, log in to the Oracle VM Template Builder guest virtual machine and run the appropriate start or stop command. To log in to the guest virtual machine, see Section 2.7, "Logging in to Oracle VM Template Builder Guest Virtual Machine".

The Oracle VM Template Builder service (ovmtb) starts the daemon which performs the template builds. The ovmtb service is separate to the web server (httpd) service, which serves up the Oracle VM Template Builder user interface. You must have both the ovmtb and httpd services running to use Oracle VM Template Builder.

To start the Oracle VM Template Builder service, enter:

# service ovmtb start

To start the web server service, enter:

# service httpd start

To stop the Oracle VM Template Builder service, enter:

# service ovmtb stop

To stop the web server service, enter:

# service httpd stop

To restart Oracle VM Template Builder service, enter:

# service ovmtb restart

To restart the web server service, enter:

# service httpd restart

2.9 Customizing the Oracle VM Template Builder Guest Virtual Machine

You can change some configuration parameters for the Oracle VM Template Builder guest virtual machine, such as the number of VCPUs, RAM, and whether to enable High Availability. See the Oracle VM Manager User's Guide for more information. Note that changing these settings may affect the performance of Oracle VM Template Builder.

You can also increase the disk size for the Oracle VM Template Builder guest virtual machine. You may be required increase the disk size if you create many Oracle VM templates and the default disk size is not sufficient for your needs. This section discusses adding a new disk to the Oracle VM Template Builder guest virtual machine using a virtual disk or an NFS share.

These steps assume you are using the Oracle VM Template Builder template, not the RPM-based installation. If you performed an RPM installation the steps may differ, depending on your system configuration.

2.9.1 Adding a Virtual Disk

To add a new virtual disk, on the Oracle VM Template Builder guest virtual machine:

  1. Shut down the Oracle VM Template Builder guest virtual machine.

  2. Add a new virtual disk to the Oracle VM Template Builder guest virtual machine using Oracle VM Manager.

  3. Start the Oracle VM Template Builder guest virtual machine.

  4. Log in to the Oracle VM Template Builder guest virtual machine. Create a partition on the new virtual disk using the fdisk utility:

    # fdisk /dev/xvdc
    

    The following prompt is displayed:

    > Command (m for help): n
    

    Enter n for new partition and press Enter. The following prompt is displayed:

    > Command action
    >    e   extended
    >    p   primary partition (1-4)
    > p
    

    Enter p for a primary partition and press Enter. The following prompt is displayed:

    > Partition number (1-4):
    > 1
    

    Enter 1 and press Enter.

    Press Enter twice to accept the default starting and ending locations and to create a partition that spans the entire disk. The following prompt is displayed:

    > Command (m for help): w
    

    Enter w to and press Enter to write the partition table to the disk and to exit fdisk utility.

  5. Format the new partition using the mkfs utility:

    # mkfs -t ext3 /dev/xvdc1
    
  6. Stop the Oracle VM Template Builder service, and the web server service:

    # service httpd stop
    # service ovmtb stop
    
  7. Remount the data on the virtual disk image:

    # umount /opt/ovmtb
    # mkdir /opt/ovmtb.bak
    # mount /dev/xvdb1 /opt/ovmtb.bak
    
  8. Mount the new data partition on /opt/ovmtb, for example:

    # mount /dev/xvdc1 /opt/ovmtb
    
  9. Copy the contents of the old data partition to /opt/ovmtb:

    # cp -a /opt/ovmtb.bak/* /opt/ovmtb
    
  10. Restart the Oracle VM Template Builder service, and the web server service:

    # service httpd start
    # service ovmtb start
    
  11. Edit the /etc/fstab file so that the virtual disk (and not /dev/xvdb1) is mounted on /opt/ovmtb when the system restarts, for example:

    /dev/xvdc1        /opt/ovmtb     ext3      defaults        1    2
    

The new disk is available in the guest virtual machine, and mounted as /opt/ovmtb, which is the location where Oracle VM Template Builder builds and saves templates.

2.9.2 Adding an NFS Share Disk

To add a new disk using NFS share, on the Oracle VM Template Builder guest virtual machine:

  1. Stop the Oracle VM Template Builder service, and the web server service:

    # service ovmtb stop
    # service httpd stop
    
  2. Remount the data virtual disk image:

    # umount /opt/ovmtb
    # mkdir /opt/ovmtb.bak
    # mount /dev/xvdb1 /opt/ovmtb.bak
    

    The application data is now located at /opt/ovmtb.bak.

  3. Mount the NFS share on /opt/ovmtb. For example, to mount an NFS volume shared as /vol from server nfs-server:

    # mount nfs-server:/vol /opt/ovmtb
    
  4. Copy the contents of /opt/ovmtb.bak to /opt/ovmtb:

    # cp -a /opt/ovmtb.bak/* /opt/ovmtb
    
  5. Start the Oracle VM Template Builder service, and the web server service:

    # service httpd start
    # service ovmtb start
    
  6. Edit the /etc/fstab file so that the NFS share (and not /dev/xvdb1) is mounted on /opt/ovmtb when the system restarts.

The new disk is available in the guest virtual machine, and mounted as /opt/ovmtb, which is the location where Oracle VM Template Builder builds and saves templates.

2.10 Installing Oracle VM Template Builder on Oracle Enterprise Linux as an RPM

You can install Oracle VM Template Builder as an RPM-based install on a computer running Oracle Enterprise Linux, in addition to as a template. You need Oracle Enterprise Linux Release 5 Update 2 (or later) to perform an RPM-based install. If you install on a 32-bit operating system, you can only create 32-bit templates. If you install on a 64-bit operating system, you can create both 32- and 64-bit templates.

This Guide assumes you are using the Oracle VM Template Builder template, which is the preferred installation type. If you choose to perform an RPM-based installation, some information in this Guide may differ to your environment.

To install Oracle VM Template Builder as an RPM-based install:

  1. Make sure there is enough space in the /opt directory to hold the templates you intend to create.

  2. Download and install any prerequisite Oracle Enterprise Linux packages not installed on your computer. The packages you need are:

    • bzip2-1.0.3-3

    • createrepo-0.4.11-3

    • httpd-2.2.3-11.el5_1.3.0.1

    • nfs-utils-1.0.9-33

    • mod_python-3.2.8-3.1

    • parted-1.8.1-17

    • perl-5.8.8-10

    • python-2.4.3-21

    • sendmail-8.13.8-2

    • sqlite-3.3.6-2

    • unzip-5.52-2.2.1

    • wget-1.10.2-7

    • yum-utils-1.1.10-9

    You can install these packages from the public Yum repository at:

    http://public-yum.oracle.com

    If you have configured your operating system to use a Yum repository, you can install these packages with the following command:

    # yum install bzip2 createrepo httpd nfs-utils mod_python parted perl python sendmail sqlite unzip wget yum-utils
    

    If you downloaded these packages, you can install them with the following command for each RPM:

    # rpm -ivh name.rpm
    

    For example

    # rpm -ivh yum-utils-1.1.16-13.el5.noarch.rpm
    
  3. Download JeOS and the JeOS templates from:

    http://edelivery.oracle.com/linux

    Select one or both of the following from the eDelivery Web site, according to your template build requirements:

    • Oracle Enterprise Linux > Oracle Enterprise Linux JeOS for Building Oracle VM templates Media Pack v2 for x86 (32 bit)

    • Oracle Enterprise Linux > Oracle Enterprise Linux JeOS for Building Oracle VM templates Media Pack v2 for x86_64 (64 bit)

    You should download the JeOS base image and JeOS templates for each operating system platform on which you want to create Oracle VM Template Builder templates. Under each location above, download:

    • The JeOS base image

    • All the JeOS template images you require for your template builds

  4. Unzip the downloaded files to extract the RPMs.

  5. Install JeOS:

    # rpm -ivh ovm-modify-jeos-version.rpm
    

    The ovm-template-config-version.noarch.rpm file is installed during the installation of ovm-modify-jeos-version.noarch.rpm and does not need to be installed manually.

  6. Install any JeOS templates you downloaded:

    # rpm -ivh ovm-name.rpm
    

    For example

    # rpm -ivh ovm-el5u2-xvm-jeos-1.0.1-6.el5.x86_64.rpm
    
  7. Download the prerequisite third party packages:

    • python-simplejson

    • python-sqlite2

    • Django

  8. Install each third party package with the command:

    # rpm -ivh name.rpm
    

    For example

    # rpm -ivh python-sqlite2-2.3.3-1.el5.x86_64.rpm
    
  9. Download and install Oracle VM Template Builder from any of these locations:

    http://edelivery.oracle.com

    http://public-yum.oracle.com

    http://oss.oracle.com

    If you have configured your operating system to use a Yum repository, you can install Oracle VM Template Builder with the following commands:

    # yum install ovmtb
    # yum install ovmtb-images
    

    If you downloaded the packages, you can install them with the following commands:

    # rpm -ivh ovmtb-version.rpm
    # rpm -ivh ovmtb-images-version.rpm
    
  10. Restart the Oracle VM Template Builder service and the web server service:

    # service httpd restart
    # service ovmtb restart
    
  11. Make sure the http and ssh ports are open to access the web interface and command shell with the command:

    # system-config-securitylevel-tui --quiet --port=http --port=ssh
    

Oracle VM Template Builder is installed and started.

If you cannot access the web interface, you may want to run the Oracle VM Template Builder configuration script. As the root user, enter

# /var/www/html/ovmtb/scripts/ovmtb-reconfig.sh

2.11 Upgrading JeOS and JeOS Templates

You can upgrade JeOS and JeOS templates independently to upgrading Oracle VM Template Builder. Oracle VM Template Builder automatically uses any updated JeOS RPM and JeOS templates. JeOS is the tool which creates the Oracle VM Template Builder templates, based on the available JeOS templates. You can upgrade JeOS independently to the JeOS templates, or you can upgrade the JeOS templates independently to JeOS.

This upgrade procedure assumes you are upgrading both JeOS and the JeOS templates. To upgrade JeOS and JeOS templates:

  1. Download JeOS and the JeOS templates from:

    http://edelivery.oracle.com/linux

    Select one or both of the following from the eDelivery Web site, according to your needs:

    • Oracle Enterprise Linux > Oracle Enterprise Linux JeOS for Building Oracle VM templates Media Pack v2 for x86 (32 bit)

    • Oracle Enterprise Linux > Oracle Enterprise Linux JeOS for Building Oracle VM templates Media Pack v2 for x86_64 (64 bit)

    For each operating system platform that you want to upgrade:

    • Download the JeOS base image to upgrade JeOS

    • Download all the JeOS template images you require for your template builds.

  2. Unzip the downloaded files to extract the RPMs.

  3. If you are upgrading JeOS, run the upgrade command as the root user:

    # rpm -U ovm-modify-jeos_version.noarch.rpm
    
  4. If you are installing any new JeOS templates, run the following command for each new template:

    # rpm -ivh ovm-template_name.rpm
    

    For example

    # rpm -ivh ovm-el5u2-xvm-jeos-1.0.1-6.el5.x86_64.rpm
    
  5. If you are upgrading any JeOS templates, run the following command for each template you are upgrading:

    # rpm -U ovm-template_name.rpm
    

    For example

    # rpm -U ovm-el5u2-xvm-jeos-1.1.0-3.el5.x86_64.rpm
    

JeOS is upgraded and any new or upgraded JeOS templates are installed. Oracle VM Template Builder automatically picks up the JeOS update and any new or updated JeOS templates.