TurnKey Linux Virtual Appliance Library

Plans for TKL OpenVZ Templates?

Jeremy's picture

Following on from discussion in a topic below (Virtualisation Appliance) I have been testing out Promox VE and its a winner! It does require fairly new hardware (64-bit with Intel/AMD CPU virtual extention) but if you've got a system like that I think its well worth a look as a server platform for install TKL (and other) VMs.

I think it would be a good prototype for Turnkey Linux VE! (If devs choose to tread that path). If someone with the know how could find/modify/design/construct a web interface like theirs you could set it up (like they have) to link to the Turnkey Appliance ISOs from within the web interface (in the download section). Awesome! Or I guess another idea, perhaps Turnkey Linux could offer the Appliance ISOs to the Proxmox Devs?

That brings me to my question, are there any plans to also offer TKL Appliances as OpenVZ Templates? (ie rather than just ISOs.) That would be really handy for me!

Promox have a cool looking tool: 'Debian Appliance Builder' which I was hoping to use to convert TKL Appliances to OpenVZ templates, but unfortunately it only works on 64-bit versions of Ubuntu/Debian. So at this point it looks like I'll have to create my own template from installed TKL Appliance VMs - bugger! I will document my progress and add it to the wiki to help others (and devs?) create TKL OpenVZ templates (assuming I can nut it out).

For devs it may be worthy to note that basic (minimal) OpenVZ templates are downloadable here. The recent (2009-05-19) 32/64 bit ubuntu 8.04 templates (107/110 MB respectively) are there, scroll down for the old (2008-05-13) minimal templates (46/45 MB respectively).

 

Alon Swartz's picture

Thanks and yes, we do

Thanks for the informative post.

Yes, we do have plans to offer appliances in virtualization ready packages, such as openvz and others, hopefully sooner than later but help from the community will definitely push it forward.

Keep us posted on your progress!

Jeremy's picture

TKL Core - OpenVZ Template - Done!

After hours of mucking around and a little testing I have hacked together an OpenVZ template of TKL Core. I haven't done extensive testing but it all seems to be working fine. Webmin works, SFTP works and so does SSH. One thing I have noticed that no longer works though is the network config options when you startup a default TKL system (it boots straight to the console - this maybe more to do with the way OpenVZ works though rather than a problem - not sure). It doesn't worry me though so I haven't tried to fix it. I have installed a few things (using apt-get) and they seem to work so looks very promising so far.

I have documented the steps I took to successfully create the template here on the wiki I have also created a blueprint here.

As OpenVZ VMs share some resources (and the kernel) with the host OS they run extremely quickly and use minimal resources. When I installed TKL Core as a VM (under KVM) it used 76MB RAM with no load, TKL Core running on OpenVZ (from the template I made) uses only 9MB!

Alon Swartz's picture

Very useful information

This is great, and will definately push openvz template support forward!

Regarding the configuration console, could you try starting it manually and posting any error messages that are displayed.

/usr/bin/confconsole
Jeremy's picture

Starts fine but some strange behaviour

I love remote access! I'm not at home at the moment but I was able to SSH in and check.

When I started it manually it appeared to be fine. Although interestingly it displayed the IP address as 127.0.0.1, and the subnet as 255.255.255.255 (incorrect) and the default gateway as 192.168.2.1 (all my internal IPs are on 192.168.1.xxx). The nameserver was correctly identified as my router.

Initially I tried a few things and everytime I adjust any settings I lost contact. I suspect that there maybe some conflict between the OpenVZ and/or Proxmox configuration. Perhaps it is something to do with the nature of OpenVZ containers? Or perhaps I've stuffed something up when I created the template (like removed something that the config console relies on)?

After a little more pondering, I realised that I can inspect some of the logs through the Proxmox Web Interface and found some stuff that may be relevant:

  • VM Boot log:
    * Setting up resolvconf... /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf

I don't think this is relevant but thought I'd include it just in case.

  • Proxmox Command log:

