### TODO
* DCemulator
- * ...
+ * Advanced network model
+ * improve network management, multiple interfaces per container
+ * API to create multiple networks (per DC?)
+
* Add resource constraints to datacenters
* Check if we can use the Mininet GUI to visualize our DCs?
* list active compute resources
* Cloud-like reference API with CLI for demonstrations
* Write CLI client
- * Start compute (name, DC, image)
+ * Start compute (name, DC, image, network)
* Stop compute
* Create an Ansible-based automatic installation routine
* Unit tests
def __init__(self, dcs):
self.dcs = dcs
- def compute_action_start(self, dc_name, compute_name, image):
+ def compute_action_start(self, dc_name, compute_name, image, network):
+ # network e.g. {"ip": "10.0.0.254/8"}
# TODO what to return UUID / given name / internal name ?
logging.debug("RPC CALL: compute start")
try:
- c = self.dcs.get(dc_name).startCompute(compute_name, image=image)
+ c = self.dcs.get(dc_name).startCompute(
+ compute_name, image=image, network=network)
return str(c.name)
except Exception as ex:
logging.exception("RPC error.")
print "Command not implemented."
def start(self, args):
+ network = {}
+ if args.get("network") is not None:
+ network = {"ip": args.get("network")}
r = self.c.compute_action_start(
- args.get("datacenter"), args.get("name"), args.get("image"))
+ args.get("datacenter"),
+ args.get("name"),
+ args.get("image"),
+ network)
pp.pprint(r)
def stop(self, args):
parser = argparse.ArgumentParser(description='son-emu compute')
-parser.add_argument("command", help="Action to be executed.")
parser.add_argument(
- "--datacenter", "-d", dest="datacenter", help="Data center.")
+ "command",
+ help="Action to be executed: start|stop|list")
parser.add_argument(
- "--name", "-n", dest="name", help="Compute name.")
+ "--datacenter", "-d", dest="datacenter",
+ help="Data center to in which the compute instance should be executed")
parser.add_argument(
- "--image", "-i", dest="image", help="Name of container image to be used.")
-# TODO: IP, image, etc. pp.
+ "--name", "-n", dest="name",
+ help="Name of compute instance e.g. 'vnf1'")
+parser.add_argument(
+ "--image", dest="image",
+ help="Name of container image to be used e.g. 'ubuntu'")
+parser.add_argument(
+ "--net", dest="network",
+ help="Network properties of compute instance e.g. '10.0.0.123/8'")
def main(argv):