IPS for OpenIndiana and Solaris 11 – UKOUG March

I went to the March LOSUG / UKOUG where Chris Ridd gave a (long) talk about IPS – Image Packagaing System for OpenIndiana and Solaris 11. I have not used IPS so I was interested to see how it differed from the old pkgadd system I am familiar with.

He started out by saying there were little or no design docs for IPS but there are some blog postings by Stephen Hahn, Bart Smaalders and Tim Foster about the original ideas. Unfortunately I have not had time to look for or read them.

The comment was telling though as the impression I got at the end was that IPS was a system which lacked exactly that: a design. As a result, as Chris pointed out, the terminology is odd and key functionality is missing. Security, for example. As I understood it, the main conceptual difference is that unlike other packaging systems there is no “package” as such. What you make is a config file which describes the content, including metadata and how to get the files you need from a repository.

Until I play with it (which might be a while!) I’m not going to pass judgement. It was too much new information for me to absorb in one sitting.

LOSUG – UKOUG February

I missed a few months of LOSUG due to one thing and another so was looking forward to Andrew Watkin’s talk on ‘Solaris 11 Automated Installer Walkthrough’. As usual, an engaging and interesting talk! I hadn’t even realised that Jumpstart was dead, as it quickly transpired in the talk. Jumpstart, Jet, building servers in general was my ‘specialist subject’ for a large part of my Unix sysadmin career. It made me realise how out-of-date my Solaris skills were becoming, not having used it on a daily basis for, well a few years. The last major piece of Solaris work I did was the build engineering for a Solaris 10 rollout and that was all done with Jet and flars.

This new ‘AI’ system in Solaris 11 does seem like work still in progress, although it has been around since 0609. ‘What about images?’, I asked, only to find that no equivalent of flar’s existed in Solaris 11. I really must install some Solaris 11 on my home lab!

P.S. I downloaded the llive DVD and started an install from it. The first stage of the install is transferring cpio files. Perhaps there’s life in the old flar yet!

LOSUG – UKOUG September – and other things

LinkedIn helpfully tells everyone it is 99 days since I wrote a blog post. Thanks LinkedIn. A few non-IT projects have been in progress (and summer holidays as well).

On the IT side, I have recently managed to download ESXi5.0 and install it easily on a USB stick. I’ve imported guests from my datastore and got the appliance based virtual center running. All very easy, I am happy to report!

Touching on IT, I have built a VM and installed Magento e-commerce web shopping software for a related project.

For a client, I have written a few simple load generating scripts in perl to help testing a virtual environment. It’s not as easy as you think to generate memory load. Just assigning a large chunk of RAM doesn’t work as the host operating system (Linux in this case) notices the memory is not being accessed and pages it out over time. You can see it happening in a nice graph in virtualcenter. ESXi will probably try to do something clever too, even if the O/S doesn’t. To keep RAM in use, you need to continuously access it, which I did with random accesses into an array.

I made it along to the September OpenSolaris User Group meeting where Nick Todd gave a talk on the Solaris linker and Alastair Lumsden gave an update on the OpenIndiana project (which I am downloading now).

Nick’s talk was entitled “The Missing Link”. Apt, as we all tend to take that step for granted but there’s a decent amount of engineering in there. It was interesting to note that even in the days of card decks, you nearly always had to “bracket” your deck with pre- and post- instructions to tell the machine what to do with your deck. That concept lives on in the elf file format where executable code is prefixed by crt1 and crtn code.

There are two main aspects of linking: the link editor and the runtime linker and a set of Solaris commands to aid development and debugging, not least of which is “elfdump”.

This talk was fascinating, not least because it simply reminded us that this goes on and contained plently of tips and places for further reading. (I will insert links when I get them).

Alastair gave an update on OpenIndiana (1 year old!) and the upcoming 151a stable release. OpenIndiana is based on Solaris 11 express and Illumos but future releases will fork from Oracle and enable innovation and new features. KVM has been added and GCC will be used as a compiler. The combination of these various technologies: KVM, Qemu, Illumos, ZFS, Crossbow, Zones, Dtrace is a potent mix.

