OVM Templates have been around for a while now.  Documentation and various templates are readily available on OTN.  However, most of the documentation is centered around OVM Manager and most of the templates are built for Linux on x86 hardware.  But SPARC and Solaris are catching up.  A template for Weblogic 12.1.3 is already available.

With the release of Solaris 11.3, commandline tools to create, deploy and configure OVM Templates for SPARC are now available.  The tools are also available as a separate download on MOS as patch ID 21210110.  In this small series of blog entries, I will discuss how to deploy OVM Templates on SPARC and how to create your own.

(Note: This article is the blog version of the first part of MOS DocID 2063739.1 reproduced here for convenient access.)

Let’s start with the easiest part: Deploying an existing template on a SPARC system.

Of course, the first step here is to get a template.  Today, there isn’t very much choice – you can get a template for Solaris 10 and one for Solaris 11.  But more are being developed.  Go to Edelivery.oracle.com  to get them.  Here’s a little screenshot to guide you in the right direction.  My notes are in red…

There is also a template for Weblogic 12.1.3 available here.

Once you’ve downloaded the template, you’ll find a file called “sol-11_2-ovm-sparc.ova” or similar.  This is the template in Open Virtualization Format.   Since OVA and OVF are based on tar, you can actually extract and explore that file if you are curious.

The second step in deploying this template is to download and install the OVM Template Toolkit in the control domain of your server.  Either update to Solaris 11.3 or download the toolkit as a separate patch.  Then install it – you will find the tools in /opt/ovmtutils.  The patch will also contain a README file and manpages for the utilities.  I recommend looking at them for additional details and commandline switches not covered here.

root@mars:/tmp/ovmt# unzip /tmp/p21210110_11010_SOLARIS64.zip 
Archive: /tmp/p21210110_11010_SOLARIS64.zip
inflating: README.txt
creating: man1m/
inflating: man1m/ovmtconfig.1m
inflating: man1m/ovmtprop.1m
inflating: man1m/ovmtlibrary.1m
inflating: man1m/ovmtcreate.1m
inflating: man1m/ovmtdeploy.1m
inflating: ovmt-utils1.1.0.1.p5p
root@mars:/tmp/ovmt# pkg install -vg ./ovmt-utils1.1.0.1.p5p ovmtutils
[....]
root@mars:~# ls /opt/ovmtutils/bin
agent dist ovmtconfig ovmtdeploy ovmtprop
bin lib ovmtcreate ovmtlibrary

Now, before we deploy the template, let’s have a short look at what the utilities find in this specific template:

root@mars:~# ovmtdeploy -l ./sol-11_2-ovm-sparc.ova 
Oracle Virtual Machine for SPARC Deployment Utility
ovmtdeploy Version 1.1.0.1.4
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
STAGE 1 - EXAMINING SYSTEM AND ENVIRONMENT
------------------------------------------
Checking user privilege
Performing platform & prerequisite checks
Checking for required services
Named resourced available
STAGE 2 - ANALYZING ARCHIVE & RESOURCE REQUIREMENTS
---------------------------------------------------
Checking .ova format and contents
Validating archive configuration
Listing archive configuration
Assembly
------------------------
Assembly name: sol-11_2-ovm-sparc.ovf
Gloabl settings:
References: zdisk-ovm-template-s11_2 -> zdisk-ovm-template-s11_2.gz
Disks: zdisk-ovm-template-s11_2 -> zdisk-ovm-template-s11_2
Networks: primary-vsw0
Virtual machine 1
------------------------
Name: sol-11_2-ovm-sparc
Description: Oracle VM for SPARC Template with 8 vCPUs, 4G memory, 1 disk image(s)
vcpu Quantity: 8
Memory Quantity: 4G
Disk image 1: ovf:/disk/zdisk-ovm-template-s11_2 -> zdisk-ovm-template-s11_2
Network adapter 1: Ethernet_adapter_0 -> primary-vsw0
Oracle VM for SPARC Template
root-password
network.hostname
network.bootproto.0
network.ipaddr.0
network.netmask.0
network.gateway.0
network.dns-servers.0
network.dns-search-domains.0

