diff --git a/common/utils/dockerhelpers.py b/common/utils/dockerhelpers.py
index 0927711..0b24dd8 100644
--- a/common/utils/dockerhelpers.py
+++ b/common/utils/dockerhelpers.py
@@ -48,3 +48,38 @@
     name = info['Name'].lstrip('/')
 
     return name
+
+def create_container_network(name, links):
+    """
+    Creates a container networks based on a set of containers.
+    :param name: the network name
+    :param links: the set of containers to link
+    :return: a network configuration
+    """
+    try:
+        docker_cli = Client(base_url='unix://tmp/docker.sock')
+        docker_cli.create_network(name)
+        networking_config = docker_cli.create_networking_config({
+            'network1': docker_cli.create_endpoint_config(links = links)
+        })
+    except Exception, e:
+        log.exception('failed network creation', name, e=e)
+        raise
+
+    return networking_config
+
+
+def start_container(args):
+    """
+    Starts a requested container with the appropriate configuration.
+    :param args: contains arguments for container creation
+        (see https://docker-py.readthedocs.io/en/stable/api/#create_container)
+    :return: the containers name
+    """
+    try:
+        docker_cli = Client(base_url='unix://tmp/docker.sock')
+        docker_cli.create_container(**args)
+    except Exception, e:
+        log.exception('failed', e=e)
+        raise
+
diff --git a/compose/docker-compose-system-test.yml b/compose/docker-compose-system-test.yml
index 89d1764..ad23313 100644
--- a/compose/docker-compose-system-test.yml
+++ b/compose/docker-compose-system-test.yml
@@ -97,6 +97,7 @@
       SERVICE_8880_CHECK_INTERVAL: "5s"
       SERVICE_8880_CHECK_TIMEOUT: "1s"
       SERVICE_50555_NAME: "voltha-grpc"
+      SERVICE_50555_TAGS: "chameleon,ofagent"
     volumes:
     - "/var/run/docker.sock:/tmp/docker.sock"
   #