Not least the consideration that the source code is freely available and if you are serious about security there is no substitute for examining and compiling the code yourself. Particularly with recent hacks against the Linux kernel.

LOSUG – UKOUG June: Phil Harman – Virtualisation Fever – Where do you draw the line?

I have a theory that the harder it is to make notes at a talk, the better the talk is. Phil Harman’s talk “Virtualisation Fever – Where do you draw the line?” (a whimsical look at virtualisation) was indeed hard to make notes on and all the more interesting for that.

Phil’s inimitable style keeps you guessing what is coming next and we started with some Hammond organ music (were we in the right talk)? Virtualisation is not new, and it’s not just evident in IT. The B3 Hammond organ is a virtual instrument. It replicated the function of the telharmonium of 1893 which weighed 200 tons and played virtual organ music to people on hold on the phone. Organs themselves, which were introduced in churches hundreds of years ago, were themselves virtual choirs. Stops on organs give hints: Solo vox humana.

Moving forward you have the Roland VR-760 (part of the v series) which is a virtual Hammond organ and you can even get V-drums. There is even a virtual grand piano whose material parameters you can program from a PC. It’s an increasing virtual world and sometimes we can’t tell the difference. Have we gone mad?

We move to a demo of a virtual BBC Micro; great stuff. A program is loaded to calculate if a given number is prime, but it is a bit slow. Partly this is due to the emulator matching the speed of the beeb and partly due to the revelation that the beeb emulator is running in a JVM, in a Solaris zone, in Solaris, in VMware, on a Mac!

Even in a JVM the BBC emulator runs 20x faster than the original, but on a 2.4GHz processor, there is still a factor of 100 in speed missing. A factor caused by virtualisation layers.
We can speed up our program by running it in an obfuscated C interpreter and we can speed it up even more with compiled C code. A speedup from 50 minutes to 15 seconds.

This demonstrates two of Phil’s points: just because something is possible, doesn’t mean it is a good idea and the further away your program gets from the hardware, the more difficult it is to schedule, illustrated with an example of the introduction of threads and lightweight process scheduling in Solaris. Resources have to be scheduled at each level of the stack and the bottom layer can’t see what the layers above are trying to achieve via scheduling. Another way of saying if you want something to go fast, get it as close to the hardware as possible, I suppose.

All the power of modern hardware encourages laziness, inefficiency and waste. The speed of processors hides a multitude of bad programming. I find this very ironic given the argument that virtualisation is driven by goals of greater efficiency i.e. not having a large number of lightly used servers.

Some aspects of virtualisation came in for praise: zones, Ultrasparc T, VMware fusion, Cloud computing, immutable service containers and Exadata.

We have to question why, if a virtual solution is not more efficient, why are we doing it.

By the end of the talk we had headed into the land of Exadata and efficient methods for running databases. Not as whimsical as the start but a fascinating talk!

Thanks Phil, I wish I could have captured more than a fleeting impression of the talk.

Baggage

A colleague asked me the other day how to increase a Linux filesystem on an Esxi guest. This procedure (I hope to post a solution in addition to the others on the web) is in no way simple. And it should be.

The reason that it is not simple is that Linux, and operating systems in general, are carrying so much baggage related to physical infrastructure. LVM, which is standard on Linux to manage disks comes from a lineage of managing large numbers of physical disks. It was not designed to cope with a situation where a machine has one disk and that disk can suddenly increase in size from 20G to 30G. This is a common scenario in a virtual world.

Even disk partitioning itself can be called into question. Take fdisk, which stands for “fixed disk”. Wikipedia informs us that this was introduced by IBM in 1983! Partitioning came along mainly in response to increasing disk sizes and the need to make one physical disk appear as multiple logical disks for convenience.

All this technology was designed to cope with changes in physical capabilities and because we take it for granted it is still baked in to our virtualisation stack. To increase a filesystem on a Linux VM after changing the disk size you need to delete the partition, re-create it (with fdisk); use lvm commands (pvresize, lvextend) to make use of the extra *physical* extents and then grow the filesystem. Jeez.