/usr/sbin/vzctl start 103
Starting container ...
Container is mounted
Adding IP address(es): 192.168.1.53
Setting CPU units: 1000
Setting CPUs: 1
Configure meminfo: 196608
Set hostname: tester.home.net
File resolv.conf was modified
Setting quota ugidlimit: 0
Container start in progress...
VM 103 started

  • VM Syslog: It clearly notes not one, but 5 network interfaces (numbered #0 to #4) they are configured as follows:

#0 wildcard, 0.0.0.0#123 Disabled

#1 wildcard, ::#123 Disabled

#2 lo, ::1#123 Enabled

#3 lo, 127.0.0.1#123 Enabled

#4 venet0:0, 192.168.1.53#123 Enabled

I don't 100% understand all this but I suspect #1 & #2 are for IPv6 and I know that venet is the virtual ethernet device that OpenVZ offers to the VM. Obviously from this log the TKL Config Console is configuring #3 while the one that it needs to configure is #4. Does it just try to configure the first enabled ethernet device it encounters? Can I change this behaviour? If so where would I find config settings for Config Console so I can test my theory?

PS I have noted a few errors in the boot log that I will investigate too. Obviously nothing major but it would be nice to fix them if possible.

PPS I have tried to fix the errors and have now borked network contact altogether, so that is the end of my remote testing until I can get local access.

Jeremy's picture

Update

I have resolved a few bugs and updated the wiki.

I have also found that the config console works fine if I do not use Proxmox to set the vnet0 IP directly and just use the bridged ethernet connection. It then defaults to DHCP and is configurable through the config console as usual. The console does still not auto start though. Perhaps it is something I removed?

Liraz Siri's picture

Excellent work

I've just taken a look at the page JedMeister set up on the wiki. Hats off to him for going the extra mile in documenting his research. This kind of experimental effort is a big help in adding OpenVZ support ASAP. I'm not sure we'll manage to squeeze that into the next release because we're already a bit overloaded, but if not, then hopefully soon after. Good stuff!

Jeremy's picture

Thanks for your acknowledgement!

Thanks for your acknowledgement! But thanks to you for thinking of and bulding the TKL appliances in the first place. It has provided me with a footing to start looking into the Linux world!

On another note, I have now tested the exact same steps I used (as detailed on the wiki, links above) to create OpenVZ templates of TKL-LAMP and TKL-MediaWiki and both seem to be working just as well as Core did/does. I will make note of this on the wiki too.

Thanks again to alon and liraz on the great product they've developed, namely TKL!

Jeremy's picture

Known bug - samba nogo :-(

I have discovered that samba will not run inside my OpenVZ template :-(

To test whether it is something I broke, I used an OpenVZ template straight from OpenVZ and it works. So its obviously something I've broken. It does the first part of the install ok, but then came up with a dpkg error (1) and  [fail]ed to start! I spent lots of time trying to work out how to fix it or workaround it in someway but no dice at this stage. As a bit of a Linux noob its all too much for me. If anyone feels like giving me some pointers, I posted full details on the Ubuntu forums here - I posted it there because this setup is such a hybrid (read mutt - TKL iso, converted into OpenVZ template, a Debian package, Webmin direct from their site, all running on Proxmox server) that Ubuntu was the only common denominator. So far there has not been any response but if anyone has ideas I'd love to hear them.

So, trying to skin this cat another way.... I have a question for liraz and alon:

If I install a minimalist Ubuntu and add the TKL repo into my souces list, if I install all packages that are present in TKL Core (using the manifest)- what else would I need to do to make it "TKL - Core"? If I do this then I can build a proper TKL Core OpenVZ template.

Alon Swartz's picture

Samba is a complex beast

Samba is a complex beast in itself, but it works on TKL without a hitch (we have a couple of appliances that use samba in the upcoming release).

I looked over your post on the ubuntu forums, and I would recommend you try reconfigure samba, and if that doesn't work, try running the post installation scripts manually and see where it errors out:
# reconfigure samba package
dpkg-reconfigure samba

# post installation script
/var/lib/dpkg/info/samba.postinst
With regards to your "minimalist" question, the minimal ubuntu install includes quiet a bit of stuff that is not included in turnkey core, but you should be able to reach a pretty close result by using the manifest as a base line. There are ofcourse various tweaks in core that you will have to do manually, but I personally would try and debug the samba issue instead.
Jeremy's picture

Thanks for your guidance

I was aware that it wasn't a TKL Core issue, (sorry I neglected to mention that) and my testing has shown it isn't an OpenVZ/Ubuntu error. This confirmed it is something specific with the template I created. I had a suspicion that it may have been something with the Debian procps package I installed, but simply removing it and reinstalling the Ubuntu one (which reintroduces the procps bug) did not solve it.

Thanks for your thoughts. That has given me something to work with. Seeing as I have got nothing from the Ubuntu forum post, I think I will bump the thread over there with a link back to here, and keep posting here with my progress if thats ok?

Thanks again.

Alon Swartz's picture

ofcourse

Ofcourse, sounds like a plan. The new appliances with samba should be good test case to see if everything works. Another tip I can offer is to install samba in a different virtual environment (eg. virtualbox) and use it as a reference.

Again, hats off to you for going the extra mile in documenting your research, finding and working through these issues. It will be a big help when in adding OpenVZ support.
Jeremy's picture

Thanks

I have posted a link back to here on the Ubuntu forums.

I just tried

dpkg-reconfigure samba

and got this response

/usr/sbin/dpkg-reconfigure: samba is broken or not fully installed

I then tried

/var/lib/dpkg/info/samba.postinst

and got this response

postinst called with unknown argument `'

That seemed strange to me. I thought I may have copied something extra acidentally, but I tried typing it in (rather than copy/paste) and got the same response!? Obviously something seriously broken!

As for installing in a different environment, Proxmox also has KVM so I can install the original TKL.iso inside that to create a reference system (thats what I used to create the original template). Thats what you meant wasn't it?

Looks like I'll have to do a bit more googling and learn about how deb packages install and how to debug install probs. Anything else that jumps out at you or ideas for good sites that might help make my learning curve not so steep?

Alon Swartz's picture

try this...

dpkg-reconfigure --force samba
/var/lib/dpkg/info/samba.postinst configure
Jeremy's picture

not getting closer to a solution

Ok I was just writing a longish post but no need now, I've worked out what it is! (or close anyway) Its something that samba needs from /dev.

I installed samba into the "minimal" template. It has the same errors, except that samba runs ok. So I copied across the /dev from that VM to /dev in my template. I ran your first command and now samba starts [OK]!

I'm not sure how I'm going to work out which file(s) it is. I'll compare the two /dev folders and see what I see I guess.

I take it all back. I'm tired and I just realised that I've only been working on the "minimal' template! Doh! Ok tired.... got to go to bed!

Jeremy's picture

another bug bites the dust!

Despite my tiredness I was on the right track last night.... Problem was /dev/random was missing so samba couldn't generate random numbers. Reason why most other apps were working fine is that most use /dev/urandom instead.

I have recreated the /dev/random file and samba now works fine (well it still has those premission errors on install, but it runs).

I have updated the wiki.

Choose right kernel

OpenVZ is great system, I use it and will prefer it, not VMWare appliance. Perhaps turnkey developers will prefer to use RHEL5 kernel for openVZ appliance.  See this thread:

http://forum.openvz.org/index.php?t=rview&goto=38030&th=8077#msg_38030

They say 8.04 works nice with it. Personally I use openvz from hardy repos and did not see any problems. Would it be RHEL or standard ubuntu-vz kernel, openVZ appliance is a must!

OpenVZ Templates

It would be awesome if these templates could be converted into openvz cache templates. This place would attract the 10's of thousands of openvz users.

Liraz Siri's picture

It's on the todo list

We'd like to support OpenVZ officially we just haven't gotten around to it yet. Adding support for OpenVZ requires setting up a testing environment, and integrating support for it into our appliance build infrastructure to produce another set of images.

When everything is said and done it still adds to our overhead on release, but I think once we get past that hurdle the extra overhead will be worth it.

What kind of overhead are you

What kind of overhead are you looking at. Are you looking at extra 'time' overhead, or actual costs of needing a testing server? If it's hardware to test on, I may be able to help out.


Liraz Siri's picture

Labor overhead. Time is the main bottleneck

In order to develop official support for a new target we need to setup a test environment for it, figure out how to automate the conversion process, and integrate with our release process. Note that anything that adds to complexity of the release process will permanently increase the amount of labor overhead required to push out a release. Additionally, I understand there are a few OpenVZ specific issues that need to be worked out (e.g., with Java).

Any kind of community support would be a big help in making this happen. In an ideal world an OpenVZ guru from the community would develop an automatic conversion script (e.g., leveraging tklpatch) that can take an ISO and spit out an OpenVZ template. The OpenVZ community would help test these appliances and figure out workarounds to any open issues. At that point we would either document the process on the web site for the benefit of others, update the web site to add support for another target format (e.g,. in addition to VM and ISO), or maybe setup an rsync mirror with prefabricated images/templates just for hosting providers.

Jeremy's picture

FYI There are unofficial ones available

You can find unofficial TKL OpenVZ appliance templates ready for download here. Info and discussion about these can be found here on the TKL forums (release notes I guess).

Jeremy's picture

Lucid as OpenVZ guest is not supported :(

So creating an OpenVZ template based on the new TKL beta will be a little tricky. I have updated the TKL Dev Wiki page to reflect this.

As I noted on the Wiki, the best instructions I have found so far are a blog post here. If anyone else has a play and has anything useful to add I'd love to hear about it!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)