We can see that the target domain will have:

  • 8 vCPUs and 4GB of RAM
  • One Ethernet adapter connected to “primary-vsw0”
  • One disk image

It also supports several properties that can be configured after deployment and before the domain is first started.  These are all Solaris properties that one would usually provide during initial system configuration – either manually on the system console or using an AI profile.  We will see later in this article how to populate these properties.

Before we actually go and deploy this, we should check the prerequisites on the platform:

  • Your control domain should be running Solaris 11.3 (or at least 11.2 if you’re using the patch mentioned above).
  • The virtual console service must be configured and running.  If not, set it up now.
    (See here for an example.)
  • A virtual disk service must be available.  If non is there, create one now.

But first, let’s deploy the template without bothering about any details:

root@mars:~# ovmtdeploy -d solarisguest -o /localstore/domains \
/incoming/sol-11_2-ovm-sparc.ova

In this very simple example, the domain we’re creating and installing will be called “solarisguest”.  It’s disk images will be stored in /localstore/domains and it will be installed from the template found in /incoming/sol-11_2-ovm-sparc.ova.

There are a few things to note here:

  • ovmtdeploy will create the domain with resources as they are defined in the template.
  • It will, if necessary, create vswitches to connect network ports.  Make sure to check the result.
  • By default, ovmtdeploy will use flat files for disk images.
  • All of these settings can be overridden with commandline switches.  They allow very sophisticated domain configurations and are not covered here.
  • The domain is started right after the deployment.  Since we didn’t populate the available properties, Solaris will boot in an unconfigured state and request configuartion on the system console.

So let’s do this again, this time providing values for these properties.  This will allow us to boot the domain in a configured state without ever logging in.  What we need for this is a small text file which contains values for these properties:

root@mars:~# more solaris_11.props.values 
# Default hostname
com.oracle.solaris.system.computer-name=solarisguest
# Root user account settings
com.oracle.solaris.root-password='password hash goes here'
# Administrator account settings
com.oracle.solaris.user.name.0=admin
com.oracle.solaris.user.real-name.0="Administrator"
com.oracle.solaris.user.password.0='password hash goes here'
# Network settings for first network instance
# Domain network interface
com.oracle.solaris.system.ifname=net0
# IP Address
# if not set, use DHCP
com.oracle.solaris.network.ipaddr.0=192.168.1.2
com.oracle.solaris.network.netmask.0=24
com.oracle.solaris.network.gateway.0=192.168.1.1
# DNS settings
# (comma separated list of DNS servers)
com.oracle.solaris.network.dns-servers.0=192.168.1.1
# (comma separated list of domains)
com.oracle.solaris.network.dns-search-domains.0=example.com
# System default locale settings
com.oracle.solaris.system.time-zone=US/Pacific
It should be obvious how to populate this file with your own values.  With this file, deployment and configuration is a simple, two step operation:

root@mars:~# ovmtdeploy -d solarisguest -o /localstore/domains \
-s /incoming/sol-11_2-ovm-sparc.ova

This deploys the guest, but doesn’t start it.  That’s what the “-s” commandline switch is for.

root@mars:~# ovmtconfig -d solarisguest \
-c /opt/ovmtutils/share/scripts/ovmt_s11_scprofile.sh \
-P solaris_11.props.values

The script “ovmt_s11_scprofile.sh” is part of the ovmtutils distribution.  ovmtconfig will mount the deployed disk image and call this script.  It will create a configuration profile using the property values given in “solaris_1.props.values”.  This profile will be picked up by solaris at first boot to configure the domain.

With this, you have a solaris guest domain up and running.  If you don’t like it, un-deploy it using “ovmtdeploy -U solarisguest”.  It cleans up nicely.  You could now use this domain as a starting point for developing your own template.  But this will be covered in the next part.

For the curious, here are some additional links and references: