configurable VLAN tagging

Bug #398867 reported by Chris Jones
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Eucalyptus
Fix Released
Wishlist
chris grzegorczyk

Bug Description

From #eucalyptus scrollback:

[16:42] < Ng> ideally I'd like to be able to tell eucalyptus that it has a
              particular pool of tags, since the machines are on switches with
              pre-existing vlans
[16:44] < dmitrii> Understandable. Currently Eucalyptus assumes that all vlan
                   tags are fair game. It makes sense to make that configurable.
                   We'll note that as a feature request.

The rough topology of our switch is that VLANs 0-5 are already occupied and the ports the Node Controller machines will be connected to will have precisely no access to those VLANs for security reasons, so I need to be able to tell Eucalyptus to use VLANs 6-20 (for the sake of argument, it could be any number really) so I can pre-configure the switch to allow the NC ports to use those tags.

Chris Jones (cmsj)
Changed in eucalyptus:
importance: Undecided → Wishlist
status: New → Confirmed
Changed in eucalyptus:
assignee: nobody → Daniel Nurmi (nurmi)
Revision history for this message
robb1e (robert-clutton) wrote :

We've made some changes in this area so in our configuration file we have added the following values:

MIN_VLAN_ID="10"
MAX_VLAN_ID="969"

This allows Eucalyptus to use VLANS betwen these two numbers. This gives us test and development environments on the same network. I can share the changes here if you'd like to see?

Revision history for this message
Chris Jones (cmsj) wrote :

robb1e: I'd be interested to see them, at least.

Revision history for this message
robb1e (robert-clutton) wrote :
Download full text (6.1 KiB)

@Chris,

In the Cluster.java constructor:

    public Cluster(ClusterInfo clusterInfo) {
        this.eucalyptusConfigurationFileParser = new EucalyptusConfigurationFileParser();
        String minVlanId = eucalyptusConfigurationFileParser.getValue("MIN_VLAN_ID", "10");
        String maxVlanId = eucalyptusConfigurationFileParser.getValue("MAX_VLAN_ID", "4096");

        this.clusterInfo = clusterInfo;
        this.state = new ClusterState(this, Integer.parseInt(minVlanId), Integer.parseInt(maxVlanId));
        this.nodeState = new ClusterNodeState(this);
        this.messageQueue = new ClusterMessageQueue(this);
        this.rscUpdater = new ResourceUpdateCallback(this);
        this.addrUpdater = new AddressUpdateCallback(this);
        this.vmUpdater = new VmUpdateCallback(this);
        this.nodeLogUpdater = new NodeLogCallback(this);
        this.nodeCertUpdater = new NodeCertCallback(this);
        this.nodeMap = new ConcurrentSkipListMap<String, NodeInfo>();
    }

Then in ClusterState constructor:

    public ClusterState(Cluster parent, int minVlanId, int maxVlanId) {
        this.parent = parent;

        LOG.info(String.format("Using min vlan id of %d, and max vlan id of %d", minVlanId, maxVlanId));
        this.availableVlans = new ConcurrentSkipListSet<Integer>();
        for (int i = minVlanId; i < maxVlanId; i++)
            this.availableVlans.add(i);
    }

