You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by st...@apache.org on 2012/05/14 04:00:25 UTC

svn commit: r1338032 - in /incubator/tashi/trunk/doc: INSTALL2 sample.qemu-ifup

Author: stroucki
Date: Mon May 14 04:00:24 2012
New Revision: 1338032

URL: http://svn.apache.org/viewvc?rev=1338032&view=rev
Log:
docs: Show how VLANs can be dynamically created and some clutter removed. Fixes TASHI-20.


Added:
    incubator/tashi/trunk/doc/sample.qemu-ifup
Modified:
    incubator/tashi/trunk/doc/INSTALL2

Modified: incubator/tashi/trunk/doc/INSTALL2
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/doc/INSTALL2?rev=1338032&r1=1338031&r2=1338032&view=diff
==============================================================================
--- incubator/tashi/trunk/doc/INSTALL2 (original)
+++ incubator/tashi/trunk/doc/INSTALL2 Mon May 14 04:00:24 2012
@@ -48,6 +48,16 @@ exit 0
 Note that the entire path of a network connection must be configured to 
 use jumbo frames, if the virtual machines are to use them.
 
+If you have large numbers of VLANs, and don't want to hardcode them into
+each VM host, you can find a sample qemu-ifup in the doc directory. This
+script will need to be adapted to your local standards by changing the
+basic parameters at the top. This script can then be linked to by the name
+Tashi expects them to have. For example, if you have a VLAN 1001, you will
+create a link from /etc/qemu-ifup.1001 to this script.
+
+The script will handle the creation of the VM interface, and creation of the
+bridge and VLANs if they haven't been created before.
+
 ---+ Accounting server
 
 An accounting server is available in the distribution. It will log 

Added: incubator/tashi/trunk/doc/sample.qemu-ifup
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/doc/sample.qemu-ifup?rev=1338032&view=auto
==============================================================================
--- incubator/tashi/trunk/doc/sample.qemu-ifup (added)
+++ incubator/tashi/trunk/doc/sample.qemu-ifup Mon May 14 04:00:24 2012
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# by Richard Gass and Michael Stroucken
+
+# Adapt the following two parameters to your installation
+# Uplink interface
+UPLINKIF="eth0"  
+# Prefix for bridge naming
+BRIDGEPREFIX="br"
+
+vlanID=$(echo $0 | awk -F "ifup." '{print $2}')
+vmIf=$1
+
+#  see if tagged interface exists
+bridgeUplinkIf="${UPLINKIF}.${vlanID}"
+cat /proc/net/vlan/config | grep "${bridgeUplinkIf} "
+if [ $? -gt 0 ];then
+        echo "creating tagged interface"
+        vconfig add ${UPLINKIF} ${vlanID}
+        ip link set ${bridgeUplinkIf} up
+fi
+ 
+#  Check for the bridge
+bridgeName="${BRIDGEPREFIX}${vlanID}"
+brctl show | grep "^${bridgeName}"  
+if [ $? -gt 0 ];then
+        echo "creating bridge interface"
+        brctl addbr ${bridgeName}
+        brctl addif ${bridgeName} ${bridgeUplinkIf}
+        ip link set ${bridgeName} up
+fi
+ 
+/sbin/ifconfig ${vmIf} 0.0.0.0 up
+/usr/sbin/brctl addif ${bridgeName} ${vmIf}
+exit 0