ovz template - no venet ootb

Bug #937259 reported by Jeremy Davis
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
TurnKey Linux
Fix Released
Medium
Jeremy Davis
11.x
Fix Committed
Undecided
Unassigned
12.x
Fix Released
Medium
Jeremy Davis

Bug Description

Dominick reports that when launching OVZ templates from the commandline the networking doesn't default to venet.

See here: http://www.turnkeylinux.org/forum/support/20120220/openvz-template-networking-issue

Revision history for this message
Dominick Rivard (dominick-rivard) wrote :

Here is the difference between the initial file and the modified one.

/etc/network/interfaces when the container is created
#-------------------------------------------------------
# UNCONFIGURED INTERFACES
# remove the above line if you edit this file

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp
#-------------------------------------------------------

/etc/network/interfaces when it is manually modified to enable the networking connectivity
#-------------------------------------------------------
# Auto generated lo interface
auto lo
iface lo inet loopback

# Auto generated venet0 interface
auto venet0
iface venet0 inet manual
        up ifconfig venet0 up
        up ifconfig venet0 127.0.0.2
        up route add default dev venet0
        down route del default dev venet0
        down ifconfig venet0 down

auto venet0:0
iface venet0:0 inet static
        address <your_ip_address>
        netmask 255.255.255.255
#-------------------------------------------------------

Regards.

Changed in turnkeylinux:
status: New → Confirmed
Revision history for this message
Alon Swartz (alonswartz) wrote :

Thanks for tracking down the issue, and proposing a fix.

It seems that venet0:0 needs a static IP address, this is kind of a show stopper for a generic solution. Would specifying DHCP be a solution? If not, maybe we could supply a helper script to create the interfaces file by taking an IPADDRESS as an argument. I suppose this is how proxmox does it.

Revision history for this message
Jeremy Davis (jedmeister) wrote :

Yes AFAIK venet does need a static IP.

But I'd be interested to know what a 'normal' Ubuntu (ie non-TKL) OVZ template does. I'm assuming that this behaviour does not occur with them (or otherwise this wouldn't be a bug, it'd just be how it is).

I'm assuming that the line "/usr/sbin/vzctl set <VMID> --ipadd <IPADDRESS> --save" (see this post: http://www.turnkeylinux.org/forum/support/20120220/openvz-template-networking-issue#comment-12292) is meant to set the static IP for venet for the container but obviously it doesn't work with the TKL OVZ templates.

As I posted (http://www.turnkeylinux.org/forum/support/20120220/openvz-template-networking-issue#comment-12299) the Proxmox UI uses that command too, but first runs "vzcreate <VMID> --ipset <IPADDRESS>"... As I have no experience with vanilla OVZ I am unclear whether the "vzcreate" command is a generic OVZ command, or one supplied by PVE.

Revision history for this message
Jeremy Davis (jedmeister) wrote :

Ok, done a little more research...

It looks like the vzcreate command comes from a 3rd party bundle of scripts called vztools. It is available for download (I assume that the PVE devs bundle this in PVE). Have a read here: http://blog.chriswalker.devnetonline.net/2010/01/09/openvz-tools-working-with-openvz-and-virtual-private-systems?page=4

On the following page of that blog post it certainly does appear that the vzctl comand to set the IP should work... And again on the official OpenVZ wiki: http://wiki.openvz.org/User_Guide/Operations_on_Containers#Setting_Network_Parameters

So I assume that we just need to work out why the templates work fine when launched by PVE (and I would assume thus by vzcreate) and not when using vzctl directly. I still think the first step is possibly to compare the /etc/network/interface file from an Ubuntu OVZ template (which networking does work OOTB)...

Changed in turnkeylinux:
assignee: nobody → JedMeister (jedmeister)
importance: Undecided → Medium
Revision history for this message
Jeremy Davis (jedmeister) wrote :

I guess that seeing as I was the one that pushed so hard for OVZ templates, then perhaps I should take this bug on... No promises on timeframe (life is just so crazy ATM) but i will endeavor to have a look at this one in the near future. Although if it proves to be over my head I may have to flick it back to you TKL core guys (or whoever else is keen).

If someone else starts work on this please post here so we aren't duplicating efforts. Perhaps bump the thread here: http://www.turnkeylinux.org/forum/support/20120220/openvz-template-networking-issue if you are hoping for a progress report.

Revision history for this message
Dominick Rivard (dominick-rivard) wrote :

Good Saturday morning,

Jeremy let me help you try to figure this out. Let me know where you would start to investigate and how do you create these OVZ template. I will try giving it a shot to help you fix this issue. Plus it would be my first true participation to FOSS bug fixing, let's do it.
You can find my email address in my launchpad account.

Regards
Dominick

Revision history for this message
Jeremy Davis (jedmeister) wrote :

Hey Dominick. I'm not sure where to go with this as I can't replicate this bug on my PVE server (it works for me even just using the commands you stated). I'll post full details on the forum thread...

Revision history for this message
Dominick Rivard (dominick-rivard) wrote :

Hey Jeremy,

I fixed it, I found what was the issue and how to fix it. Here is why I found what was going on.
Trying the turnkey OVZ template another time, I launched all the command line by hand this time.
I end up getting this warning message:

    Warning: configuration file for distribution turnkey-twiki-11.3-lucid-x86-openvz not found, using defaults from /etc/vz/dists/default

So I start looking in this warning message and fount this forum post:
http://forum.openvz.org/index.php?t=msg&goto=28058&

So it looks like the issue is in the naming convention of turnkey templates and on how OpenVZ set the networking properties based on these names. Probably PVE has added more definition in /etc/vz/dists/ then plain OpenVZ has.

I'll give a quick exemple:
let's take the postgresql template turnkey-postgresql-11.3-lucid-x86-openvz.tar.gz

If you want to work out of the box on vanilla OpenVZ you need to rename it ubuntu-turnkey-postgresql-11.3-lucid-x86-openvz.tar.gz

I also tried to put ubuntu elsewhere in the name but it didn't work.
I attached all the command lines I did after renaming the template, plus you can see that the container is working after that.

So now let's the dev choose the naming convention they want.

Regards.

Revision history for this message
Jeremy Davis (jedmeister) wrote :

Excellent work. Thanks Dominick

Revision history for this message
Jeremy Davis (jedmeister) wrote :

As of the v12.0 release OVZ templates are released only with the PVE naming convention (as opposed to the default TKL naming convention). This eliminates this bug as well.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.