Then a new configuration file reader:

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class EucalyptusConfigurationFileParser {
    private static Log LOG = LogFactory.getLog(EucalyptusConfigurationFileParser.class);
    private static final String DEFAULT_RELATIVE_CONFIG_FILE_PATH = "/etc/eucalyptus/eucalyptus.conf";
    private static final String eucaHome = System.getProperty("euca.home");
    private String absoluteConfigurationFilePath;
    private Map<String, String> configMap = new HashMap<String, String>();

    public EucalyptusConfigurationFileParser() {
        this(eucaHome + DEFAULT_RELATIVE_CONFIG_FILE_PATH);
    }

    public EucalyptusConfigurationFileParser(String absoluteConfigurationFilePath) {
        this.absoluteConfigurationFilePath = absoluteConfigurationFilePath;
        LOG.info(String.format("Set euca config file absolute path to %s", this.absoluteConfigurationFilePath));

        loadConfig();
    }

    public String getValue(String key) {
        return getValue(key, null);
    }

    public String getValue(String key, String defaultValue) {
        String value = configMap.get(key);
        if (value == null)
            return defaultValue;
        return value;
    }

    protected void loadConfig() {
        LOG.info(String.format("Loading euca config from %s", absoluteConfigurationFilePath));
        try {
            FileInputStream fileInputStream = new FileInputStream(new File(absoluteConfigurationFilePath));
            BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStre...

Read more...

Revision history for this message
Matt Sayler (sayler) wrote :

We're building a test cluster here on some fairly nice blades (64bit, 16GB/8 cores each). This is a requirement for us once we get up and running.

Revision history for this message
chris grzegorczyk (chris-grze) wrote :

Hi All,

We are happy to put something in to control this but it is too late for 1.5.2 which we are trying to get out the door.

The work around suggested can be greatly simplified as follows, consider if this is good enough:

1. Use "euca." as the prefix of the variable set in 'eucalyptus.conf': euca.CLUSTER_MIN_VLAN=100 and euca.CLUSTER_MAX_VLAN=2048

2. Set the values appropriately in ClusterState's constructor along the lines of:

    Integer minVlan = 10, maxVlan = 4096;
    try {
      minVlan = new Integer( System.getProperty( "euca.CLUSTER_MIN_VLAN" ) );
      maxVlan = new Integer( System.getProperty( "euca.CLUSTER_MAX_VLAN" ) );
    } catch ( NumberFormatException e ){}
    for ( int i = minVlan; i < maxVlan; i++ ) this.availableVlans.add( i );

There is an issue wrt to requriements for future versions where this may not be a sustainable approach.
I hope this can serve as a suitable stop-gap remedy meanwhile.

If you happen to try it, let me know if it works out.

thanks.
chris

Revision history for this message
Chris Jones (cmsj) wrote :

chris: I applied the patch you suggested, added the following to /etc/eucalyptus/eucalyptus.conf:

root@curium:~# grep VLAN /etc/eucalyptus/eucalyptus.conf
CLUSTER_MIN_VLAN=11
CLUSTER_MAX_VLAN=19

and restarted the cluster/cloud controllers, but it still seems to be starting with a vlan of 10. I'll check over my patching/building again to be sure. Is there a simple logging call I could add in that would confirm it's definitely running the right code?

The file to be changing that in is ./clc/modules/cluster-manager/src/edu/ucsb/eucalyptus/cloud/cluster/ClusterState.java in the ubuntu source package, right?

Revision history for this message
Neil Soman (neilsoman) wrote :

Chris (Jones),

as suggested by Chris, you need to use the prefix "euca."

So in your case, the options should read,

euca.CLUSTER_MIN_VLAN=11
euca.CLUSTER_MAX_VLAN=19

Did you try that?

thanks
neil

Revision history for this message
Chris Jones (cmsj) wrote :

Neil: I did, but it seems like the eucalyptus.conf is executed as a shell script to set environment variables, and . isn't valid in those, so it was producing errors from the init scripts. I guessed that the euca. was somehow unnecessary.

Revision history for this message
chris grzegorczyk (chris-grze) wrote :

Doh :(

A quick workaround which might hold you over is to just add this to '/etc/eucalyptus/cloud.d/cloud.xml' as a property along the lines of:

    <property name="euca.CLUSTER_MIN_VLAN" value="11"/>

Rest assured this will be configurable in v1.6.

chris

Revision history for this message
Chris Jones (cmsj) wrote :

chris: thanks that worked. I've attached the debdiff in case anyone else wants it (note that I've hardcoded the property in cloud.xml in the build to start at 11).

Changed in eucalyptus:
assignee: Daniel Nurmi (nurmi) → chris grzegorczyk (chris-grze)
Revision history for this message
chris grzegorczyk (chris-grze) wrote :

------------------------------------------------------------
revno: 928
committer: decker <decker@personal-army>
branch nick: 1.6
timestamp: Tue 2009-10-13 14:34:50 -0700
  - fix storing VLAN tag info from web ui. lp:#398867
  - fix setting of HTTP error codes lp:#430266
 ------------------------------------------------------------

Changed in eucalyptus:
status: Confirmed → Fix Committed
Revision history for this message
Chris Jones (cmsj) wrote :

I believe this bug should be Fix Released - 1.6 is out and appears to have VLAN configuration in the web UI :)

ds (dharmendrar)
Changed in eucalyptus:
assignee: chris grzegorczyk (chris-grze) → ds (dharmendrar)
Changed in eucalyptus:
assignee: ds (dharmendrar) → chris grzegorczyk (chris-grze)
Changed in eucalyptus:
status: Fix Committed → Fix Released
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.