diff --git a/bootstrap/Dockerfile b/bootstrap/Dockerfile
new file mode 100644
index 0000000..6d387a6
--- /dev/null
+++ b/bootstrap/Dockerfile
@@ -0,0 +1,13 @@
+FROM ubuntu:14.04
+MAINTAINER David Bainbridge <dbainbri@ciena.com>
+
+RUN	apt-get update -y && \
+	apt-get install -y python-pip
+
+RUN	pip install maasclient==0.3 && \
+	pip install requests_oauthlib && \
+        pip install ipaddress
+
+ADD bootstrap.py /bootstrap.py
+
+ENTRYPOINT [ "/bootstrap.py" ]
diff --git a/bootstrap/LICENSE b/bootstrap/LICENSE
new file mode 100644
index 0000000..8dada3e
--- /dev/null
+++ b/bootstrap/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   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.
diff --git a/bootstrap/Makefile b/bootstrap/Makefile
new file mode 100644
index 0000000..49d7ff2
--- /dev/null
+++ b/bootstrap/Makefile
@@ -0,0 +1,9 @@
+help:
+	-@echo "Available actions"
+	-@echo "    docker      - builds the docker container"
+
+docker: bootstrap.py
+	docker build -t cord/maas-bootstrap:0.1-prerelease .
+
+run:
+	docker run -ti --rm=true cord/maas-bootstrap:0.1-prerelease --apikey=$(CORD_APIKEY) --sshkey="$(CORD_SSHKEY)" --url=$(CORD_URL)
diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py
new file mode 100755
index 0000000..4c00853
--- /dev/null
+++ b/bootstrap/bootstrap.py
@@ -0,0 +1,340 @@
+#!/usr/bin/python
+
+from __future__ import print_function
+import sys
+import json
+import ipaddress
+import requests
+from optparse import OptionParser
+from maasclient.auth import MaasAuth
+from maasclient import MaasClient
+
+# For some reason the maasclient doesn't provide a put method. So
+# we will add it here
+def put(client, url, params=None):
+    return requests.put(url=client.auth.api_url + url,
+                            auth=client._oauth(),
+                            data=params)
+
+def add_or_update_node_group_interface(client, ng, gw, foundIfc, ifcName, subnet):
+    ip = ipaddress.IPv4Network(unicode(subnet, 'utf-8'))
+    hosts = list(ip.hosts())
+
+    # if the caller specified the default gateway then honor that, else used the default
+    gw = gw or str(hosts[0])
+
+    ifc = {
+        'ip_range_high': str(hosts[-1]),
+        'ip_range_low': str(hosts[2]),
+	'static_ip_range_high' : None,
+	'static_ip_range_low' : None,
+        'management': 2,
+        'name': ifcName,
+        #'router_ip' : gw,
+        #'gateway_ip' : gw,
+        'ip': str(hosts[0]),
+        'subnet_mask': str(ip.netmask),
+        'broadcast_ip': str(ip.broadcast_address),
+        'interface': ifcName,
+    }
+
+    if foundIfc is not None:
+        print("INFO: network for specified interface, '%s', already exists" % (ifcName))
+
+	resp = client.get('/nodegroups/' + ng['uuid'] + '/interfaces/' + ifcName + '/', dict())
+	if int(resp.status_code / 100) != 2:
+	    print("ERROR: unable to read specified interface, '%s', '%d : %s'"
+	          % (ifcName, resp.status_code, resp.text), file=sys.stderr)
+	    sys.exit(1)
+
+	# A bit of a hack here. Turns out MAAS won't return the router_ip / gateway_ip value
+	# so we can't really tell if that value is set correctly. So we will compare the
+	# values we can and use that as the "CHANGED" value, but always set all values.
+
+	# Save the compare value
+	same = ifc == json.loads(resp.text)
+
+	# Add router_ip and gateway_ip to the desired state so that those will be set
+	ifc['router_ip'] = gw
+	ifc['gateway_ip'] = gw
+
+        # If the network already exists, update it with the information we want
+        resp = put(client, '/nodegroups/' + ng['uuid'] + '/interfaces/' + ifcName + '/', ifc)
+        if int(resp.status_code / 100) != 2:
+            print("ERROR: unable to update specified network, '%s', on specified interface '%s', '%d : %s'"
+                   % (subnet, ifcName, resp.status_code, resp.text), file=sys.stderr)
+	    sys.exit(1)
+
+        if not same:
+            print("CHANGED: updated network, '%s', for interface '%s'" % (subnet, ifcName))
+	else:
+            print("INFO: Network settings for interface '%s' unchanged" % ifcName)
+
+    else:
+        # Add the operation
+        ifc['op'] = 'new'
+	ifc['router_ip'] = gw
+        ifc['gateway_ip'] = gw
+
+        resp = client.post('/nodegroups/' + ng['uuid'] + '/interfaces/', ifc)
+        if int(resp.status_code / 100) != 2:
+            print("ERROR: unable to create specified network, '%s', on specified interface '%s', '%d : %s'"
+                % (subnet, ifcName, resp.status_code, resp.text), file=sys.stderr)
+	    sys.exit(1)
+        else:
+            print("CHANGED: created network, '%s', for interface '%s'" % (subnet, ifcName))
+
+    # Add the first host to the subnet as the dns_server
+    subnets = None
+    resp = client.get('/subnets/', dict())
+    if int(resp.status_code / 100) != 2:
+        print("ERROR: unable to query subnets: '%d : %s'" % (resp.status_code, resp.text))
+	sys.exit(1)
+    else:
+        subnets = json.loads(resp.text)
+
+    id = None
+    for sn in subnets:
+        if sn['name'] == subnet:
+            id = str(sn['id'])
+            break
+
+    if id == None:
+        print("ERROR: unable to find subnet entry for network '%s'" % (subnet))
+	sys.exit(1)
+
+    resp = client.get('/subnets/' + id + '/')
+    if int(resp.status_code / 100) != 2:
+        print("ERROR: unable to query subnet '%s': '%d : %s'" % (subnet, resp.status_code, resp.text))
+	sys.exit(1)
+
+    data = json.loads(resp.text)
+
+    found = False
+    for ns in data['dns_servers']:
+        if unicode(ns) == unicode(hosts[0]):
+	    found = True
+
+    if not found:
+        resp = put(client, '/subnets/' + id + '/', dict(dns_servers=[hosts[0]]))
+	if int(resp.status_code / 100) != 2:
+            print("ERROR: unable to query subnet '%s': '%d : %s'" % (subnet, resp.status_code, resp.text))
+	    sys.exit(1)
+	else:
+	    print("CHANGED: updated DNS server information")
+    else:
+        print("INFO: DNS already set correctly")
+    
+
+def main():
+    parser = OptionParser()
+    parser.add_option('-c', '--config', dest='config_file',
+        help="specifies file from which configuration should be read", metavar='FILE')
+    parser.add_option('-a', '--apikey', dest='apikey',
+        help="specifies the API key to use when accessing MAAS")
+    parser.add_option('-u', '--url', dest='url', default='http://localhost/MAAS/api/1.0',
+        help="specifies the URL on which to contact MAAS")
+    parser.add_option('-z', '--zone', dest='zone', default='administrative',
+        help="specifies the zone to create for manually managed hosts")
+    parser.add_option('-i', '--interface', dest='interface', default='eth0:1',
+        help="the interface on which to set up DHCP for POD local hosts")
+    parser.add_option('-n', '--network', dest='network', default='10.0.0.0/16',
+        help="subnet to use for POD local DHCP")
+    parser.add_option('-b', '--bridge', dest='bridge', default='mgmtbr',
+        help="bridge to use for host local VM allocation")
+    parser.add_option('-t', '--bridge-subnet', dest='bridge_subnet', default='172.18.0.0/16',
+        help="subnet to assign from for bridged hosts")
+    parser.add_option('-r', '--cluster', dest='cluster', default='Cluster master',
+        help="name of cluster to user for POD / DHCP")
+    parser.add_option('-s', '--sshkey', dest='sshkey', default=None,
+        help="specifies public ssh key")
+    parser.add_option('-d', '--domain', dest='domain', default='cord.lab',
+        help="specifies the domain to configure in maas")
+    parser.add_option('-g', '--gateway', dest='gw', default=None,
+        help="specifies the gateway to configure for servers")
+    (options, args) = parser.parse_args()
+
+    if len(args) > 0:
+        print("unknown command line arguments specified", file=sys.stderr)
+        parser.print_help()
+        sys.exit(1)
+
+    # If a config file was specified then read the config from that
+    config = {}
+    if options.config_file != None:
+        with open(options.config_file) as config_file:
+            config = json.load(config_file)
+
+    # Override the config with any command line options
+    if options.apikey == None:
+        print("must specify a  MAAS API key", file=sys.stderr)
+        sys.exit(1)
+    else:
+        config['key'] = options.apikey
+    if options.url != None:
+        config['url'] = options.url
+    if options.zone != None:
+        config['zone'] = options.zone
+    if options.interface != None:
+        config['interface'] = options.interface
+    if options.network != None:
+        config['network'] = options.network
+    if options.bridge != None:
+        config['bridge'] = options.bridge
+    if options.bridge_subnet != None:
+        config['bridge-subnet'] = options.bridge_subnet
+    if options.cluster != None:
+        config['cluster'] = options.cluster
+    if options.domain != None:
+        config['domain'] = options.domain
+    if options.gw != None:
+        config['gw'] = options.gw
+    if not 'gw' in config.keys():
+        config['gw'] = None
+    if options.sshkey == None:
+        print("must specify a SSH key to use for cord user", file=sys.stderr)
+        sys.exit(1)
+    else:
+        config['sshkey'] = options.sshkey
+    
+    auth = MaasAuth(config['url'], config['key'])
+    client = MaasClient(auth)
+
+    resp = client.get('/account/prefs/sshkeys/', dict(op='list'))
+    if int(resp.status_code / 100) != 2:
+        print("ERROR: unable to query SSH keys from server '%d : %s'"
+	        % (resp.status_code, resp.text), file=sys.stderr)
+	sys.exit(1)
+
+    found_key = False
+    keys = json.loads(resp.text)
+    for key in keys:
+	if key['key'] == config['sshkey']:
+	    print("INFO: specified SSH key already exists")
+            found_key = True
+
+    # Add the SSH key to the user
+    # POST /api/2.0/account/prefs/sshkeys/ op=new
+    if not found_key:
+        resp = client.post('/account/prefs/sshkeys/', dict(op='new', key=config['sshkey']))
+        if int(resp.status_code / 100) != 2:
+            print("ERROR: unable to add sshkey for user: '%d : %s'"
+                    % (resp.status_code, resp.text), file=sys.stderr)
+            sys.exit(1)
+	else:
+	    print("CHANGED: updated ssh key")
+    
+    # Check to see if an "administrative" zone exists and if not
+    # create one
+    found = None
+    zones = client.zones
+    for zone in zones:
+        if zone['name'] == config['zone']:
+            found=zone
+    
+    if found is not None:
+        print("INFO: administrative zone, '%s', already exists" % config['zone'], file=sys.stderr)
+    else:
+        if not client.zone_new(config['zone'], "Zone for manually administrated nodes"):
+            print("ERROR: unable to create administrative zone '%s'" % config['zone'], file=sys.stderr)
+            sys.exit(1)
+        else:
+            print("CHANGED: Zone '%s' created" % config['zone'])
+    
+    # If the interface doesn't already exist in the cluster then
+    # create it. Look for the "Cluster Master" node group, but
+    # if it is not found used the first one in the list, if the
+    # list is empty, error out
+    found = None
+    ngs = client.nodegroups
+    for ng in ngs:
+        if ng['cluster_name'] == config['cluster']:
+            found = ng
+            break
+    
+    if found is None:
+        print("ERROR: unable to find cluster with specified name, '%s'" % config['cluster'], file=sys.stderr)
+        sys.exit(1)
+
+    resp = client.get('/nodegroups/' + ng['uuid'] + '/', dict())
+    if int(resp.status_code / 100) != 2:
+        print("ERROR: unable to get node group information for cluster '%s': '%d : %s'"
+	    % (config['cluster'], resp.status_code, resp.text), file=sys.stderr)
+	sys.exit(1)
+
+    data = json.loads(resp.text)
+    
+    # Set the DNS domain name (zone) for the cluster
+    if data['name'] != config['domain']:
+        resp = put(client, '/nodegroups/' + ng['uuid'] + '/', dict(name=config['domain']))
+        if int(resp.status_code / 100) != 2:
+            print("ERROR: unable to set the DNS domain name for the cluster with specified name, '%s': '%d : %s'"
+                % (config['cluster'], resp.status_code, resp.text), file=sys.stderr)
+	    sys.exit(1)
+        else:
+            print("CHANGE: updated name of cluster to '%s' : %s" % (config['domain'], resp))
+    else:
+        print("INFO: domain name already set")
+    
+    found = None
+    resp = client.get('/nodegroups/' + ng['uuid'] + '/interfaces/', dict(op='list'))
+    if int(resp.status_code / 100) != 2:
+        print("ERROR: unable to fetch interfaces for cluster with specified name, '%s': '%d : %s'"
+            % (config['cluster'], resp.status_code, resp.text), file=sys.stderr)
+        sys.exit(1)
+    ifcs = json.loads(resp.text)
+
+    localIfc = hostIfc = None 
+    for ifc in ifcs:
+        localIfc = ifc if ifc['name'] == config['interface'] else localIfc
+        hostIfc = ifc if ifc['name'] == config['bridge'] else hostIfc
+
+    add_or_update_node_group_interface(client, ng, config['gw'], localIfc, config['interface'], config['network'])
+    add_or_update_node_group_interface(client, ng, config['gw'], hostIfc, config['bridge'], config['bridge-subnet'])
+
+    # Update the server settings to upstream DNS request to Google
+    # POST /api/2.0/maas/ op=set_config
+    resp = client.get('/maas/', dict(op='get_config', name='upstream_dns'))
+    if int(resp.status_code / 100) != 2:
+        print("ERROR: unable to get the upstream DNS servers: '%d : %s'"
+              % (resp.status_code, resp.text), file=sys.stderr)
+	sys.exit(1)
+
+    if unicode(json.loads(resp.text)) != u'8.8.8.8 8.8.8.4':
+        resp = client.post('/maas/', dict(op='set_config', name='upstream_dns', value='8.8.8.8 8.8.8.4'))
+        if int(resp.status_code / 100) != 2:
+            print("ERROR: unable to set the upstream DNS servers: '%d : %s'"
+                % (resp.status_code, resp.text), file=sys.stderr)
+        else:
+            print("CHANGED: updated up stream DNS servers")
+    else:
+        print("INFO: Upstream DNS servers correct")
+
+    # Start the download of boot images
+    resp = client.get('/boot-resources/', None)
+    if int(resp.status_code / 100) != 2:
+        print("ERROR: unable to read existing images download: '%d : %s'" % (resp.status_code, resp.text), file=sys.stderr)
+	sys.exit(1)
+
+    imgs = json.loads(resp.text)
+    found = False
+    for img in imgs:
+	if img['name'] == u'ubuntu/trusty' and img['architecture'] == u'amd64/hwe-t':
+	    found = True
+
+    if not found:
+        resp = client.post('/boot-resources/', dict(op='import'))
+        if int(resp.status_code / 100) != 2:
+            print("ERROR: unable to start image download: '%d : %s'" % (resp.status_code, resp.text), file=sys.stderr)
+	    sys.exit(1)
+        else:
+            print("CHANGED: Image download started")
+    else:
+	print("INFO: required images already available")
+    
+if __name__ == '__main__':
+    #try:
+        main()
+    #except:
+#	e = sys.exc_info()[0]
+#	print("ERROR: Unexpected exception: '%s'" % e, file=sys.stderr)