diff --git a/podder/consul_mgr.py b/podder/consul_mgr.py
new file mode 100644
index 0000000..c62ca58
--- /dev/null
+++ b/podder/consul_mgr.py
@@ -0,0 +1,90 @@
+import consul
+from structlog import get_logger
+from twisted.internet import reactor
+from twisted.internet.defer import inlineCallbacks, Deferred, returnValue
+
+from common.utils.dockerhelpers import create_container_network, start_container
+
+containers = {
+    'chameleon' : {
+                    'image' : 'opencord/chameleon',
+                    'command' : [ "/chameleon/main.py",
+                                    "-v",
+                                    "--consul=consul:8500",
+                                    "--fluentd=fluentd:24224",
+                                    "--rest-port=8881",
+                                    "--grpc-endpoint=@voltha-grpc",
+                                    "--instance-id-is-container-name",
+                                    "-v"],
+                    'ports' : [ 8881 ],
+                    'depends_on' : [ "consul", "voltha" ],
+                    'links' : [ "consul", "fluentd" ],
+                    'environment' : ["SERVICE_8881_NAME=chamleon-rest"],
+                    'volumes' : '/var/run/docker.sock:/tmp/docker.sock'
+                  }
+}
+
+class ConsulManager(object):
+
+    log = get_logger()
+
+    def __init__(self, arg):
+        self.log.info('Initializing consul manager')
+        self.running = False
+        self.index = 0
+        (host, port) = arg.split(':')
+        self.conn = consul.Consul(host=host, port=port)
+
+    @inlineCallbacks
+    def run(self):
+        if self.running:
+            return
+        self.running = True
+
+        self.log.info('Running consul manager')
+
+        reactor.callLater(0, self.provision_voltha_instances())
+
+        reactor.addSystemEventTrigger('before', 'shutdown', self.shutdown)
+        returnValue(self)
+
+    @inlineCallbacks
+    def shutdown(self):
+        self.log.info('Shutting down consul manager')
+        self.running = False
+
+    @inlineCallbacks
+    def provision_voltha_instances(self):
+        while True:
+            if not self.running:
+                return
+            # maintain index such that callbacks only happen is something has changed
+            # timeout is default to 5m
+            (self.index, data) = self.conn.catalog.service(service='voltha-grpc',
+                                                            index=self.index)
+            self.start_containers(data)
+
+    def start_containers(self, data):
+        for item in data:
+            serviceId = item['ServiceID'].split(':')[1].split('_')[2]
+            serviceTags = item['ServiceTags']
+            self.log.info('voltha instance %s, with tags %s' % (serviceId, serviceTags))
+            for tag in serviceTags:
+                if tag in containers:
+                    netcfg = self.create_network(serviceId, tag)
+                    self.create_container(serviceId, tag, netcfg)
+
+
+    def create_network(self, id, tag):
+        return create_container_network('podder_%s_%s' % (tag, id),
+                                        containers[tag]['links'])
+
+    def create_container(self, id, tag, netcfg):
+        args = {}
+        args['image'] = containers['image']
+        args['networking_config'] = netcfg
+        args['command'] = containers['command']
+        args['ports'] = containers['ports']
+        args['environment'] = containers['environment']
+        args['volumes'] = containers['volumes']
+        start_container(args)
\ No newline at end of file
diff --git a/podder/main.py b/podder/main.py
new file mode 100755
index 0000000..cd515e6
--- /dev/null
+++ b/podder/main.py
@@ -0,0 +1,173 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 the original author or authors.
+#
+# Licensed 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.
+#
+
+import argparse
+import os
+from consul_mgr import ConsulManager
+from twisted.internet.defer import inlineCallbacks
+from common.utils.nethelpers import get_my_primary_local_ipv4
+from common.utils.structlog_setup import setup_logging
+import yaml
+
+defs = dict(
+    config=os.environ.get('CONFIG', './podder.yml'),
+    consul=os.environ.get('CONSUL', 'localhost:8500'),
+    external_host_address=os.environ.get('EXTERNAL_HOST_ADDRESS',
+                                         get_my_primary_local_ipv4()),
+    grpc_endpoint=os.environ.get('GRPC_ENDPOINT', 'localhost:50055'),
+    fluentd=os.environ.get('FLUENTD', None),
+    instance_id=os.environ.get('INSTANCE_ID', os.environ.get('HOSTNAME', '1')),
+    internal_host_address=os.environ.get('INTERNAL_HOST_ADDRESS',
+                                         get_my_primary_local_ipv4()),
+    work_dir=os.environ.get('WORK_DIR', '/tmp/podder')
+)
+
+def parse_args():
+
+    parser = argparse.ArgumentParser()
+
+    _help = ('Path to podder.yml config file (default: %s). '
+             'If relative, it is relative to main.py of podder.'
+             % defs['config'])
+    parser.add_argument('-c', '--config',
+                        dest='config',
+                        action='store',
+                        default=defs['config'],
+                        help=_help)
+
+    _help = '<hostname>:<port> to consul agent (default: %s)' % defs['consul']
+    parser.add_argument(
+        '-C', '--consul', dest='consul', action='store',
+        default=defs['consul'],
+        help=_help)
+
+
+    _help = ('<hostname>:<port> to fluentd server (default: %s). (If not '
+             'specified (None), the address from the config file is used'
+             % defs['fluentd'])
+    parser.add_argument('-F', '--fluentd',
+                        dest='fluentd',
+                        action='store',
+                        default=defs['fluentd'],
+                        help=_help)
+
+    _help = ('unique string id of this ofagent instance (default: %s)'
+             % defs['instance_id'])
+    parser.add_argument('-i', '--instance-id',
+                        dest='instance_id',
+                        action='store',
+                        default=defs['instance_id'],
+                        help=_help)
+
+    _help = 'omit startup banner log lines'
+    parser.add_argument('-n', '--no-banner',
+                        dest='no_banner',
+                        action='store_true',
+                        default=False,
+                        help=_help)
+
+    _help = "suppress debug and info logs"
+    parser.add_argument('-q', '--quiet',
+                        dest='quiet',
+                        action='count',
+                        help=_help)
+
+    _help = 'enable verbose logging'
+    parser.add_argument('-v', '--verbose',
+                        dest='verbose',
+                        action='count',
+                        help=_help)
+
+
+    args = parser.parse_args()
+
+    # post-processing
+
+    return args
+
+def load_config(args):
+    path = args.config
+    if path.startswith('.'):
+        dir = os.path.dirname(os.path.abspath(__file__))
+        path = os.path.join(dir, path)
+    path = os.path.abspath(path)
+    with open(path) as fd:
+        config = yaml.load(fd)
+    return config
+
+banner = r'''
+ _____
+|     |          |    |
+|     |          |    |
+|_____|_____ ____|____| ___   _
+|     |     |    |    |/ _ \ /
+|     |_____|____|____|\____|
+'''
+
+def print_banner(log):
+    for line in banner.strip('\n').splitlines():
+        log.info(line)
+    log.info('(to stop: press Ctrl-C)')
+
+class Main(object):
+
+    def __init__(self):
+        self.args = args = parse_args()
+        self.config = load_config(args)
+
+        verbosity_adjust = (args.verbose or 0) - (args.quiet or 0)
+        self.log = setup_logging(self.config.get('logging', {}),
+                                 args.instance_id,
+                                 verbosity_adjust=verbosity_adjust,
+                                 fluentd=args.fluentd)
+
+        self.consul_manager = None
+
+        if not args.no_banner:
+            print_banner(self.log)
+
+        self.startup_components()
+
+    def start(self):
+        self.start_reactor()
+
+    @inlineCallbacks
+    def startup_components(self):
+        self.log.info('starting-internal-components')
+        args = self.args
+        self.consul_manager = yield ConsulManager(args.consul).run()
+        self.log.info('started-internal-components')
+
+    @inlineCallbacks
+    def shutdown_components(self):
+        """Execute before the reactor is shut down"""
+        self.log.info('exiting-on-keyboard-interrupt')
+        if self.consul_manager is not None:
+            yield self.consul_manager.shutdown()
+
+    def start_reactor(self):
+        from twisted.internet import reactor
+        reactor.callWhenRunning(
+            lambda: self.log.info('twisted-reactor-started'))
+
+        reactor.addSystemEventTrigger('before', 'shutdown',
+                                      self.shutdown_components)
+        reactor.run()
+
+
+if __name__ == '__main__':
+    Main().start()
diff --git a/podder/podder.yml b/podder/podder.yml
new file mode 100644
index 0000000..9a43048
--- /dev/null
+++ b/podder/podder.yml
@@ -0,0 +1,44 @@
+logging:
+    version: 1
+
+    formatters:
+      brief:
+        format: '%(message)s'
+      default:
+        format: '%(asctime)s.%(msecs)03d %(levelname)-8s %(module)s.%(funcName)s %(message)s'
+        datefmt: '%Y%m%dT%H%M%S'
+      fluent_fmt:
+        '()': fluent.handler.FluentRecordFormatter
+        format:
+          level: '%(levelname)s'
+          hostname: '%(hostname)s'
+          where: '%(module)s.%(funcName)s'
+
+    handlers:
+        console:
+            class : logging.StreamHandler
+            level: DEBUG
+            formatter: default
+            stream: ext://sys.stdout
+        fluent:
+            class: fluent.handler.FluentHandler
+            host: localhost
+            port: 24224
+            tag: voltha.logging
+            formatter: fluent_fmt
+            level: DEBUG
+        null:
+            class: logging.NullHandler
+
+    loggers:
+        amqp:
+            handlers: [null]
+            propagate: False
+        conf:
+            handlers: [null]
+            propagate: False
+        '': # root logger
+            handlers: [console, fluent]
+            level: INFO # this can be bumped up/down by -q and -v command line
+                        # options
+            propagate: False
\ No newline at end of file
