Dwight's one of the major contributors to lxc. One of the things he did a while back, was adding support in lxc-create to understand how to create Oracle Linux images. All you have to do is provide a version number and it will figure out which yum repos to connect to on http://public-yum.oracle.com and download the required rpms and install them in a local subdirectory. This is of course superconvenient and incredibly fast. So... I played with that briefly this morning and here's the very short summary.
Start out with a standard Oracle Linux 6.5 install and uek3. Make sure to add/install lxc if it's not yet there (yum install lxc) and you're good to go.
# lxc-create -n ol65 -t oracle -- -R 6.5.
That's it. lxc-create will know this is an Oracle Linux container, using OL6.5's repository to create the container named ol65.
lxc-create automatically connects to public-yum, figures out which repos to use for 6.5, downloads all required rpms and generates the container. At the end you will see :
Configuring container for Oracle Linux 6.5 Added container user:oracle password:oracle Added container user:root password:root Container : /container/ol65/rootfs Config : /container/ol65/config Network : eth0 (veth) on virbr0 'oracle' template installed 'ol65' created
Now all you need to do is :
lxc-start --name ol65
And you are up and running with a new container. Very fast, very easy.
If you want an OL5.9 container (or so) just do lxc-create -n ol59 -t oracle -- -R 5.9. Done. lxc has tons of very cool features, which I will get into more later. You can use this model to import images into docker as well, instead of using febootstrap.
# lxc-create -n ol65 -t oracle -- -R 6.5 # tar --numeric-owner -jcp -C /container/ol65/rootfs . | \ docker import - ol6.5 # lxc-destroy -n ol65
Since docker relies on cgroups and lxc, it should be easy with uek3. We provide official support for lxc, we are in fact a big contributor to the lxc project (shout out to Dwight Engen) and the docker website says that you need to be on 3.8 for it to just work. So, OL6.5 + UEK3 seems like the perfect combination to start out with.
Here are the steps to do few very simple things:
- Install Oracle Linux 6.5 (with the default UEK3 kernel (3.8.13))
- To quickly play with docker you can just use their example
(*) if you are behind a firewall, set your HTTP_PROXY
-> If you start from a Basic Oracle Linux 6.5 installation, install lxc first. Your out-of-the-box OL should be configured to access the public-yum repositories.
# yum install lxc
-> ensure you mount the cgroups fs
# mkdir -p /cgroup ; mount none -t cgroup /cgroup
-> grab the docker binary
# wget https://get.docker.io/builds/Linux/x86_64/docker-latest -O docker # chmod 755 docker
-> start the daemon
(*) again, if you are behind a firewall, set your HTTP_PROXY setting (http_proxy won't work with docker)
# ./docker -d &-> you can verify if it works
# ./docker version Client version: 0.7.0 Go version (client): go1.2rc5 Git commit (client): 0d078b6 Server version: 0.7.0 Git commit (server): 0d078b6 Go version (server): go1.2rc5
-> now you can try to download an example using ubuntu (we will have to get OL up there :))
# ./docker run -i -t ubuntu /bin/bash
this will go and pull in the ubuntu template and run bash inside
# ./docker run -i -t ubuntu /bin/bash WARNING: IPv4 forwarding is disabled. root@7ff7c2bae124:/#
and now I have a shell inside ubuntu!
-> ok so now on to playing with OL6. Let's create and import a small OL6 image.
-> first install febootstrap so that we can create an image
# yum install febootstrap
-> now you have to point to a place where you have the repoxml file and the packages on an http server. I copied my ISO content over to a place
I will install some basic packages in the subdirectory ol6 (it will create an OL installed image - this is based on what folks did for centos so it works the same (https://github.com/dotcloud/docker/blob/master/contrib/mkimage-centos.sh)
# febootstrap -i bash -i coreutils -i tar -i bzip2 -i gzip \ -i vim-minimal -i wget -i patch -i diffutils -i iproute -i yum ol6 ol6 http://wcoekaer-srv/ol/ # touch ol6/etc/resolv.conf # touch ol6/sbin/init
-> tar it up and import it
# tar --numeric-owner -jcpf ol6.tar.gz -C ol6 . # cat ol6.tar.gz | ./docker import - ol6
List the image
# ./docker images # ./docker images REPOSITORY TAG IMAGE ID CREATED SIZE ol6 latest d389ed8db59d 8 minutes ago 322.7 MB (virtual 322.7 MB) ubuntu 12.04 8dbd9e392a96 7 months ago 128 MB (virtual 128 MB)
And now I have a docker image with ol6 that I can play with!
# ./docker run -i -t ol6 ps aux WARNING: IPv4 forwarding is disabled. USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 1.0 0.0 11264 656 ? R+ 23:58 0:00 ps aux
Way more to do but this all just worked out of the box!
# ./docker run ol6 /bin/echo hello world WARNING: IPv4 forwarding is disabled. hello world
That's it for now. Next time, I will try to create a mysql/ol6 image and various other things.
This really shows the power of containers on Linux and Linux itself. We have all these various Linux distributions but inside lxc (or docker) you can run ubuntu, debian, gentoo, yourowncustomcrazything and it will just run, old versions of OL, newer versions of OL, all on the same host kernel.
I can run OL6.5 and create OL4, OL5, OL6 containers or docker images but I can also run any old debian or slackware images at the same time.
The ISOs are also being mirrored to public external mirror sites, one of them is my own mirror site.
Release notes are here.
Another, much simpler option, is just using yum. It is very easy to take a server and create directories and expose these through apache as repositories. You can have a simple yum config on each server pointing to a few specific repositories. It requires some manual effort in terms of creating directories, downloading packages and creating local repo files but it's easy to do and for many people a preferred solution.
There are also a good number of customers that just connect their servers directly to ULN or to our free update server public-yum. Just to re-iterate, our public-yum servers have all the errata and updates available for free.
Now we added another option. Many of our customers have switched from a competing Linux vendor and they had familiarity with their management tools. Switching to Oracle for support is very easy since we don't require changes to the installed servers but we also want to make sure there is a very easy and almost transparent switch for the management tools as well. While Oracle Enterprise Manager is our preferred way of managing systems, we now are offering Spacewalk 2.0 to our customers. The community project can be found here. We have made a few changes to ensure easy and complete support for Oracle Linux, tested it with public-yum, etc.. You can find the rpms in our public-yum repos at http://public-yum.oracle.com/repo/OracleLinux/OL6/. There are repositories for spacewalk server and then for each version (OL5,OL6) and architecture (x86 and x86-64) we have the client repositories as well. Spacewalk itself is only made available for OL6 x86-64.
Documentation can be found here.
I set it up myself and here are some quick steps on how you can get going in just a matter of minutes:
Spacewalk Server Installation :
1) Installing an Oracle Database
Use an existing Oracle Database or install a new Oracle Database (Standard or Enterprise Edition) [at this time use 11g, we will add support for 12c in the near future]. This database can be installed on the spacewalk server or on a separate remote server.
While Oracle XE might work to create a small sample POC, we do not support the use of Oracle XE, spacewalk repositories can become large and create a significant database workload.
Customers can use their existing database licenses, they can download the database with a trial licence from http://edelivery.oracle.com or Oracle Linux subscribers (customers) will be allowed to use the Oracle Database as a spacewalk repository as part of their Oracle Linux subscription at no additional cost.
|NOTE : spacewalk requires the database to be configured with the UTF8 characterset. |Installation will fail if your database does not use UTF8. |To verify if your database is configured correctly, run the following command in sqlplus: | |select value from nls_database_parameters where parameter='NLS_CHARACTERSET'; |This should return 'AL32UTF8'
2) Configure the database schema for spacewalk
Ideally, create a tablespace in the database to hold the spacewalk schema tables/data;
create tablespace spacewalk datafile '/u01/app/oracle/oradata/orcl/spacewalk.dbf' size 10G autoextend on;
Create the database user spacewalk (or use some other schema name) in sqlplus.
create user spacewalk identified by spacewalk; grant connect, resource to spacewalk; grant create table, create trigger, create synonym, create view, alter session to spacewalk; grant unlimited tablespace to spacewalk; alter user spacewalk default tablespace spacewalk;
4) Spacewalk installation and configuration
Spacewalk server requires an Oracle Linux 6 x86-64 system. Clients can be Oracle Linux 5 or 6, both 32- and 64bit. The server is only supported on OL6/64bit.
The easiest way to get started is to do a 'Minimal' install of Oracle Linux on a server and configure the yum repository to include the spacewalk repo from public-yum.
Once you have a system with a minimal install, modify your yum repo to include the spacewalk repo.
edit /etc/yum.repos.d/public-yum-ol.repo and add the following lines at the end of the file :
[spacewalk] name=spacewalk baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/spacewalk20/server/$basearch/ gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=1
Install the following pre-requisite packages on your spacewalk server :
oracle-instantclient11.2-basic-220.127.116.11.0-1.x86_64 oracle-instantclient11.2-sqlplus-18.104.22.168.0-1.x86_64 rpm -ivh oracle-instantclient11.2-basic-22.214.171.124.0-1.x86_64 rpm -ivh oracle-instantclient11.2-sqlplus-126.96.36.199.0-1.x86_64The above RPMs can be found on the Oracle Technology Network website :
As the root user, configure the library path to include the Oracle Instant Client libraries :
cd /etc/ld.so.conf.d echo /usr/lib/oracle/11.2/client64/lib > oracle-instantclient11.2.conf ldconfig
Install spacewalk :
# yum install spacewalk-oracleThe above yum command should download and install all required packages to run spacewalk on your local server.
| NOTE : if you did a full, desktop or workstation installation, | you have to remove the JTA package | BEFORE installing spacewalk-oracle (rpm -e --nodeps jta)
Once the installation completes, simply run the spacewalk configuration tool and you are all set. (make sure to run the command with the 2 arguments)
spacewalk-setup --disconnected --external-db
Answer the questions during the setup, ensure you provide the current database user (example : spacewalk) and password (example : spacewalk) and database server hostname (the standard hostname of the server on which you have deployed the Oracle database)
At the end of the setup script, your spacewalk server should be fully configured and you can log into the web portal. Use your favorite browser to connect to the website : http://[spacewalkserverhostname]
The very first action will be to create the main admin account.
Release 5.1 introduces a number of bug fixes and smaller changes but the most interesting one is definitely increased support for html5-based client access. In SGD 5.0 we added support for Apple iPads using Safari to connect to SGD and display your session right inside the browser. The traditional model for SGD is that you connect using a webbrowser to the webtop and applications that are displayed locally using a local client (tta). This client gets installed the first time you connect. So in the traditional model (which works very well...) you need a webbrowser, java and the tta client. With the addition of html5 support, there's no longer a need to install a local client, in fact, there is also no longer a need to have java installed. We currently support Chrome as a browser to enable html5 clients. This allows us to enable html5 on the android devices and also on desktops running Chrome (Windows, MacOS X, Linux).
Connections will work transparently across proxy servers as well. So now you can run any SGD published app or desktop right from your webbrowser inside a browser window. This is very convenient and cool.
I think we have a very compelling and simple pricing model for both Oracle Linux and Oracle VM. Let me see if I can explain it in 1 page, not 10 pages.
This pricing information is publicly available on the Oracle store, I am using the current public list prices. Also keep in mind that this is for customers using non-oracle x86 servers. When a customer purchases an Oracle x86 server, the annual systems support includes full use (all you can eat) of Oracle Linux, Oracle VM and Oracle Solaris (no matter how many VMs you run on that server, in case you deploy guests on a hypervisor). This support level is the equivalent of premier support in the list below.
Let's start with Oracle VM (x86) :
Oracle VM support subscriptions are per physical server on which you deploy the Oracle VM Server product.
The above includes the use of Oracle VM Manager and Oracle Enterprise Manager Cloud Control's Virtualization management pack (including self service cloud portal, etc..)
24x7 support, access to bugfixes, updates and new releases. It also includes all options, live migrate, dynamic resource scheduling, high availability, dynamic power management, etc
If you want to play with the product, or even use the product without access to support services, the product is freely downloadable from edelivery.
Next, Oracle Linux :
Oracle Linux support subscriptions are per physical server.
If you plan to run Oracle Linux as a guest on Oracle VM, VMWare or Hyper-v, you only have to pay for a single subscription per system, we do not charge per guest or per number of guests. In other words, you can run any number of Oracle Linux guests per physical server and count it as just a single subscription.
So that's it. Count number of 2 socket boxes, more than 2 socket boxes, decide on basic or premier support level and you are done. You don't have to worry about different levels based on how many virtual instances you deploy or want to deploy. A very simple menu of choices. We offer, inclusive, Linux OS clusterware, Linux OS Management, provisioning and monitoring, cluster filesystem (ocfs), high performance filesystem (xfs), dtrace, ksplice, ofed (infiniband stack for high performance networking). No separate add-on menus.
NOTE : socket/cpu can have any number of cores. So whether you have a 4,6,8,10 or 12 core CPU doesn't matter, we count the number of physical CPUs.
As many of you know, we are now using a CDN to distribute the RPMS for public-yum globally so you should have good bandwidth everywhere to freely access the RPMs.
We have worked closely with Microsoft to ensure that we can deploy Oracle Linux inside their Azure platform (and also just in general on Hyper-v). Part of the work is to provide templates that include Oracle products such as Oracle RDBMS and Oracle WebLogic on Oracle Linux in Azure. This is a similar concept as Oracle VM templates. You can go through the catalog on Azure, select a template and a few minutes later you end up with a complete running Virtual Machine. These templates with Oracle products are available for both Windows and Oracle Linux environments.
Microsoft has a free trial offering which I tried out last night (with my personal account) and within a few minutes and no prior knowledge of how their environment works, I had an Oracle Linux 6 update 4 instance up and running. Logged in using ssh. They have a very easy to navigate portal. We have configured Oracle Linux out of the box with public-yum for updates. So if you need an enterprise grade Linux distribution on Azure that comes with free updates/errata and fast connectivity to the update servers, go use Oracle Linux. And the nice thing is, if you need support for some of those VM's deployed, you just pay for those VM's you want support for.
This is also nice for ISVs that want to provide their own application solutions in Azure, they can use Oracle Linux and embed it in their VM with their app and, again, an enterprise grade solution that can be freely used without signing contracts with us, and be current with updates and errata. If the ISV then wants support, they can resell Oracle Linux subscriptions. This is a very simple, open, hassle-free solution.
It is very easy to get started with this and play around with the new features. Just takes a few steps :
Oracle Linux is freely downloadable from http://edelivery.oracle.com/linux. Oracle Linux is free to use on as many systems as you want, is freely re-distributable without changing the CD/ISO content (so including our cute penguin), provides free security errata and bugfix errata updates. You only need to pay for a support subscription for those systems that you want/need support for, not for other systems. This allows our customers/users to run the exact same software on test and dev systems as well as production systems without having to maintain potentially two kinds of repositories. All systems can run the exact same software all the time.
The free yum repository for security and bugfix errata is at http://public-yum.oracle.com. This site also contains a few other repositories :
Now, back to UEK3 beta. Just a few steps are needed to get started.
I will assume you have already installed Oracle Linux 6 (update 4) on a system and it is configured to use public-yum as the repository.
First download and enable the beta repository.
# cd /etc/yum.repos.d/ # wget http://public-yum.oracle.com/beta/public-yum-ol6-beta.repo # sed -i s/enabled=0/enabled=1/g public-yum-ol6-beta.repo
You don't have to do sed you can just edit (vi/emacs) the repo file and manually set it to 1 (enable). Now you can just run yum update
# yum update
This will install UEK3 (3.8.13-13) and it will update any relevant packages that are required to be on a later version as well. At this point you should reboot into UEK3.
New features introduced in UEK3 are listed in our release notes. There are tons of detailed improvements in the kernel since UEK2 (3.0 based). Kernelnewbies is an awesome site that keeps a nice list of changes for each version. We will add more detail to our release notes over time but for those that want to browse through all the changes, check it out.
To try out dtrace, you need to install the dtrace packages. We introduced USDT in UEK3's version of dtrace, there is some information in the release notes about the changes.
# yum install dtrace-utils
To try out lxc, you need to install the lxc packages. lxc is capable of using Oracle VM Oracle Linux templates as a base image to create a container.
# yum install lxc
Simultaneously, Saar updated his Oracle VM templates to include these latest patchsets as well for both architectures (x86 and x86_64).
These templates can be deployed on Oracle VM using the DeployCluster tool, all you need to do is create a very simple textfile with the parameters.
All templates default to UEK2 2.6.39-400. The templates can be used to create Single Instance, Single Instance with HA (Oracle Restart) and Oracle RAC databases.
The options vary from ASM, NFS, OCFS2 for db files, local filesystem, no DB, Clusterware only etc.
Full stack, download, deploy. Production RDBMS code, Production Oracle Linux.
Simple Sample script:
# cat netconfig.ini NODE1=server3 NODE1IP=10.0.0.4 PUBADAP=eth0 PUBMASK=255.255.255.0 PUBGW=10.0.0.1 DOMAINNAME=wimmekes.net # May be blank DNSIP=10.0.0.1 # Starting from 2013 Templates allows multi value CLONE_SINGLEINSTANCE=yes # Setup Single Instance
and then # deploycluster -u admin -p mypassword -H localhost -M mydbvm1 -> done
The little snmp module I added exposes a few extra Oracle VM specific objects. To start with I basically looked at the data you can see on the local console of the server (version, cluster state, management uuid,...). I created a custom MIB (falls in the oracle enterprise oid range ( 188.8.131.52.184.108.40.206.1.1 – 220.127.116.11.18.104.22.168.1.13 )) and packaged it all up in a little RPM (ovs-snmp.rpm) that can be installed in dom0.
ovs-snmp is an extension to net-snmp. It is a dynamically loadable module that allows extra bits to be monitored in dom0 that are specific to Oracle VM. Once the RPM is installed, snmpd.conf must be updated to load the module at start of snmpd. When you restart the snmpd service, you then have access to an extra MIB.
This extra MIB is documented in /usr/share/snmp/mibs/OVS-MIB.txt The raw oid range for the OVS extension is from 22.214.171.124.126.96.36.199.1.1 – 188.8.131.52.184.108.40.206.1.13. The module also contains a trap at 220.127.116.11.18.104.22.168.2.0. The trap is defined around ovsAgentState (Running/Stopped) and will allow an admin to monitor the state of the Oracle VM Server agent which is a critical component of every server installed and get a notification from the snmpd.
If you copy the OVS-MIB.txt file over to another regular server and put the file in the same directory (/usr/share/snmp/mibs) then you can use the text version instead of the raw oid numbers. For instance : 22.214.171.124.126.96.36.199.1.1 is the same as : ORACLE-OVS-MIB::ovsType. This is more humanly readable.
The following set of attributes are defined in the MIB :
ovsType : Oracle VM Server ovsVersion : Version of Oracle VM Server installed ovsMaster : Master node in serverpool? ovsClusterState : Cluster configured / online? ovsClusterType : NFS or Lun based ovsClusterStorage : the nfs mount or lun used for the server pool filesystem ovsManagerUUID : UUID of the Oracle VM Manager instance ovsServerpoolName : serverpool name this server is a member of (or None) ovsServerpoolIP : Virtual IP address of the serverpool master ovsAgentState : Agent running or stopped ovsFreeMemory : free memory available for Virtual Machines on this server ovsHostname : hostname as known by the Oracle VM Manager instance vmTable : table with an index listing all the currently running VMs columns -> vmIndex, vmType
example snmpd.conf file:
# more /etc/snmp/snmpd.conf rocommunity public syslocation "hq" dlmod ovs /usr/lib64/ovs-snmp/ovs.so
Some examples :
# snmpwalk -v 1 -c public -O e localhost ORACLE-OVS-MIB::ovsAgentState ORACLE-OVS-MIB::ovsAgentState.0 = STRING: Running # snmpwalk -v 1 -c public -O e localhost 188.8.131.52.184.108.40.206.1.1 SNMPv2-SMI::enterprises.220.127.116.11.0 = STRING: "Oracle VM Server "You can download the rpm from MOS, bug number is 17344092. At this point it's provided as-is, tech preview. Once I get some feedback on it we will consider integrating this.