Merge branch 'feature/ceilometerDashboard'
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 10910fb..68362f3 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -622,6 +622,13 @@
                 type: string
                 required: false
                 description: default isolation to use when bringing up instances (default to 'vm')
+            default_flavor:
+                # Note: we should probably formally introduce flavors to Tosca
+                # at some point, and use a requirement/relationship instead of
+                # a text string.
+                type: string
+                required: false
+                description: default flavor to use for slice
 
     tosca.nodes.Node:
         derived_from: tosca.nodes.Root
@@ -720,6 +727,10 @@
         derived_from: tosca.relationships.Root
         valid_target_types: [ tosca.capabilities.xos.Image ]
 
+    tosca.relationships.DefaultImage:
+        derived_from: tosca.relationships.Root
+        valid_target_types: [ tosca.capabilities.xos.Image ]
+
     tosca.relationships.SupportsImage:
         derived_from: tosca.relationships.Root
         valid_target_types: [ tosca.capabilities.xos.Image ]
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 4c12e7f..49cc435 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -817,6 +817,13 @@
                 type: string
                 required: false
                 description: default isolation to use when bringing up instances (default to 'vm')
+            default_flavor:
+                # Note: we should probably formally introduce flavors to Tosca
+                # at some point, and use a requirement/relationship instead of
+                # a text string.
+                type: string
+                required: false
+                description: default flavor to use for slice
 
     tosca.nodes.Node:
         derived_from: tosca.nodes.Root
@@ -937,6 +944,10 @@
         derived_from: tosca.relationships.Root
         valid_target_types: [ tosca.capabilities.xos.Image ]
 
+    tosca.relationships.DefaultImage:
+        derived_from: tosca.relationships.Root
+        valid_target_types: [ tosca.capabilities.xos.Image ]
+
     tosca.relationships.SupportsImage:
         derived_from: tosca.relationships.Root
         valid_target_types: [ tosca.capabilities.xos.Image ]
diff --git a/xos/tosca/resources/slice.py b/xos/tosca/resources/slice.py
index e37bfc8..6227ec7 100644
--- a/xos/tosca/resources/slice.py
+++ b/xos/tosca/resources/slice.py
@@ -5,7 +5,7 @@
 sys.path.append("/opt/tosca")
 from translator.toscalib.tosca_template import ToscaTemplate
 
-from core.models import Slice,User,Site,Network,NetworkSlice,SliceRole,SlicePrivilege,Service
+from core.models import Slice,User,Site,Network,NetworkSlice,SliceRole,SlicePrivilege,Service,Image,Flavor
 
 from xosresource import XOSResource
 
@@ -26,6 +26,16 @@
             service = self.get_xos_object(Service, name=serviceName)
             args["service"] = service
 
+        default_image_name = self.get_requirement("tosca.relationships.DefaultImage", throw_exception=False)
+        if default_image_name:
+            default_image = self.get_xos_object(Image, name=default_image_name, throw_exception=True)
+            args["default_image"] = default_image
+
+        default_flavor_name = self.get_property_default("default_flavor", None)
+        if default_flavor_name:
+            default_flavor = self.get_xos_object(Flavor, name=default_flavor_name, throw_exception=True)
+            args["default_flavor"] = default_flavor
+
         return args
 
     def postprocess(self, obj):
diff --git a/xos/tosca/samples/slice_default_image.yaml b/xos/tosca/samples/slice_default_image.yaml
new file mode 100644
index 0000000..91b95c7
--- /dev/null
+++ b/xos/tosca/samples/slice_default_image.yaml
@@ -0,0 +1,30 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: >
+    * Create a new deployment, controller, and site.
+    * Add a SiteDeployment from the site to the deployment using the controller.
+    * Create a Slice in the Site, with one Instance
+
+imports:
+   - custom_types/xos.yaml
+
+topology_template:
+  node_templates:
+    mysite:
+      type: tosca.nodes.Site
+
+    trusty-server-multi-nic:
+      type: tosca.nodes.Image
+
+    mysite_test1:
+      type: tosca.nodes.Slice
+      requirements:
+          - slice:
+                node: mysite
+                relationship: tosca.relationships.MemberOfSite
+          - default_image:
+                node: trusty-server-multi-nic
+                relationship: tosca.relationships.DefaultImage
+      properties:
+          default_flavor: m1.small
+