Now, where did I put my cloud operating system?

 

LOSUG February – DTrace

Finally. I have a chance to write up the interesting introduction to DTrace given to a well attended group by Jim Mauro. This man loves to talk about DTrace, a fact which came across quickly on the night (and he also told us the same)!

I’ve hardly used DTrace myself, having spent the latter part of my Unix sysadmin career mainly on Linux platforms. All the text below is straight from my notes of Jim’s talk. Inaccuracies will be all mine.

First of all: the shameless plug. Yes, The DTrace Cookbook will be available soon – 1200 pages of DTrace tips and recipes. See www.dtracebook.com (actually can’t find this but turned up some youtube videos with Jim talking about the book).

Jim wanted a main take-away from the talk to be that DTrace was complicated, but by neccessity as it was designed to look at complex systems. It is like an MRI scan. The output is complex but, like an MRI scan operator you don’t need much experience to use or learn. Interpreting the output is where experience counts.

Within the DTrace toolkit, which is all open source, you get DTrace plus perl or shell scripts. The three main DTrace components are Probes, Providers and Consumers.

Probes can insert codes dynamically to unmodified running code by altering it’s image in memory. Typically this is done at the entry or exit point of functions.

A Provider is a library of probes and used to manage probes with sensible names, e.g. IO. In Jim’s experience 50% of problems are due to IO. There is a lot of code written to do disk IO and a key question is often who is starting the IO.

Blank fields in a provider specification match all four probe fields. (Unfortunately I didn’t get the examples down. Incidentally the slides should be available from the losug website http://opensolaris.org/jive/forum.jspa?forumID=64).

Consumers are the commands: dtrace, lockstat, plockstat and intrstat.

DTrace User Components: comprise predicates and actions. Traditional performance analysis involves gathering a lot of data followed by 80% of the effort pruning the data down and 20% of the time looking at the resulting good data. Predicates in DTrace do this pruning for you.

A D program: syscall is a very useful provider. e.g. collect some data on entry point of all syscalls. Use D when the cli gets complex. DTrace has aggregating functions and variables. “@” indicates and aggregating variable which are akin to associative arrays – the index is a dtrace variable.

Getting Started: DTrace was created to debug production systems. Previously the right tools were not available. You had to core dump a running system! DTrace is safe and the probe effect is minimal. It has a built-in watchdog which turns DTrace off if it detects problems. DTrace is not necessarily the first tool to use.

Performance Metrics: How Fast (throughput) / How Long (latency) / How Many (IOPS) / How Much (utilisation).

DTrace – Getting the Big Picture: After the “stat” tools, use the “big” providers.

Getting Strated One-Liners: looking at CPU: profile provider, time based data collection. Use an odd number (because housekeeping is done every 10ms). tick can exit a script after a period. Even if you can’t read stack traces, you can get useful hints from looking.

System Metrics – Example: sysinfo procider.

Memory One-Liners: vminfo.

DTrace can “connect the dots”.

Well, that is the end of my notes, which doesn’t seem like much for 90 mins of fast chat. In my defence, Jim is a difficult talker to make notes on and there were a lot of examples! I noticed a camera at the back of the room on my way out so perhaps a video of the event is available from LOSUG.

There is, of course, a wikipedia entry for DTrace which can be found at http://en.wikipedia.org/wiki/DTrace.

While DTrace is undoubtably brilliant, the main drawback is of course that it is not available for more systems.

UKOUG/LOSUG November

Recently I’ve been very busy experimenting with vCloud Director in the office lab. It’s a complex beastie and many thanks to Duncan Epping for his excellent turorials. When I get more experience, I may blog on it but as I have a dozen things to do on my ever growing list, it seems unlikely. One quick note to self though: the strange error I got about a host already being controlled was due to agent confusion and I had to run vslad-uninstall.sh and re-install to fix.

Now, on to the subject. Alastair Lumsden introduced this months UKOUG/LOSUG speakers Tom Kranz and Peter Tribble attended by the usual suspects in the audience. Tom talked about “Exploring Solaris Auto Registration” – that part of Solaris in Update 9 which sends all your machine details to Oracle over the internet, oh yes. Now in 99% of cases you don’t want it to do this so he explained how to disable it and some of the commands involved: stclient, stlisten, stdiscover. All worth reading up on for the professional Solaris Admin.

Peter Tribble’s talk was titled “Sar – past present and future” and, lets face it, “past” is the key word here. No-one was arguing with that point of view but Peter showed a good, simple idea to allow people to keep historical data and use it to assist in problem diagnosis and as a source of graphs for management. Keeping historical data was/is one of sar’s useful aspects. Peter simply keeps kstat -p output and stores it in compressed format for future use. The storage required is not that large and you can quite easily keep a couple of years worth. He has written some tools to scan the compessed logs and mimic the output of stat commands so you can see what “mpstat 10” would have produced at midnight on February 20th last year, if you want.

Perhaps we’ll get a talk on sar’s older brother, process accounting one month 🙂 No, please, just joking.

Next month Alastair is planning workshops, running from late afternoon which could be interesting and in January Jim Mauro is in the country promoting the new dtrace book and we can look forward to a talk from him!

LOSUG September

I attended the Oracle LOSUG meeting on September 15th to hear a talk from Phil Kirk on Zones and Crossbow.

I also took the opportunity to meet Alasdair Lumsden (who has set up openindiana).

I scribbled down a few notes to help jog my memory.

HISTORY

  • Zones were never meant to be like VMs. They were designed as a process container.
  • Zones have a shared I/P stack and routing.
  • There is (typically) a separate I/P alias per zone.
  • IPMP works.
  • Config is done from the global zone.
  • IPfilter works (v4).
  • DHCP, IPsec, raw sockets don’t work.

Some problems with zones:

  • Non-global routing is affected by global routing table. (Some examples).
  • Using a null route is often used to add a gateway entry but this is where global routing table changes can break zones.
  • Default routes are selected round-robin.
  • defrouter option in the zone config just does a route add (nothing clever in the kernel).
  • inter-zone traffic can be forced to go over the wire. Normally it would go via loopback for efficiency but some sites require audit/logging of traffic.

NOW

  • Each zone gets its own I/P stack.
  • Config is done in the zone.
  • Lots of zones need lots of NICs.
  • Can mix shared and exclusive stacks.

CROSSBOW:

  • Virtualisation at the data (mac addr) level. vNICs.
  • vNIC gives b/w resource management (dladm).
  • vlans are supported in Crossbow.
  • P.S. What happened to my complimentary UKOUG membership?

Some progress

I have made some progress and can now boot Centos! Typically though, I did not solve the grub2/centos kernel interaction bug but worked my way round it. I discovered slightly different symptoms by installing a different Centos kernel:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0).

I tried several install experiments with different kernel and boot loader options and finally realised I could install the Centos grub bootloader on the USB stick, which is where the installer wanted to put it anyway.

So it’s cheating a bit because I still have to boot from USB and then boot Centos from the partition on the hard drive. But I don’t care ‘cos it works. Booting from the disk will still load grub2 from the MBR but it’s pretty useless as it can only boot Ubuntu. Maybe it will have more luck with OpenSolaris when I get to it.

Now, one final thing I have to do is re-make my Centos USB stick because I want to install the virtualisation kernel. I no longer boot the installer since it has been over-written with grub. Also I must point at the instructions I used as a starting place http://lists.centos.org/pipermail/centos/2010-May/094933.html or I will forget how I did it. And I will post my version too.

Grub2 pain

I’ve been busy with other things but have spent a few minutes every day for the last several days trying to fix grub2. This program is really annoying me now. I have it courtesy of Ubuntu but will it boot Centos? No.

I have the grub2 menu configured to boot Centos directly, grub2 detects Centos and makes a menu entry for it. This gives “Invalid magic number” when invoked. I also have a menu entry to chainload the Centos grub which gives “Grub disk error”.

There are no useful posts on the fora so I am still stuck.