diff --git a/xos/cord/admin.py b/xos/cord/admin.py
index 103f1d0..6137212 100644
--- a/xos/cord/admin.py
+++ b/xos/cord/admin.py
@@ -158,7 +158,7 @@
 class VCPETenantForm(forms.ModelForm):
     bbs_account = forms.CharField(required=False)
     creator = forms.ModelChoiceField(queryset=User.objects.all())
-    sliver = forms.ModelChoiceField(queryset=Sliver.objects.all(),required=False)
+    instance = forms.ModelChoiceField(queryset=Instance.objects.all(),required=False)
     last_ansible_hash = forms.CharField(required=False)
 
     def __init__(self,*args,**kwargs):
@@ -169,7 +169,7 @@
             # fields for the attributes
             self.fields['bbs_account'].initial = self.instance.bbs_account
             self.fields['creator'].initial = self.instance.creator
-            self.fields['sliver'].initial = self.instance.sliver
+            self.fields['instance'].initial = self.instance.instance
             self.fields['last_ansible_hash'].initial = self.instance.last_ansible_hash
         if (not self.instance) or (not self.instance.pk):
             # default fields for an 'add' form
@@ -180,7 +180,7 @@
 
     def save(self, commit=True):
         self.instance.creator = self.cleaned_data.get("creator")
-        self.instance.sliver = self.cleaned_data.get("sliver")
+        self.instance.instance = self.cleaned_data.get("instance")
         self.instance.last_ansible_hash = self.cleaned_data.get("last_ansible_hash")
         return super(VCPETenantForm, self).save(commit=commit)
 
@@ -191,7 +191,7 @@
     list_display = ('backend_status_icon', 'id', 'subscriber_tenant' )
     list_display_links = ('backend_status_icon', 'id')
     fieldsets = [ (None, {'fields': ['backend_status_text', 'kind', 'provider_service', 'subscriber_tenant', 'service_specific_id', # 'service_specific_attribute',
-                                     'bbs_account', 'creator', 'sliver', 'last_ansible_hash'],
+                                     'bbs_account', 'creator', 'instance', 'last_ansible_hash'],
                           'classes':['suit-tab suit-tab-general']})]
     readonly_fields = ('backend_status_text', 'service_specific_attribute', 'bbs_account')
     form = VCPETenantForm
diff --git a/xos/cord/models.py b/xos/cord/models.py
index f115045..68bd2ba 100644
--- a/xos/cord/models.py
+++ b/xos/cord/models.py
@@ -1,5 +1,5 @@
 from django.db import models
-from core.models import Service, PlCoreBase, Slice, Sliver, Tenant, TenantWithContainer, Node, Image, User, Flavor, Subscriber
+from core.models import Service, PlCoreBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, Subscriber
 from core.models.plcorebase import StrippedCharField
 import os
 from django.db import models, transaction
@@ -469,7 +469,7 @@
                        "private_ip", "private_mac",
                        "hpc_client_ip", "hpc_client_mac")
 
-    default_attributes = {"sliver_id": None,
+    default_attributes = {"instance_id": None,
                           "users": [],
                           "bbs_account": None,
                           "last_ansible_hash": None}
@@ -477,6 +477,66 @@
     def __init__(self, *args, **kwargs):
         super(VCPETenant, self).__init__(*args, **kwargs)
         self.cached_vbng=None
+        self.cached_instance=None
+        self.orig_instance_id = self.get_initial_attribute("instance_id")
+
+    @property
+    def image(self):
+        LOOK_FOR_IMAGES=["ubuntu-vcpe4",        # ONOS demo machine -- preferred vcpe image
+                         "Ubuntu 14.04 LTS",    # portal
+                         "Ubuntu-14.04-LTS",    # ONOS demo machine
+                        ]
+        for image_name in LOOK_FOR_IMAGES:
+            images = Image.objects.filter(name = image_name)
+            if images:
+                return images[0]
+
+        raise XOSProgrammingError("No VPCE image (looked for %s)" % str(LOOK_FOR_IMAGES))
+
+    @property
+    def instance(self):
+        if getattr(self, "cached_instance", None):
+            return self.cached_instance
+        instance_id=self.get_attribute("instance_id")
+        if not instance_id:
+            return None
+        instances=Instance.objects.filter(id=instance_id)
+        if not instances:
+            return None
+        instance=instances[0]
+        instance.caller = self.creator
+        self.cached_instance = instance
+        return instance
+
+    @instance.setter
+    def instance(self, value):
+        if value:
+            value = value.id
+        if (value != self.get_attribute("instance_id", None)):
+            self.cached_instance=None
+        self.set_attribute("instance_id", value)
+
+    @property
+    def creator(self):
+        if getattr(self, "cached_creator", None):
+            return self.cached_creator
+        creator_id=self.get_attribute("creator_id")
+        if not creator_id:
+            return None
+        users=User.objects.filter(id=creator_id)
+        if not users:
+            return None
+        user=users[0]
+        self.cached_creator = users[0]
+        return user
+
+    @creator.setter
+    def creator(self, value):
+        if value:
+            value = value.id
+        if (value != self.get_attribute("creator_id", None)):
+            self.cached_creator=None
+        self.set_attribute("creator_id", value)
 
     @property
     def vbng(self):
@@ -523,10 +583,10 @@
 
     @property
     def ssh_command(self):
-        if self.sliver:
-            return self.sliver.get_ssh_command()
+        if self.instance:
+            return self.instance.get_ssh_command()
         else:
-            return "no-sliver"
+            return "no-instance"
 
     @ssh_command.setter
     def ssh_command(self, value):
@@ -534,11 +594,11 @@
 
     @property
     def addresses(self):
-        if not self.sliver:
+        if not self.instance:
             return {}
 
         addresses = {}
-        for ns in self.sliver.ports.all():
+        for ns in self.instance.ports.all():
             if "lan" in ns.network.name.lower():
                 addresses["lan"] = (ns.ip, ns.mac)
             elif "wan" in ns.network.name.lower():
@@ -599,6 +659,53 @@
     def is_synced(self, value):
         pass
 
+    def pick_node(self):
+        nodes = list(Node.objects.all())
+        # TODO: logic to filter nodes by which nodes are up, and which
+        #   nodes the slice can instantiate on.
+        nodes = sorted(nodes, key=lambda node: node.instances.all().count())
+        return nodes[0]
+
+    def manage_instance(self):
+        # Each VCPE object owns exactly one instance.
+
+        if self.deleted:
+            return
+
+        if (self.instance is not None) and (self.instance.image != self.image):
+            self.instance.delete()
+            self.instance = None
+
+        if self.instance is None:
+            if not self.provider_service.slices.count():
+                raise XOSConfigurationError("The VCPE service has no slices")
+
+            flavors = Flavor.objects.filter(name="m1.small")
+            if not flavors:
+                raise XOSConfigurationError("No m1.small flavor")
+
+            node =self.pick_node()
+            instance = Instance(slice = self.provider_service.slices.all()[0],
+                            node = node,
+                            image = self.image,
+                            creator = self.creator,
+                            deployment = node.site_deployment.deployment,
+                            flavor = flavors[0])
+            instance.save()
+
+            try:
+                self.instance = instance
+                super(VCPETenant, self).save()
+            except:
+                instance.delete()
+                raise
+
+    def cleanup_instance(self):
+        if self.instance:
+            # print "XXX cleanup instance", self.instance
+            self.instance.delete()
+            self.instance = None
+
     def manage_vbng(self):
         # Each vCPE object owns exactly one vBNG object
 
@@ -628,11 +735,11 @@
                 # print "XXX clean up orphaned vbng", vbng
                 vbng.delete()
 
-        if self.orig_sliver_id and (self.orig_sliver_id != self.get_attribute("sliver_id")):
-            slivers=Sliver.objects.filter(id=self.orig_sliver_id)
-            if slivers:
-                # print "XXX clean up orphaned sliver", slivers[0]
-                slivers[0].delete()
+        if self.orig_instance_id and (self.orig_instance_id != self.get_attribute("instance_id")):
+            instances=Instance.objects.filter(id=self.orig_instance_id)
+            if instances:
+                # print "XXX clean up orphaned instance", instances[0]
+                instances[0].delete()
 
     def manage_bbs_account(self):
         if self.deleted:
@@ -660,7 +767,7 @@
 
         super(VCPETenant, self).save(*args, **kwargs)
         model_policy_vcpe(self.pk)
-        #self.manage_sliver()
+        #self.manage_instance()
         #self.manage_vbng()
         #self.manage_bbs_account()
         #self.cleanup_orphans()
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 6676995..d9f285b 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -402,47 +402,80 @@
     def queryset(self, request):
         return Tag.select_by_user(request.user)
 
-class SliverInline(XOSTabularInline):
-    model = Sliver
+class NetworkLookerUpper:
+    """ This is a callable that looks up a network name in a instance and returns
+        the ip address for that network.
+    """
+
+    byNetworkName = {}    # class variable
+
+    def __init__(self, name):
+        self.short_description = name
+        self.__name__ = name
+        self.network_name = name
+
+    def __call__(self, obj):
+        if obj is not None:
+            for nbs in obj.networkinstance_set.all():
+                if (nbs.network.name == self.network_name):
+                    return nbs.ip
+        return ""
+
+    def __str__(self):
+        return self.network_name
+
+    @staticmethod
+    def get(network_name):
+        """ We want to make sure we alwars return the same NetworkLookerUpper
+            because sometimes django will cause them to be instantiated multiple
+            times (and we don't want different ones in form.fields vs
+            InstanceInline.readonly_fields).
+        """
+        if network_name not in NetworkLookerUpper.byNetworkName:
+            NetworkLookerUpper.byNetworkName[network_name] = NetworkLookerUpper(network_name)
+        return NetworkLookerUpper.byNetworkName[network_name]
+
+class InstanceInline(XOSTabularInline):
+    model = Instance
     fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'slice', 'deployment', 'flavor', 'image', 'node', 'no_sync']
     extra = 0
     readonly_fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name']
-    suit_classes = 'suit-tab suit-tab-slivers'
+    suit_classes = 'suit-tab suit-tab-instances'
 
     def queryset(self, request):
-        return Sliver.select_by_user(request.user)
+        return Instance.select_by_user(request.user)
 
     def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
         if db_field.name == 'deployment':
              
            kwargs['queryset'] = Deployment.select_by_acl(request.user).filter(sitedeployments__nodes__isnull=False).distinct()
-           kwargs['widget'] = forms.Select(attrs={'onChange': "sliver_deployment_changed(this);"})
+           kwargs['widget'] = forms.Select(attrs={'onChange': "instance_deployment_changed(this);"})
         if db_field.name == 'flavor':
-           kwargs['widget'] = forms.Select(attrs={'onChange': "sliver_flavor_changed(this);"})
+           kwargs['widget'] = forms.Select(attrs={'onChange': "instance_flavor_changed(this);"})
 
-        field = super(SliverInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
+        field = super(InstanceInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
 
         return field
 
-class CordSliverInline(XOSTabularInline):
-    model = Sliver
+class CordInstanceInline(XOSTabularInline):
+    model = Instance
     fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'slice', 'flavor', 'image', 'node']
     extra = 0
     readonly_fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name']
-    suit_classes = 'suit-tab suit-tab-slivers'
+    suit_classes = 'suit-tab suit-tab-instances'
 
     def queryset(self, request):
-        return Sliver.select_by_user(request.user)
+        return Instance.select_by_user(request.user)
 
     def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
         if db_field.name == 'deployment':
 
            kwargs['queryset'] = Deployment.select_by_acl(request.user).filter(sitedeployments__nodes__isnull=False).distinct()
-           kwargs['widget'] = forms.Select(attrs={'onChange': "sliver_deployment_changed(this);"})
+           kwargs['widget'] = forms.Select(attrs={'onChange': "instance_deployment_changed(this);"})
         if db_field.name == 'flavor':
-           kwargs['widget'] = forms.Select(attrs={'onChange': "sliver_flavor_changed(this);"})
+           kwargs['widget'] = forms.Select(attrs={'onChange': "instance_flavor_changed(this);"})
 
-        field = super(CordSliverInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
+        field = super(CordInstanceInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
 
         return field
 
@@ -932,7 +965,7 @@
             # hide MyInline in the add view
             if obj is None:
                 continue
-            if isinstance(inline, SliverInline):
+            if isinstance(inline, InstanceInline):
                 inline.model.caller = request.user
             yield inline.get_formset(request, obj)
 
@@ -1033,12 +1066,12 @@
 
 class SliceAdmin(XOSBaseAdmin):
     form = SliceForm
-    fieldList = ['backend_status_text', 'site', 'name', 'serviceClass', 'enabled','description', 'service', 'slice_url', 'max_slivers']
+    fieldList = ['backend_status_text', 'site', 'name', 'serviceClass', 'enabled','description', 'service', 'slice_url', 'max_instances']
     fieldsets = [('Slice Details', {'fields': fieldList, 'classes':['suit-tab suit-tab-general']}),]
     readonly_fields = ('backend_status_text', )
-    list_display = ('backend_status_icon', 'name', 'site','serviceClass', 'slice_url', 'max_slivers')
+    list_display = ('backend_status_icon', 'name', 'site','serviceClass', 'slice_url', 'max_instances')
     list_display_links = ('backend_status_icon', 'name', )
-    normal_inlines = [SlicePrivilegeInline, SliverInline, TagInline, ReservationInline, SliceNetworkInline]
+    normal_inlines = [SlicePrivilegeInline, InstanceInline, TagInline, ReservationInline, SliceNetworkInline]
     inlines = normal_inlines
     admin_inlines = [ControllerSliceInline]
 
@@ -1049,7 +1082,7 @@
         tabs =[('general', 'Slice Details'),
           ('slicenetworks','Networks'),
           ('sliceprivileges','Privileges'),
-          ('slivers','Slivers'),
+          ('instances','Instances'),
           #('reservations','Reservations'), 
           ('tags','Tags'),
           ]
@@ -1115,7 +1148,7 @@
             # hide MyInline in the add view
             if obj is None:
                 continue
-            if isinstance(inline, SliverInline):
+            if isinstance(inline, InstanceInline):
                 inline.model.caller = request.user
             yield inline.get_formset(request, obj)
 
@@ -1126,7 +1159,7 @@
         #    XXX this approach is better than clobbering self.inlines, so
         #    try to make this work post-demo.
         if (obj is not None) and (obj.name == "mysite_vcpe"):
-            cord_vcpe_inlines = [ SlicePrivilegeInline, CordSliverInline, TagInline, ReservationInline,SliceNetworkInline]
+            cord_vcpe_inlines = [ SlicePrivilegeInline, CordInstanceInline, TagInline, ReservationInline,SliceNetworkInline]
 
             inlines=[]
             for inline_class in cord_vcpe_inlines:
@@ -1183,9 +1216,9 @@
                ]
     readonly_fields = ('backend_status_text', )
 
-    suit_form_tabs =(('general','Image Details'),('slivers','Slivers'),('imagedeployments','Deployments'), ('controllerimages', 'Controllers'))
+    suit_form_tabs =(('general','Image Details'),('instances','Instances'),('imagedeployments','Deployments'), ('controllerimages', 'Controllers'))
 
-    inlines = [SliverInline, ControllerImagesInline]
+    inlines = [InstanceInline, ControllerImagesInline]
 
     user_readonly_fields = ['name', 'disk_format', 'container_format']
 
@@ -1205,22 +1238,22 @@
     list_display_links = ('backend_status_icon', 'name', )
     list_filter = ('site_deployment',)
 
-    inlines = [TagInline,SliverInline]
+    inlines = [TagInline,InstanceInline]
     fieldsets = [('Node Details', {'fields': ['backend_status_text', 'name','site_deployment'], 'classes':['suit-tab suit-tab-details']})]
     readonly_fields = ('backend_status_text', )
 
     user_readonly_fields = ['name','site_deployment']
-    user_readonly_inlines = [TagInline,SliverInline]
+    user_readonly_inlines = [TagInline,InstanceInline]
 
-    suit_form_tabs =(('details','Node Details'),('slivers','Slivers'))
+    suit_form_tabs =(('details','Node Details'),('instances','Instances'))
 
     def formfield_for_foreignkey(self, db_field, request, **kwargs):
         if db_field.name == 'site':
             kwargs['queryset'] = Site.select_by_user(request.user).filter(hosts_nodes=True)
 
-class SliverForm(forms.ModelForm):
+class InstanceForm(forms.ModelForm):
     class Meta:
-        model = Sliver
+        model = Instance
         ip = forms.CharField(widget=PlainTextWidget)
         instance_name = forms.CharField(widget=PlainTextWidget)
         widgets = {
@@ -1239,8 +1272,8 @@
     user_readonly_fields = ['service', 'name', 'value', 'content_type', 'content_object',]
     user_readonly_inlines = []
 
-class SliverPortInline(XOSTabularInline):
-    fields = ['backend_status_icon', 'network', 'sliver', 'ip', 'mac']
+class InstancePortInline(XOSTabularInline):
+    fields = ['backend_status_icon', 'network', 'instance', 'ip', 'mac']
     readonly_fields = ("backend_status_icon", "ip", "mac")
     model = Port
     selflink_fieldname = "network"
@@ -1249,16 +1282,16 @@
     verbose_name = "Port"
     suit_classes = 'suit-tab suit-tab-ports'
 
-class SliverAdmin(XOSBaseAdmin):
-    form = SliverForm
+class InstanceAdmin(XOSBaseAdmin):
+    form = InstanceForm
     fieldsets = [
-        ('Sliver Details', {'fields': ['backend_status_text', 'slice', 'deployment', 'node', 'all_ips_string', 'instance_id', 'instance_name', 'flavor', 'image', 'ssh_command', 'no_sync'], 'classes': ['suit-tab suit-tab-general'], })
+        ('Instance Details', {'fields': ['backend_status_text', 'slice', 'deployment', 'node', 'all_ips_string', 'instance_id', 'instance_name', 'flavor', 'image', 'ssh_command', 'no_sync'], 'classes': ['suit-tab suit-tab-general'], })
     ]
     readonly_fields = ('backend_status_text', 'ssh_command', 'all_ips_string')
     list_display = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'slice', 'flavor', 'image', 'node', 'deployment']
     list_display_links = ('backend_status_icon', 'all_ips_string', 'instance_id', )
 
-    suit_form_tabs =(('general', 'Sliver Details'), ('ports', 'Ports'))
+    suit_form_tabs =(('general', 'Instance Details'), ('ports', 'Ports'))
 
     inlines = [TagInline, SliverPortInline]
 
@@ -1275,12 +1308,12 @@
         if db_field.name == 'slice':
             kwargs['queryset'] = Slice.select_by_user(request.user)
 
-        return super(SliverAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
+        return super(InstanceAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
 
     def queryset(self, request):
-        # admins can see all slivers. Users can only see slivers of
+        # admins can see all instances. Users can only see instances of
         # the slices they belong to.
-        return Sliver.select_by_user(request.user)
+        return Instance.select_by_user(request.user)
 
 
     def get_formsets(self, request, obj=None):
@@ -1294,7 +1327,7 @@
             # hide MyInline in the add view
             if obj is None:
                 continue
-            if isinstance(inline, SliverInline):
+            if isinstance(inline, InstanceInline):
                 inline.model.caller = request.user
             yield inline.get_formset(request, obj)
 
@@ -1515,8 +1548,8 @@
                     field.initial = field.queryset.all()[0]
             else:
                 field.queryset = field.queryset.none()
-        elif db_field.name == 'sliver':
-            # restrict slivers to those that belong to the slice
+        elif db_field.name == 'instance':
+            # restrict instances to those that belong to the slice
             if request._slice is not None:
                 field.queryset = field.queryset.filter(slice = request._slice)
             else:
@@ -1668,10 +1701,10 @@
     readonly_fields = ('backend_status_icon', )
 
 class NetworkPortInline(XOSTabularInline):
-    fields = ['backend_status_icon', 'network', 'sliver', 'ip', 'mac']
+    fields = ['backend_status_icon', 'network', 'instance', 'ip', 'mac']
     readonly_fields = ("backend_status_icon", "ip", "mac")
     model = Port
-    selflink_fieldname = "sliver"
+    selflink_fieldname = "instance"
     extra = 0
     verbose_name_plural = "Ports"
     verbose_name = "Port"
@@ -1708,7 +1741,6 @@
     list_display = ("backend_status_icon", "name", "subnet", "ports", "labels")
     list_display_links = ('backend_status_icon', 'name', )
     readonly_fields = ("subnet", )
-
     inlines = [NetworkParameterInline, NetworkPortInline, NetworkSlicesInline, RouterInline]
     admin_inlines = [ControllerNetworkInline]
 
@@ -1959,7 +1991,7 @@
     admin.site.register(Node, NodeAdmin)
     #admin.site.register(SlicePrivilege, SlicePrivilegeAdmin)
     #admin.site.register(SitePrivilege, SitePrivilegeAdmin)
-    admin.site.register(Sliver, SliverAdmin)
+    admin.site.register(Instance, InstanceAdmin)
     admin.site.register(Image, ImageAdmin)
     admin.site.register(DashboardView, DashboardViewAdmin)
     admin.site.register(Flavor, FlavorAdmin)
diff --git a/xos/core/api/slivers.py b/xos/core/api/instances.py
similarity index 64%
rename from xos/core/api/slivers.py
rename to xos/core/api/instances.py
index 2ce24c7..92e928c 100644
--- a/xos/core/api/slivers.py
+++ b/xos/core/api/instances.py
@@ -1,26 +1,26 @@
 from types import StringTypes
 from django.contrib.auth import authenticate
 from openstack.manager import OpenStackManager
-from core.models import Sliver, Slice
+from core.models import Instance, Slice
 from core.api.images import _get_images
 from core.api.slices import _get_slices
 from core.api.deployment_networks import _get_deployment_networks
 from core.api.nodes import _get_nodes
 
-def _get_slivers(filter):
+def _get_instances(filter):
     if isinstance(filter, StringTypes) and filter.isdigit():
         filter = int(filter)
     if isinstance(filter, int):
-        slivers = Sliver.objects.filter(id=filter)
+        instances = Instance.objects.filter(id=filter)
     elif isinstance(filter, StringTypes):
-        slivers = Sliver.objects.filter(name=filter)
+        instances = Instance.objects.filter(name=filter)
     elif isinstance(filter, dict):
-        slivers = Sliver.objects.filter(**filter)
+        instances = Instance.objects.filter(**filter)
     else:
-        slivers = []
-    return slivers
+        instances = []
+    return instances
  
-def add_sliver(auth, fields):
+def add_instance(auth, fields):
     user = authenticate(username=auth.get('username'),
                         password=auth.get('password'))
     
@@ -33,33 +33,33 @@
     if deployment_networks: fields['deploymentNetwork'] = deployment_networks[0]     
     if nodes: fields['node'] = nodes[0]     
 
-    sliver = Sliver(**fields)
-    auth['tenant'] = sliver.slice.name
-    sliver.os_manager = OpenStackManager(auth=auth, caller = user)    
-    sliver.save()
-    return sliver
+    instance = Instance(**fields)
+    auth['tenant'] = instance.slice.name
+    instance.os_manager = OpenStackManager(auth=auth, caller = user)    
+    instance.save()
+    return instance
 
-def update_sliver(auth, sliver, **fields):
+def update_instance(auth, instance, **fields):
     return  
 
-def delete_sliver(auth, filter={}):
+def delete_instance(auth, filter={}):
     user = authenticate(username=auth.get('username'),
                         password=auth.get('password'))
-    slivers = _get_slivers(filter)
-    for sliver in slivers:
-        auth['tenant'] = sliver.slice.name 
+    instances = _get_instances(filter)
+    for instance in instances:
+        auth['tenant'] = instance.slice.name 
         slice.os_manager = OpenStackManager(auth=auth, caller = user)
-        sliver.delete()
+        instance.delete()
     return 1
 
-def get_slivers(auth, filter={}):
+def get_instances(auth, filter={}):
     user = authenticate(username=auth.get('username'),
                         password=auth.get('password'))
     if 'slice' in filter:
         slices = _get_slices(filter.get('slice'))
         if slices: filter['slice'] = slices[0]
-    slivers = _get_slivers(filter)
-    return slivers             
+    instances = _get_instances(filter)
+    return instances             
         
 
     
diff --git a/xos/core/api_root.py b/xos/core/api_root.py
index 4ac267a..c3d69f1 100644
--- a/xos/core/api_root.py
+++ b/xos/core/api_root.py
@@ -15,7 +15,7 @@
         'serviceresources': reverse('serviceresource-list', request=request, format=format),
         'sites': reverse('site-list', request=request, format=format),
         'slices': reverse('slice-list', request=request, format=format),
-        'slivers': reverse('sliver-list', request=request, format=format),
+        'instances': reverse('instance-list', request=request, format=format),
         'tags': reverse('tag-list', request=request, format=format),
         'users': reverse('user-list', request=request, format=format),
     })
diff --git a/xos/core/dashboard/sites.py b/xos/core/dashboard/sites.py
index b77a096..de100af 100644
--- a/xos/core/dashboard/sites.py
+++ b/xos/core/dashboard/sites.py
@@ -14,7 +14,7 @@
         from django.conf.urls import patterns, url
         from views import DashboardCustomize, DashboardDynamicView, SimulatorView, LoggedInView, \
                           DashboardUserSiteView,  \
-                          TenantViewData, TenantCreateSlice, TenantAddUser,TenantAddOrRemoveSliverView, TenantPickSitesView, TenantDeleteSliceView, \
+                          TenantViewData, TenantCreateSlice, TenantAddUser,TenantAddOrRemoveInstanceView, TenantPickSitesView, TenantDeleteSliceView, \
                           TenantUpdateSlice, DashboardSliceInteractions, RequestAccessView
 
         from views import view_urls
@@ -46,8 +46,8 @@
                     name="welcome"),
                url(r'^simulator/', self.admin_view(SimulatorView.as_view()),
                     name="simulator"),
-               url(r'^tenantaddorremsliver/$', self.admin_view(TenantAddOrRemoveSliverView.as_view()),
-                    name="tenantaddorremsliver"),
+               url(r'^tenantaddorreminstance/$', self.admin_view(TenantAddOrRemoveInstanceView.as_view()),
+                    name="tenantaddorreminstance"),
                url(r'^tenantview/$', self.admin_view(TenantViewData.as_view()),
                     name="tenantview"),
                url(r'^createnewslice/$', self.admin_view(TenantCreateSlice.as_view()),
diff --git a/xos/core/dashboard/views/__init__.py b/xos/core/dashboard/views/__init__.py
index bbe403b..8c693c8 100644
--- a/xos/core/dashboard/views/__init__.py
+++ b/xos/core/dashboard/views/__init__.py
@@ -1,7 +1,7 @@
 #from home import DashboardWelcomeView, DashboardDynamicView
-#from tenant import TenantCreateSlice, TenantUpdateSlice, TenantDeleteSliceView, TenantAddOrRemoveSliverView, TenantPickSitesView, TenantViewData
+#from tenant import TenantCreateSlice, TenantUpdateSlice, TenantDeleteSliceView, TenantAddOrRemoveInstanceView, TenantPickSitesView, TenantViewData
 #from simulator import SimulatorView
-#from cdn import DashboardSummaryAjaxView, DashboardAddOrRemoveSliverView, DashboardAjaxView
+#from cdn import DashboardSummaryAjaxView, DashboardAddOrRemoveInstanceView, DashboardAjaxView
 #from analytics import DashboardAnalyticsAjaxView
 #from customize import DashboardCustomize
 #from interactions import DashboardSliceInteractions
diff --git a/xos/core/dashboard/views/download_ssh_commands.py b/xos/core/dashboard/views/download_ssh_commands.py
index 96d1393..92bcac4 100644
--- a/xos/core/dashboard/views/download_ssh_commands.py
+++ b/xos/core/dashboard/views/download_ssh_commands.py
@@ -9,8 +9,8 @@
 
     def get(self, request, sliceid=None, **kwargs):
         #slice = Slices.objects.get(id=sliceid);
-        #for sliver in slice.slivers.all():
-        #    if (sliver.instance_id && sliver.instance_name):
+        #for instance in slice.instances.all():
+        #    if (instance.instance_id && instance.instance_name):
 
         slice = SlicePlus.objects.get(id=sliceid)
 
diff --git a/xos/core/dashboard/views/interactions.py b/xos/core/dashboard/views/interactions.py
index 89bc766..f74d01e 100644
--- a/xos/core/dashboard/views/interactions.py
+++ b/xos/core/dashboard/views/interactions.py
@@ -28,11 +28,11 @@
         elif name=="sites":
             result["title"] = "Slice interactions by site ownership"
             result["objectName"] = "sites"
-        elif name=="sliver_sites":
-            result["title"] = "Slice interactions by sliver sites"
+        elif name=="instance_sites":
+            result["title"] = "Slice interactions by instance sites"
             result["objectName"] = "sites"
-        elif name=="sliver_nodes":
-            result["title"] = "Slice interactions by sliver nodes"
+        elif name=="instance_nodes":
+            result["title"] = "Slice interactions by instance nodes"
             result["objectName"] = "nodes"
 
         return HttpResponse(json.dumps(result), content_type='application/javascript')
@@ -83,12 +83,12 @@
                         ids.append(sp.network.id)
         elif name=="sites":
             ids = [slice.site.id]
-        elif name=="sliver_sites":
-            for sp in slice.slivers.all():
+        elif name=="instance_sites":
+            for sp in slice.instances.all():
                  if sp.node.site.id not in ids:
                      ids.append(sp.node.site.id)
-        elif name=="sliver_nodes":
-            for sp in slice.slivers.all():
+        elif name=="instance_nodes":
+            for sp in slice.instances.all():
                  if sp.node.id not in ids:
                      ids.append(sp.node.id)
         return ids
diff --git a/xos/core/dashboard/views/shell.py b/xos/core/dashboard/views/shell.py
index e852b16..c49133b 100644
--- a/xos/core/dashboard/views/shell.py
+++ b/xos/core/dashboard/views/shell.py
@@ -20,20 +20,20 @@
             d2[k] = v
     return d2
 
-def sliver_to_dict(sliver):
-    d = model_to_dict(sliver)
-    d["slice_id"] = sliver.slice.id
-    d["node_id"] = sliver.node.id
+def instance_to_dict(instance):
+    d = model_to_dict(instance)
+    d["slice_id"] = instance.slice.id
+    d["node_id"] = instance.node.id
     return d
 
 def slice_to_dict(slice):
     d = model_to_dict(slice)
-    d["slivers"] = [sliver_to_dict(x) for x in slice.slivers]
+    d["instances"] = [instance_to_dict(x) for x in slice.instances]
     return d
 
 def node_to_dict(node):
     d = model_to_dict(node)
-    d["slivers"] = []
+    d["instances"] = []
 
 
 class OpenCloudData:
@@ -43,7 +43,7 @@
     def loadAll(self):
         self.allNodes = list(Node.objects.all())
         self.allSlices = list(Slice.objects.all())
-        self.allSlivers = list(Sliver.objects.all())
+        self.allInstances = list(Instance.objects.all())
         self.allSites = list(Site.objects.all())
 
         self.site_id = {}
@@ -56,29 +56,29 @@
         self.node_id = {}
         for node in self.allNodes:
             d = model_to_dict(node)
-            d["sliver_ids"] = []
+            d["instance_ids"] = []
             self.node_id[node.id] = ensure_serializable(d)
             self.site_id[node.site_id]["node_ids"].append(node.id)
 
         self.slice_id = {}
         for slice in self.allSlices:
             d = model_to_dict(slice)
-            d["sliver_ids"] = []
+            d["instance_ids"] = []
             self.slice_id[slice.id] = ensure_serializable(d)
             self.site_id[slice.site_id]["slice_ids"].append(site.id)
 
         print self.slice_id.keys()
 
-        self.sliver_id = {}
-        for sliver in self.allSlivers:
-            self.sliver_id[sliver.id] = model_to_dict(sliver)
+        self.instance_id = {}
+        for instance in self.allInstances:
+            self.instance_id[instance.id] = model_to_dict(instance)
 
-            self.slice_id[sliver.slice_id]["sliver_ids"].append(sliver.id)
-            self.node_id[sliver.node_id]["sliver_ids"].append(sliver.id)
+            self.slice_id[instance.slice_id]["instance_ids"].append(instance.id)
+            self.node_id[instance.node_id]["instance_ids"].append(instance.id)
 
     def get_opencloud_data(self):
         return {"slices": self.slice_id.values(),
-                "slivers": self.sliver_id.values(),
+                "instances": self.instance_id.values(),
                 "nodes": self.node_id.values(),
                 "sites": self.site_id.values()}
 
diff --git a/xos/core/dashboard/views/tenant.py b/xos/core/dashboard/views/tenant.py
index 951efc2..6fbc4d6 100644
--- a/xos/core/dashboard/views/tenant.py
+++ b/xos/core/dashboard/views/tenant.py
@@ -201,21 +201,21 @@
            preferredImage =  entry.image_preference
            #sliceDataSet = entry.mount_data_sets
            sliceNetwork = {}
-           numSliver = 0
+           numInstance = 0
            sliceImage=""
            sliceSite = {}
            sliceNode = {}
            sliceInstance= {}
            #createPrivateVolume(user,sliceName)
            available_sites = getAvailableSites()
-           for sliver in slice.slivers.all():
-                if sliver.node.site.name in available_sites:
-                    sliceSite[sliver.node.site.name] = sliceSite.get(sliver.node.site.name,0) + 1
-                    sliceImage = sliver.image.name
-                    sliceNode[str(sliver)] = sliver.node.name
-           numSliver = sum(sliceSite.values())
+           for instance in slice.instances.all():
+                if instance.node.site.name in available_sites:
+                    sliceSite[instance.node.site.name] = sliceSite.get(instance.node.site.name,0) + 1
+                    sliceImage = instance.image.name
+                    sliceNode[str(instance)] = instance.node.name
+           numInstance = sum(sliceSite.values())
            numSites = len(sliceSite)
-           userSliceInfo.append({'sliceName': sliceName,'sliceServiceClass': sliceServiceClass,'preferredImage':preferredImage,'numOfSites':numSites, 'sliceSite':sliceSite,'sliceImage':sliceImage,'numOfSlivers':numSliver,'instanceNodePair':sliceNode})
+           userSliceInfo.append({'sliceName': sliceName,'sliceServiceClass': sliceServiceClass,'preferredImage':preferredImage,'numOfSites':numSites, 'sliceSite':sliceSite,'sliceImage':sliceImage,'numOfInstances':numInstance,'instanceNodePair':sliceNode})
     return userSliceInfo
 
 def getTenantSitesInfo():
@@ -344,14 +344,14 @@
                 sliceToDel.delete()
                 return HttpResponse(json.dumps("Slice deleted"), content_type='application/javascript')
 
-class TenantAddOrRemoveSliverView(View):
-    """ Add or remove slivers from a Slice
+class TenantAddOrRemoveInstanceView(View):
+    """ Add or remove instances from a Slice
 
         Arguments:
             siteName - name of site. If not specified, XOS will pick the
                        best site.,
             actionToDo - [add | rem]
-            count - number of slivers to add or remove
+            count - number of instances to add or remove
             sliceName - name of slice
             noAct - if set, no changes will be made to db, but result will still
                     show which sites would have been modified.
@@ -384,9 +384,9 @@
             if (siteList is None):
                 siteList = tenant_pick_sites(user, user_ip, slice, count)
 
-            sitesChanged = slice_increase_slivers(request.user, user_ip, siteList, slice, image, count, noAct)
+            sitesChanged = slice_increase_instances(request.user, user_ip, siteList, slice, image, count, noAct)
         elif (actionToDo == "rem"):
-            sitesChanged = slice_decrease_slivers(request.user, siteList, slice, count, noAct)
+            sitesChanged = slice_decrease_instances(request.user, siteList, slice, count, noAct)
         else:
             return HttpResponseServerError("Unknown actionToDo %s" % actionToDo)
 
@@ -411,16 +411,16 @@
 
 def siteSortKey(site, slice=None, count=None, lat=None, lon=None):
     # try to pick a site we're already using
-    has_slivers_here=False
+    has_instances_here=False
     if slice:
-        for sliver in slice.slivers.all():
-            if sliver.node.site.name == site.name:
-                has_slivers_here=True
+        for instance in slice.instances.all():
+            if instance.node.site.name == site.name:
+                has_instances_here=True
 
     # Haversine method
     d = haversine(site.location.latitude, site.location.longitude, lat, lon)
 
-    return (-has_slivers_here, d)
+    return (-has_instances_here, d)
 
 def tenant_pick_sites(user, user_ip=None, slice=None, count=None):
     """ Returns list of sites, sorted from most favorable to least favorable """
diff --git a/xos/core/dashboard/views/view_common.py b/xos/core/dashboard/views/view_common.py
index 37da7cf..0ef422e 100644
--- a/xos/core/dashboard/views/view_common.py
+++ b/xos/core/dashboard/views/view_common.py
@@ -66,67 +66,67 @@
             continue
         slice = slice[0]
         slicename = slice.name
-        sliverList=Sliver.objects.all()
+        instanceList=Instance.objects.all()
         sites_used = {}
-        for sliver in slice.slivers.all():
-             #sites_used['deploymentSites'] = sliver.node.deployment.name
-             # sites_used[sliver.image.name] = sliver.image.name
-             sites_used[sliver.node.site_deployment.site] = 1 #sliver.numberCores
+        for instance in slice.instances.all():
+             #sites_used['deploymentSites'] = instance.node.deployment.name
+             # sites_used[instance.image.name] = instance.image.name
+             sites_used[instance.node.site_deployment.site] = 1 #instance.numberCores
         sliceid = Slice.objects.get(id=entry.slice.id).id
         try:
-            sliverList = Sliver.objects.filter(slice=entry.slice.id)
+            instanceList = Instance.objects.filter(slice=entry.slice.id)
             siteList = {}
-            for x in sliverList:
+            for x in instanceList:
                if x.node.site_deployment.site not in siteList:
                   siteList[x.node.site_deployment.site] = 1
-            slivercount = len(sliverList)
+            instancecount = len(instanceList)
             sitecount = len(siteList)
         except:
             traceback.print_exc()
-            slivercount = 0
+            instancecount = 0
             sitecount = 0
 
         userSliceInfo.append({'slicename': slicename, 'sliceid':sliceid,
                               'sitesUsed':sites_used,
                               'role': SliceRole.objects.get(id=entry.role.id).role,
-                              'slivercount': slivercount,
+                              'instancecount': instancecount,
                               'sitecount':sitecount})
 
     return userSliceInfo
 
-def slice_increase_slivers(user, user_ip, siteList, slice, image, count, noAct=False):
+def slice_increase_instances(user, user_ip, siteList, slice, image, count, noAct=False):
     sitesChanged = {}
 
-    # let's compute how many slivers are in use in each node of each site
+    # let's compute how many instances are in use in each node of each site
     for site in siteList:
         site.nodeList = list(site.nodes.all())
         for node in site.nodeList:
-            node.sliverCount = 0
-            for sliver in node.slivers.all():
-                 if sliver.slice.id == slice.id:
-                     node.sliverCount = node.sliverCount + 1
+            node.instanceCount = 0
+            for instance in node.instances.all():
+                 if instance.slice.id == slice.id:
+                     node.instanceCount = node.instanceCount + 1
 
-    # Allocate slivers to nodes
-    # for now, assume we want to allocate all slivers from the same site
+    # Allocate instances to nodes
+    # for now, assume we want to allocate all instances from the same site
     nodes = siteList[0].nodeList
     while (count>0):
-        # Sort the node list by number of slivers per node, then pick the
-        # node with the least number of slivers.
-        nodes = sorted(nodes, key=attrgetter("sliverCount"))
+        # Sort the node list by number of instances per node, then pick the
+        # node with the least number of instances.
+        nodes = sorted(nodes, key=attrgetter("instanceCount"))
         node = nodes[0]
 
-        print "adding sliver at node", node.name, "of site", node.site.name
+        print "adding instance at node", node.name, "of site", node.site.name
 
         if not noAct:
-            sliver = Sliver(name=node.name,
+            instance = Instance(name=node.name,
                         slice=slice,
                         node=node,
                         image = image,
                         creator = User.objects.get(email=user),
                         deploymentNetwork=node.deployment)
-            sliver.save()
+            instance.save()
 
-        node.sliverCount = node.sliverCount + 1
+        node.instanceCount = node.instanceCount + 1
 
         count = count - 1
 
@@ -134,20 +134,20 @@
 
     return sitesChanged
 
-def slice_decrease_slivers(user, siteList, slice, count, noAct=False):
+def slice_decrease_instances(user, siteList, slice, count, noAct=False):
     sitesChanged = {}
     if siteList:
         siteNames = [site.name for site in siteList]
     else:
         siteNames = None
 
-    for sliver in list(slice.slivers.all()):
+    for instance in list(slice.instances.all()):
         if count>0:
-            if(not siteNames) or (sliver.node.site.name in siteNames):
-                sliver.delete()
-                print "deleting sliver",sliver.name,"at node",sliver.node.name
+            if(not siteNames) or (instance.node.site.name in siteNames):
+                instance.delete()
+                print "deleting instance",instance.name,"at node",instance.node.name
                 count=count-1
-                sitesChanged[sliver.node.site.name] = sitesChanged.get(sliver.node.site.name,0) - 1
+                sitesChanged[instance.node.site.name] = sitesChanged.get(instance.node.site.name,0) - 1
 
     return sitesChanged
 
diff --git a/xos/core/migrations/0001_initial.py b/xos/core/migrations/0001_initial.py
index fe34224..db7dad0 100644
--- a/xos/core/migrations/0001_initial.py
+++ b/xos/core/migrations/0001_initial.py
@@ -3,7 +3,7 @@
 
 from django.db import models, migrations
 import timezones.fields
-import core.models.sliver
+import core.models.instance
 import core.models.network
 import geoposition.fields
 import encrypted_fields.fields
@@ -528,7 +528,7 @@
             bases=(models.Model,),
         ),
         migrations.CreateModel(
-            name='NetworkSliver',
+            name='NetworkInstance',
             fields=[
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                 ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
@@ -537,9 +537,9 @@
                 ('policed', models.DateTimeField(default=None, null=True, blank=True)),
                 ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
                 ('deleted', models.BooleanField(default=False)),
-                ('ip', models.GenericIPAddressField(help_text=b'Sliver ip address', null=True, blank=True)),
+                ('ip', models.GenericIPAddressField(help_text=b'Instance ip address', null=True, blank=True)),
                 ('port_id', models.CharField(help_text=b'Quantum port id', max_length=256, null=True, blank=True)),
-                ('network', models.ForeignKey(related_name=b'networkslivers', to='core.Network')),
+                ('network', models.ForeignKey(related_name=b'networkinstances', to='core.Network')),
             ],
             options={
                 'abstract': False,
@@ -952,7 +952,7 @@
                 ('omf_friendly', models.BooleanField(default=False)),
                 ('description', models.TextField(help_text=b'High level description of the slice and expected activities', max_length=1024, blank=True)),
                 ('slice_url', models.URLField(max_length=512, blank=True)),
-                ('max_slivers', models.IntegerField(default=10)),
+                ('max_instances', models.IntegerField(default=10)),
                 ('network', models.CharField(default=b'Private Only', max_length=256, null=True, blank=True)),
                 ('mount_data_sets', models.CharField(default=b'GenBank', max_length=256, null=True, blank=True)),
                 ('creator', models.ForeignKey(related_name=b'slices', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
@@ -1040,7 +1040,7 @@
             bases=(models.Model,),
         ),
         migrations.CreateModel(
-            name='Sliver',
+            name='Instance',
             fields=[
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                 ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
@@ -1051,17 +1051,17 @@
                 ('deleted', models.BooleanField(default=False)),
                 ('instance_id', models.CharField(help_text=b'Nova instance id', max_length=200, null=True, blank=True)),
                 ('instance_uuid', models.CharField(help_text=b'Nova instance uuid', max_length=200, null=True, blank=True)),
-                ('name', models.CharField(help_text=b'Sliver name', max_length=200)),
+                ('name', models.CharField(help_text=b'Instance name', max_length=200)),
                 ('instance_name', models.CharField(help_text=b'OpenStack generated name', max_length=200, null=True, blank=True)),
-                ('ip', models.GenericIPAddressField(help_text=b'Sliver ip address', null=True, blank=True)),
-                ('numberCores', models.IntegerField(default=0, help_text=b'Number of cores for sliver', verbose_name=b'Number of Cores')),
+                ('ip', models.GenericIPAddressField(help_text=b'Instance ip address', null=True, blank=True)),
+                ('numberCores', models.IntegerField(default=0, help_text=b'Number of cores for instance', verbose_name=b'Number of Cores')),
                 ('userData', models.TextField(help_text=b'user_data passed to instance during creation', null=True, blank=True)),
-                ('creator', models.ForeignKey(related_name=b'slivers', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
-                ('deployment', models.ForeignKey(related_name=b'sliver_deployment', verbose_name=b'deployment', to='core.Deployment')),
-                ('flavor', models.ForeignKey(default=core.models.sliver.get_default_flavor, to='core.Flavor', help_text=b'Flavor of this instance')),
-                ('image', models.ForeignKey(related_name=b'slivers', to='core.Image')),
-                ('node', models.ForeignKey(related_name=b'slivers', to='core.Node')),
-                ('slice', models.ForeignKey(related_name=b'slivers', to='core.Slice')),
+                ('creator', models.ForeignKey(related_name=b'instances', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
+                ('deployment', models.ForeignKey(related_name=b'instance_deployment', verbose_name=b'deployment', to='core.Deployment')),
+                ('flavor', models.ForeignKey(default=core.models.instance.get_default_flavor, to='core.Flavor', help_text=b'Flavor of this instance')),
+                ('image', models.ForeignKey(related_name=b'instances', to='core.Image')),
+                ('node', models.ForeignKey(related_name=b'instances', to='core.Node')),
+                ('slice', models.ForeignKey(related_name=b'instances', to='core.Slice')),
             ],
             options={
                 'abstract': False,
@@ -1207,8 +1207,8 @@
         ),
         migrations.AddField(
             model_name='reservedresource',
-            name='sliver',
-            field=models.ForeignKey(related_name=b'reservedresources', to='core.Sliver'),
+            name='instance',
+            field=models.ForeignKey(related_name=b'reservedresources', to='core.Instance'),
             preserve_default=True,
         ),
         migrations.AddField(
@@ -1242,9 +1242,9 @@
             preserve_default=True,
         ),
         migrations.AddField(
-            model_name='networksliver',
-            name='sliver',
-            field=models.ForeignKey(related_name=b'networkslivers', to='core.Sliver'),
+            model_name='networkinstance',
+            name='instance',
+            field=models.ForeignKey(related_name=b'networkinstances', to='core.Instance'),
             preserve_default=True,
         ),
         migrations.AddField(
@@ -1279,8 +1279,8 @@
         ),
         migrations.AddField(
             model_name='network',
-            name='slivers',
-            field=models.ManyToManyField(related_name=b'networks', through='core.NetworkSliver', to='core.Sliver', blank=True),
+            name='instances',
+            field=models.ManyToManyField(related_name=b'networks', through='core.NetworkInstance', to='core.Instance', blank=True),
             preserve_default=True,
         ),
         migrations.AddField(
diff --git a/xos/core/migrations/0011_sliver_instance_uuid.py b/xos/core/migrations/0011_sliver_instance_uuid.py
index dd8d05c..3320158 100644
--- a/xos/core/migrations/0011_sliver_instance_uuid.py
+++ b/xos/core/migrations/0011_sliver_instance_uuid.py
@@ -12,7 +12,7 @@
 
     operations = [
         migrations.AddField(
-            model_name='sliver',
+            model_name='instance',
             name='instance_uuid',
             field=models.CharField(help_text=b'Nova instance uuid', max_length=200, null=True, blank=True),
             preserve_default=True,
diff --git a/xos/core/models/__init__.py b/xos/core/models/__init__.py
index d48dc46..0efe37b 100644
--- a/xos/core/models/__init__.py
+++ b/xos/core/models/__init__.py
@@ -23,10 +23,10 @@
 from .site import SitePrivilege
 from .node import Node
 from .slicetag import SliceTag
-from .sliver import Sliver
+from .instance import Instance
 from .reservation import ReservedResource
 from .reservation import Reservation
-from .network import Network, NetworkParameterType, NetworkParameter, NetworkSliver, Port, NetworkTemplate, Router, NetworkSlice, ControllerNetwork
+from .network import Network, NetworkParameterType, NetworkParameter, NetworkInstance, Port, NetworkTemplate, Router, NetworkSlice, ControllerNetwork
 from .billing import Account, Invoice, Charge, UsableObject, Payment
 from .program import Program
 
diff --git a/xos/core/models/billing.py b/xos/core/models/billing.py
index 765e42f..6e517b4 100644
--- a/xos/core/models/billing.py
+++ b/xos/core/models/billing.py
@@ -2,7 +2,7 @@
 import os
 import socket
 from django.db import models
-from core.models import PlCoreBase, Site, Slice, Sliver, Deployment
+from core.models import PlCoreBase, Site, Slice, Instance, Deployment
 from core.models.plcorebase import StrippedCharField
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic
diff --git a/xos/core/models/sliver.py b/xos/core/models/instance.py
similarity index 80%
rename from xos/core/models/sliver.py
rename to xos/core/models/instance.py
index 4a00161..eb38ff9 100644
--- a/xos/core/models/sliver.py
+++ b/xos/core/models/instance.py
@@ -21,7 +21,7 @@
 config = Config()
 
 def get_default_flavor(controller = None):
-    # Find a default flavor that can be used for a sliver. This is particularly
+    # Find a default flavor that can be used for a instance. This is particularly
     # useful in evolution. It's also intended this helper function can be used
     # for admin.py when users
 
@@ -39,9 +39,9 @@
 
     return flavors[0]
 
-class SliverDeletionManager(PlCoreBaseDeletionManager):
+class InstanceDeletionManager(PlCoreBaseDeletionManager):
     def get_queryset(self):
-        parent=super(SliverDeletionManager, self)
+        parent=super(InstanceDeletionManager, self)
         try:
             backend_type = config.observer_backend_type
         except AttributeError:
@@ -58,9 +58,9 @@
         return self.get_queryset()
 
 
-class SliverManager(PlCoreBaseManager):
+class InstanceManager(PlCoreBaseManager):
     def get_queryset(self):
-        parent=super(SliverManager, self)
+        parent=super(InstanceManager, self)
 
         try:
             backend_type = config.observer_backend_type
@@ -79,21 +79,21 @@
         return self.get_queryset()
 
 # Create your models here.
-class Sliver(PlCoreBase):
-    objects = SliverManager()
-    deleted_objects = SliverDeletionManager()
+class Instance(PlCoreBase):
+    objects = InstanceManager()
+    deleted_objects = InstanceDeletionManager()
     instance_id = StrippedCharField(null=True, blank=True, max_length=200, help_text="Nova instance id")
     instance_uuid = StrippedCharField(null=True, blank=True, max_length=200, help_text="Nova instance uuid")
-    name = StrippedCharField(max_length=200, help_text="Sliver name")
+    name = StrippedCharField(max_length=200, help_text="Instance name")
     instance_name = StrippedCharField(blank=True, null=True, max_length=200, help_text="OpenStack generated name")
-    ip = models.GenericIPAddressField(help_text="Sliver ip address", blank=True, null=True)
-    image = models.ForeignKey(Image, related_name='slivers')
-    #key = models.ForeignKey(Key, related_name='slivers')
-    creator = models.ForeignKey(User, related_name='slivers', blank=True, null=True)
-    slice = models.ForeignKey(Slice, related_name='slivers')
-    deployment = models.ForeignKey(Deployment, verbose_name='deployment', related_name='sliver_deployment')
-    node = models.ForeignKey(Node, related_name='slivers')
-    numberCores = models.IntegerField(verbose_name="Number of Cores", help_text="Number of cores for sliver", default=0)
+    ip = models.GenericIPAddressField(help_text="Instance ip address", blank=True, null=True)
+    image = models.ForeignKey(Image, related_name='instances')
+    #key = models.ForeignKey(Key, related_name='instances')
+    creator = models.ForeignKey(User, related_name='instances', blank=True, null=True)
+    slice = models.ForeignKey(Slice, related_name='instances')
+    deployment = models.ForeignKey(Deployment, verbose_name='deployment', related_name='instance_deployment')
+    node = models.ForeignKey(Node, related_name='instances')
+    numberCores = models.IntegerField(verbose_name="Number of Cores", help_text="Number of cores for instance", default=0)
     flavor = models.ForeignKey(Flavor, help_text="Flavor of this instance", default=get_default_flavor)
     tags = generic.GenericRelation(Tag)
     userData = models.TextField(blank=True, null=True, help_text="user_data passed to instance during creation")
@@ -106,16 +106,16 @@
     def __unicode__(self):
         if self.name and Slice.objects.filter(id=self.slice_id) and (self.name != self.slice.name):
             # NOTE: The weird check on self.slice_id was due to a problem when
-            #   deleting the slice before the sliver.
+            #   deleting the slice before the instance.
             return u'%s' % self.name
         elif self.instance_name:
             return u'%s' % (self.instance_name)
         elif self.id:
             return u'uninstantiated-%s' % str(self.id)
         elif self.slice:
-            return u'unsaved-sliver on %s' % self.slice.name
+            return u'unsaved-instance on %s' % self.slice.name
         else:
-            return u'unsaved-sliver'
+            return u'unsaved-instance'
 
     def save(self, *args, **kwds):
         if not self.name:
@@ -123,20 +123,20 @@
         if not self.creator and hasattr(self, 'caller'):
             self.creator = self.caller
         if not self.creator:
-            raise ValidationError('sliver has no creator')
+            raise ValidationError('instance has no creator')
 
         if (self.slice.creator != self.creator):
             # Check to make sure there's a slice_privilege for the user. If there
             # isn't, then keystone will throw an exception inside the observer.
             slice_privs = SlicePrivilege.objects.filter(slice=self.slice, user=self.creator)
             if not slice_privs:
-                raise ValidationError('sliver creator has no privileges on slice')
+                raise ValidationError('instance creator has no privileges on slice')
 
 # XXX smbaker - disabled for now, was causing fault in tenant view create slice
 #        if not self.controllerNetwork.test_acl(slice=self.slice):
 #            raise exceptions.ValidationError("Deployment %s's ACL does not allow any of this slice %s's users" % (self.controllerNetwork.name, self.slice.name))
 
-        super(Sliver, self).save(*args, **kwds)
+        super(Instance, self).save(*args, **kwds)
 
     def can_update(self, user):
         return user.can_update_slice(self.slice)
@@ -166,18 +166,18 @@
     @staticmethod
     def select_by_user(user):
         if user.is_admin:
-            qs = Sliver.objects.all()
+            qs = Instance.objects.all()
         else:
             slices = Slice.select_by_user(user)
-            qs = Sliver.objects.filter(slice__in=slices)
+            qs = Instance.objects.filter(slice__in=slices)
         return qs
 
     def get_cpu_stats(self):
-        filter = 'instance_id=%s'%self.sliver_id
+        filter = 'instance_id=%s'%self.instance_id
         return monitor.get_meter('cpu',filter,None)
 
     def get_bw_stats(self):
-        filter = 'instance_id=%s'%self.sliver_id
+        filter = 'instance_id=%s'%self.instance_id
         return monitor.get_meter('network.outgoing.bytes',filter,None)
 
     def get_node_stats(self):
@@ -211,4 +211,4 @@
     except:
         instance.controller = None
 
-models.signals.post_init.connect(controller_setter, Sliver)
+models.signals.post_init.connect(controller_setter, Instance)
diff --git a/xos/core/models/network.py b/xos/core/models/network.py
index 321facd..dfda072 100644
--- a/xos/core/models/network.py
+++ b/xos/core/models/network.py
@@ -2,7 +2,7 @@
 import socket
 import sys
 from django.db import models
-from core.models import PlCoreBase, Site, Slice, Sliver, Controller
+from core.models import PlCoreBase, Site, Slice, Instance, Controller
 from core.models import ControllerLinkManager,ControllerLinkDeletionManager
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic
@@ -108,7 +108,7 @@
     permit_all_slices = models.BooleanField(default=False)
     permitted_slices = models.ManyToManyField(Slice, blank=True, related_name="availableNetworks")
     slices = models.ManyToManyField(Slice, blank=True, related_name="networks", through="NetworkSlice")
-    slivers = models.ManyToManyField(Sliver, blank=True, related_name="networks", through="NetworkSliver")
+    instances = models.ManyToManyField(Instance, blank=True, related_name="networks", through="NetworkInstance")
 
     topology_parameters = models.TextField(null=True, blank=True)
     controller_url = models.CharField(null=True, blank=True, max_length=1024)
@@ -189,9 +189,9 @@
     def save(self, *args, **kwds):
         slice = self.slice
         if (slice not in self.network.permitted_slices.all()) and (slice != self.network.owner) and (not self.network.permit_all_slices):
-            # to add a sliver to the network, then one of the following must be true:
-            #   1) sliver's slice is in network's permittedSlices list,
-            #   2) sliver's slice is network's owner, or
+            # to add a instance to the network, then one of the following must be true:
+            #   1) instance's slice is in network's permittedSlices list,
+            #   2) instance's slice is network's owner, or
             #   3) network's permitAllSlices is true
             raise ValueError("Slice %s is not allowed to connect to network %s" % (str(slice), str(self.network)))
 
@@ -211,44 +211,44 @@
             qs = NetworkSlice.objects.filter(id__in=slice_ids)
         return qs
 
-class NetworkSliver(PlCoreBase):
+class NetworkInstance(PlCoreBase):
     # Please use "Port" instead of "NetworkSliver". NetworkSliver will soon be
     # removed.
 
-    network = models.ForeignKey(Network,related_name='networkslivers')     # related_name='links'
-    sliver = models.ForeignKey(Sliver, null=True, blank=True, related_name='networkslivers')      # related_name='ports'
-    ip = models.GenericIPAddressField(help_text="Sliver ip address", blank=True, null=True)
+    network = models.ForeignKey(Network,related_name='networkinstances')
+    instance = models.ForeignKey(Instance, null=True, blank=True, related_name='networkinstances')
+    ip = models.GenericIPAddressField(help_text="Instance ip address", blank=True, null=True)
     port_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum port id")
     mac = models.CharField(null=True, blank=True, max_length=256, help_text="MAC address associated with this port")
 
     class Meta:
-        unique_together = ('network', 'sliver')
+        unique_together = ('network', 'instance')
 
     def save(self, *args, **kwds):
-        if self.sliver:
-            slice = self.sliver.slice
+        if self.instance:
+            slice = self.instance.slice
             if (slice not in self.network.permitted_slices.all()) and (slice != self.network.owner) and (not self.network.permit_all_slices):
-                # to add a sliver to the network, then one of the following must be true:
-                #   1) sliver's slice is in network's permittedSlices list,
-                #   2) sliver's slice is network's owner, or
+                # to add a instance to the network, then one of the following must be true:
+                #   1) instance's slice is in network's permittedSlices list,
+                #   2) instance's slice is network's owner, or
                 #   3) network's permitAllSlices is true
                 raise ValueError("Slice %s is not allowed to connect to network %s" % (str(slice), str(self.network)))
 
         if (not self.ip) and (NO_OBSERVER):
             from util.network_subnet_allocator import find_unused_address
             self.ip = find_unused_address(self.network.subnet,
-                                          [x.ip for x in self.network.networksliver_set.all()])
-        super(NetworkSliver, self).save(*args, **kwds)
+                                          [x.ip for x in self.network.networkinstance_set.all()])
+        super(NetworkInstance, self).save(*args, **kwds)
 
     def __unicode__(self):
-        if self.sliver:
-            return u'%s-%s' % (self.network.name, self.sliver.instance_name)
+        if self.instance:
+            return u'%s-%s' % (self.network.name, self.instance.instance_name)
         else:
             return u'%s-unboundport-%s' % (self.network.name, self.id)
 
     def can_update(self, user):
-        if self.sliver:
-            return user.can_update_slice(self.sliver.slice)
+        if self.instance:
+            return user.can_update_slice(self.instance.slice)
         if self.network:
             return user.can_update_slice(self.network.owner)
         return False
@@ -256,13 +256,13 @@
     @staticmethod
     def select_by_user(user):
         if user.is_admin:
-            qs = NetworkSliver.objects.all()
+            qs = NetworkInstance.objects.all()
         else:
-            sliver_ids = [s.id for s in NetworkSliver.select_by_user(user)]
-            qs = NetworkSliver.objects.filter(id__in=sliver_ids)
+            instance_ids = [s.id for s in NetworkInstance.select_by_user(user)]
+            qs = NetworkInstance.objects.filter(id__in=instance_ids)
         return qs
 
-class Port(NetworkSliver):
+class Port(NetworkInstance):
     # Rename in progress: NetworkSliver->Port
     class Meta:
         proxy = True
diff --git a/xos/core/models/reservation.py b/xos/core/models/reservation.py
index 1a838a2..ecf207c 100644
--- a/xos/core/models/reservation.py
+++ b/xos/core/models/reservation.py
@@ -2,7 +2,7 @@
 import datetime
 from django.db import models
 from core.models import PlCoreBase
-from core.models import Sliver
+from core.models import Instance
 from core.models import Slice
 from core.models import ServiceResource
 
@@ -32,7 +32,7 @@
         return qs
 
 class ReservedResource(PlCoreBase):
-    sliver = models.ForeignKey(Sliver, related_name="reservedresources")
+    instance = models.ForeignKey(Instance, related_name="reservedresources")
     resource = models.ForeignKey(ServiceResource, related_name="reservedresources")
     quantity = models.IntegerField(default=1)
     reservationSet = models.ForeignKey(Reservation, related_name="reservedresources")
@@ -40,18 +40,18 @@
     class Meta(PlCoreBase.Meta):
        verbose_name_plural = "Reserved Resources"
 
-    def __unicode__(self):  return u'%d %s on %s' % (self.quantity, self.resource, self.sliver)
+    def __unicode__(self):  return u'%d %s on %s' % (self.quantity, self.resource, self.instance)
 
     def can_update(self, user):
-        return user.can_update(self.sliver.slice)
+        return user.can_update(self.instance.slice)
 
     @staticmethod
     def select_by_user(user):
         if user.is_admin:
             qs = ReservedResource.objects.all()
         else:
-            sliver_ids = [s.id for s in Sliver.select_by_user(user)]
-            qs = ReservedResource.objects.filter(id__in=sliver_ids)
+            instance_ids = [s.id for s in Instance.select_by_user(user)]
+            qs = ReservedResource.objects.filter(id__in=instance_ids)
         return qs
 
 
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index c46b165..b69acf1 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -88,25 +88,25 @@
              Get a list of nodes that can be used to scale up a slice.
 
                 slice - slice to scale up
-                max_per_node - maximum numbers of slivers that 'slice' can have on a single node
+                max_per_node - maximum numbers of instances that 'slice' can have on a single node
                 exclusive_slices - list of slices that must have no nodes in common with 'slice'.
         """
 
-        from core.models import Node, Sliver # late import to get around order-of-imports constraint in __init__.py
+        from core.models import Node, Instance # late import to get around order-of-imports constraint in __init__.py
 
         nodes = list(Node.objects.all())
 
-        conflicting_slivers = Sliver.objects.filter(slice__in = exclusive_slices)
-        conflicting_nodes = Node.objects.filter(slivers__in = conflicting_slivers)
+        conflicting_instances = Instance.objects.filter(slice__in = exclusive_slices)
+        conflicting_nodes = Node.objects.filter(instances__in = conflicting_instances)
 
         nodes = [x for x in nodes if x not in conflicting_nodes]
 
-        # If max_per_node is set, then limit the number of slivers this slice
+        # If max_per_node is set, then limit the number of instances this slice
         # can have on a single node.
         if max_per_node:
             acceptable_nodes = []
             for node in nodes:
-                existing_count = node.slivers.filter(slice=slice).count()
+                existing_count = node.instances.filter(slice=slice).count()
                 if existing_count < max_per_node:
                     acceptable_nodes.append(node)
             nodes = acceptable_nodes
@@ -117,22 +117,22 @@
         # Pick the best node to scale up a slice.
 
         nodes = self.get_scalable_nodes(slice, max_per_node, exclusive_slices)
-        nodes = sorted(nodes, key=lambda node: node.slivers.all().count())
+        nodes = sorted(nodes, key=lambda node: node.instances.all().count())
         if not nodes:
             return None
         return nodes[0]
 
     def adjust_scale(self, slice_hint, scale, max_per_node=None, exclusive_slices=[]):
-        from core.models import Sliver # late import to get around order-of-imports constraint in __init__.py
+        from core.models import Instance # late import to get around order-of-imports constraint in __init__.py
 
         slices = [x for x in self.slices.all() if slice_hint in x.name]
         for slice in slices:
-            while slice.slivers.all().count() > scale:
-                s = slice.slivers.all()[0]
-                # print "drop sliver", s
+            while slice.instances.all().count() > scale:
+                s = slice.instances.all()[0]
+                # print "drop instance", s
                 s.delete()
 
-            while slice.slivers.all().count() < scale:
+            while slice.instances.all().count() < scale:
                 node = self.pick_node(slice, max_per_node, exclusive_slices)
                 if not node:
                     # no more available nodes
@@ -146,7 +146,7 @@
                 if not flavor:
                     raise XOSConfigurationError("No default_flavor for slice %s" % slice.name)
 
-                s = Sliver(slice=slice,
+                s = Instance(slice=slice,
                            node=node,
                            creator=slice.creator,
                            image=image,
@@ -154,7 +154,7 @@
                            deployment=node.site_deployment.deployment)
                 s.save()
 
-                # print "add sliver", s
+                # print "add instance", s
 
 class ServiceAttribute(PlCoreBase):
     name = models.SlugField(help_text="Attribute Name", max_length=128)
diff --git a/xos/core/models/slice.py b/xos/core/models/slice.py
index 76f5041..18d3cb6 100644
--- a/xos/core/models/slice.py
+++ b/xos/core/models/slice.py
@@ -25,7 +25,7 @@
     description=models.TextField(blank=True,help_text="High level description of the slice and expected activities", max_length=1024)
     slice_url = models.URLField(blank=True, max_length=512)
     site = models.ForeignKey(Site, related_name='slices', help_text="The Site this Slice belongs to")
-    max_slivers = models.IntegerField(default=10)
+    max_instances = models.IntegerField(default=10)
     service = models.ForeignKey(Service, related_name='slices', null=True, blank=True)
     network = StrippedCharField(default="Private Only",null=True, blank=True, max_length=256)
     tags = generic.GenericRelation(Tag)
@@ -192,4 +192,4 @@
         return monitor.get_meter('network.outgoing.bytes',filter,None)
 
     def get_node_stats(self):
-        return len(self.slice.slivers)
+        return len(self.slice.instances)
diff --git a/xos/core/models/user.py b/xos/core/models/user.py
index 2ea90da..cb90145 100644
--- a/xos/core/models/user.py
+++ b/xos/core/models/user.py
@@ -339,12 +339,12 @@
 
     def get_readable_objects(self, filter_by=None):
        """ Returns a list of objects that the user is allowed to read. """
-       from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Sliver, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege
+       from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Instance, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege
        models = []
        if filter_by and isinstance(filter_by, list):
            models = [m for m in filter_by if issubclass(m, PlModelMixIn)]
        if not models:
-           models = [Deployment, Network, Site, Slice, SliceTag, Sliver, Tag, User]
+           models = [Deployment, Network, Site, Slice, SliceTag, Instance, Tag, User]
        readable_objects = []
        for model in models:
            readable_objects.extend(model.select_by_user(self))
@@ -362,7 +362,7 @@
           list of dicts  
        
         """
-        from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Sliver, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege   
+        from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Instance, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege   
         READ = 'r'
         READWRITE = 'rw'
         models = []
@@ -371,7 +371,7 @@
 
         deployment_priv_objs = [Image, NetworkTemplate, Flavor]
         site_priv_objs = [Node, Slice, User]
-        slice_priv_objs = [Sliver, Network] 
+        slice_priv_objs = [Instance, Network] 
         
         # maps the set of objects a paticular role has write access
         write_map = {
diff --git a/xos/core/serializers.py b/xos/core/serializers.py
index 3fb726d..d84f111 100644
--- a/xos/core/serializers.py
+++ b/xos/core/serializers.py
@@ -109,7 +109,7 @@
     # HyperlinkedModelSerializer doesn't include the id by default
     id = serializers.Field()
     site = serializers.HyperlinkedRelatedField(view_name='site-detail')
-    slivers = serializers.HyperlinkedRelatedField(view_name='sliver-detail')
+    instances = serializers.HyperlinkedRelatedField(view_name='instance-detail')
     class Meta:
         model = Slice
         fields = ('id',
@@ -128,7 +128,7 @@
 		  'network',
 		  'mountDataSets',
                   'site',
-                  'slivers',
+                  'instances',
                   'updated',
                   'created')
 
@@ -185,7 +185,7 @@
                   'site',
                   'role')
 
-class SliverSerializer(serializers.HyperlinkedModelSerializer):
+class InstanceSerializer(serializers.HyperlinkedModelSerializer):
     # HyperlinkedModelSerializer doesn't include the id by default
     id = serializers.Field()
     image = serializers.HyperlinkedRelatedField(view_name='image-detail')
@@ -196,7 +196,7 @@
     #slice = serializers.PrimaryKeyRelatedField(read_only=True)
 
     class Meta:
-        model = Sliver
+        model = Instance
         fields = ('id',
                   'url',
                   'instance_id',
@@ -261,7 +261,7 @@
                  SitePrivilege: SitePrivilegeSerializer,
                  Slice: SliceSerializer,
                  SlicePrivilege: SlicePrivilegeSerializer,
-                 Sliver: SliverSerializer,
+                 Instance: InstanceSerializer,
                  Tag: TagSerializer,
                  User: UserSerializer,
                  None: None,
diff --git a/xos/core/tests.py b/xos/core/tests.py
index a02497e..e3d7faa 100644
--- a/xos/core/tests.py
+++ b/xos/core/tests.py
@@ -7,7 +7,7 @@
 from datetime import datetime
 
 FIXTURES_FILE = 'core/fixtures/initial_data.json'
-MODELS = ['Deployment','Image','Node','Reservation','Slice','Sliver','User']
+MODELS = ['Deployment','Image','Node','Reservation','Slice','Instance','User']
 
 def is_dynamic_type(x):
 	t = type(x)
diff --git a/xos/core/views/hpc_config.py b/xos/core/views/hpc_config.py
index af183bf..c83c01b 100644
--- a/xos/core/views/hpc_config.py
+++ b/xos/core/views/hpc_config.py
@@ -58,11 +58,11 @@
         if not cmiSlice:
             return HttpResponseServerError("Error: no CMI slice")
 
-        if len(cmiSlice.slivers.all())==0:
-            return HttpResponseServerError("Error: CMI slice has no slivers")
+        if len(cmiSlice.instances.all())==0:
+            return HttpResponseServerError("Error: CMI slice has no instances")
 
         # for now, assuming using NAT
-        cmi_hostname = cmiSlice.slivers.all()[0].node.name
+        cmi_hostname = cmiSlice.instances.all()[0].node.name
 
     if not hpcSlice:
         return HttpResponseServerError("Error: no HPC slice")
diff --git a/xos/core/views/instances.py b/xos/core/views/instances.py
new file mode 100644
index 0000000..e424538
--- /dev/null
+++ b/xos/core/views/instances.py
@@ -0,0 +1,13 @@
+from core.serializers import InstanceSerializer
+from rest_framework import generics
+from core.models import Instance
+
+class InstanceList(generics.ListCreateAPIView):
+    queryset = Instance.objects.all()
+    serializer_class = InstanceSerializer
+
+class InstanceDetail(generics.RetrieveUpdateDestroyAPIView):
+    queryset = Instance.objects.all()
+    serializer_class = InstanceSerializer
+
+
diff --git a/xos/core/views/legacyapi.py b/xos/core/views/legacyapi.py
index fe86871..4657116 100644
--- a/xos/core/views/legacyapi.py
+++ b/xos/core/views/legacyapi.py
@@ -6,7 +6,7 @@
 import traceback
 import xmlrpclib
 
-from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
+from core.models import Slice, Instance, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
 
 from django.http import HttpResponse
 from django.views.decorators.csrf import csrf_exempt
@@ -52,8 +52,8 @@
                 continue
 
         node_ids=[]
-        for ps_sliver in ps_slice.slivers.all():
-            node_ids.append(ps_id_to_pl_id(ps_sliver.node.id))
+        for ps_instance in ps_slice.instances.all():
+            node_ids.append(ps_id_to_pl_id(ps_instance.node.id))
 
         slice = {"instantiation": "plc-instantiated",
                  "description": "XOS slice",
@@ -81,8 +81,8 @@
     nodes = []
     for ps_node in ps_nodes:
         slice_ids=[]
-        for ps_sliver in ps_node.slivers.all():
-            slice_ids.append(pl_slice_id(ps_sliver.slice, slice_remap))
+        for ps_instance in ps_node.instances.all():
+            slice_ids.append(pl_slice_id(ps_instance.slice, slice_remap))
 
         node = {"node_id": ps_id_to_pl_id(ps_node.id),
                 "site_id": ps_id_to_pl_id(ps_node.site_id),
@@ -125,7 +125,7 @@
                 "node_ids": node_ids,
                 "pcu_ids": [],
                 "max_slices": 100,
-                "max_slivers": 1000,
+                "max_instances": 1000,
                 "is_public": False,
                 "peer_site_id": None,
                 "abbrebiated_name": ps_site.abbreviated_name,
@@ -150,17 +150,17 @@
     interfaces = []
     ps_slices = Slice.objects.filter(name=slicename)
     for ps_slice in ps_slices:
-        for ps_sliver in ps_slice.slivers.all():
-            node_id = ps_id_to_pl_id(ps_sliver.node_id)
+        for ps_instance in ps_slice.instances.all():
+            node_id = ps_id_to_pl_id(ps_instance.node_id)
             if node_id in node_ids:
-                ps_node = ps_sliver.node
+                ps_node = ps_instance.node
 
                 ip = socket.gethostbyname(ps_node.name.strip())
 
                 # If the slice has a network that's labeled for hpc_client, then
                 # return that network.
                 found_labeled_network = False
-                for port in ps_sliver.ports.all():
+                for port in ps_instance.ports.all():
                     if (not port.ip):
                         continue
                     if (port.network.owner != ps_slice):
@@ -171,7 +171,7 @@
 
                 if not found_labeled_network:
                     # search for a dedicated public IP address
-                    for port in ps_sliver.ports.all():
+                    for port in ps_instance.ports.all():
                         if (not port.ip):
                             continue
                         template = port.network.template
@@ -180,7 +180,7 @@
 
                 if return_nat:
                     ip = None
-                    for port in ps_sliver.ports.all():
+                    for port in ps_instance.ports.all():
                         if (not port.ip):
                             continue
                         template = port.network.template
@@ -191,7 +191,7 @@
 
                 if return_private:
                     ip = None
-                    for port in ps_sliver.ports.all():
+                    for port in ps_instance.ports.all():
                         if (not port.ip):
                             continue
                         template = port.network.template
@@ -226,7 +226,7 @@
     else:
         node_id = 0
 
-    node_sliver_tags = GetTags(slicename, node_id)
+    node_instance_tags = GetTags(slicename, node_id)
 
     slices = GetSlices({"name": slicename}, slice_remap=slice_remap)
     perhost = {}
@@ -266,12 +266,12 @@
             hostprivmap[nodemap[interface['node_id']]] = interface['ip']
 
         for nid in node_ids:
-            sliver_tags = GetTags(slicename,nid)
-            perhost[nodemap[nid]] = sliver_tags
+            instance_tags = GetTags(slicename,nid)
+            perhost[nodemap[nid]] = instance_tags
 
-    slivers = GetSlices(slice_remap=slice_remap)
+    instances = GetSlices(slice_remap=slice_remap)
     if node_id != 0:
-        slivers = [slice for slice in slivers if (node_id in slice.node_ids)]
+        instances = [slice for slice in instances if (node_id in slice.node_ids)]
 
     sites = GetSites(slice_remap=slice_remap)
     for site in sites:
@@ -280,12 +280,12 @@
     timestamp = int(time.time())
     return {'version': 3,
             'timestamp': timestamp,
-            'configuration': node_sliver_tags,
+            'configuration': node_instance_tags,
             'allconfigurations':perhost,
             'hostipmap':hostipmap,
             'hostnatmap':hostnatmap,
             'hostprivmap':hostprivmap,
-            'slivers': slivers,
+            'instances': instances,
             'interfaces': allinterfaces,
             'sites': sites,
             'nodes': nodes}
diff --git a/xos/core/views/slivers.py b/xos/core/views/slivers.py
deleted file mode 100644
index bb310da..0000000
--- a/xos/core/views/slivers.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from core.serializers import SliverSerializer
-from rest_framework import generics
-from core.models import Sliver
-
-class SliverList(generics.ListCreateAPIView):
-    queryset = Sliver.objects.all()
-    serializer_class = SliverSerializer
-
-class SliverDetail(generics.RetrieveUpdateDestroyAPIView):
-    queryset = Sliver.objects.all()
-    serializer_class = SliverSerializer
-
-
diff --git a/xos/core/xoslib/methods/cordsubscriber.py b/xos/core/xoslib/methods/cordsubscriber.py
index e504c71..ea8da80 100644
--- a/xos/core/xoslib/methods/cordsubscriber.py
+++ b/xos/core/xoslib/methods/cordsubscriber.py
@@ -30,7 +30,7 @@
         service_specific_id = ReadOnlyField()
         vlan_id = ReadOnlyField()
         vcpe_id = ReadOnlyField()
-        sliver = ReadOnlyField()
+        instance = ReadOnlyField()
         image = ReadOnlyField()
         vbng_id = ReadOnlyField()
         firewall_enable = serializers.BooleanField()
@@ -39,7 +39,7 @@
         url_filter_rules = serializers.CharField()
         url_filter_level = serializers.CharField(required=False)
         cdn_enable = serializers.BooleanField()
-        sliver_name = ReadOnlyField()
+        instance_name = ReadOnlyField()
         image_name = ReadOnlyField()
         routeable_subnet = serializers.CharField(required=False)
         ssh_command = ReadOnlyField()
@@ -60,7 +60,7 @@
             model = CordSubscriber
             fields = ('humanReadableName', 'id',
                       'service_specific_id', 'vlan_id',
-                      'vcpe_id', 'sliver', 'sliver_name', 'image', 'image_name',
+                      'vcpe_id', 'instance', 'instance_name', 'image', 'image_name',
                       'firewall_enable', 'firewall_rules',
                       'url_filter_enable', 'url_filter_rules', 'url_filter_level',
                       'bbs_account',
diff --git a/xos/core/xoslib/methods/hpcview.py b/xos/core/xoslib/methods/hpcview.py
index 0645405..f14b398 100644
--- a/xos/core/xoslib/methods/hpcview.py
+++ b/xos/core/xoslib/methods/hpcview.py
@@ -24,16 +24,16 @@
     except:
         return service.service.all()
 
-def lookup_tag(service, sliver, name, default=None):
-    sliver_type = ContentType.objects.get_for_model(sliver)
-    t = Tag.objects.filter(service=service, name=name, content_type__pk=sliver_type.id, object_id=sliver.id)
+def lookup_tag(service, instance, name, default=None):
+    instance_type = ContentType.objects.get_for_model(instance)
+    t = Tag.objects.filter(service=service, name=name, content_type__pk=instance_type.id, object_id=instance.id)
     if t:
         return t[0].value
     else:
         return default
 
-def lookup_time(service, sliver, name):
-    v = lookup_tag(service, sliver, name)
+def lookup_time(service, instance, name):
+    v = lookup_tag(service, instance, name)
     if v:
         return str(time.time() - float(v))
     else:
@@ -69,22 +69,22 @@
     return config_run
 
 # from hpc_watcher.py
-def get_public_ip(service, sliver):
+def get_public_ip(service, instance):
     network_name = None
-    if "hpc" in sliver.slice.name:
+    if "hpc" in instance.slice.name:
         network_name = getattr(service, "watcher_hpc_network", None)
-    elif "demux" in sliver.slice.name:
+    elif "demux" in instance.slice.name:
         network_name = getattr(service, "watcher_dnsdemux_network", None)
-    elif "redir" in sliver.slice.name:
+    elif "redir" in instance.slice.name:
         network_name = getattr(service, "watcher_dnsredir_network", None)
 
     if network_name and network_name.lower()=="nat":
         return None
 
     if (network_name is None) or (network_name=="") or (network_name.lower()=="public"):
-        return sliver.get_public_ip()
+        return instance.get_public_ip()
 
-    for ns in sliver.networkslivers.all():
+    for ns in instance.networkinstances.all():
         if (ns.ip) and (ns.network.name==network_name):
             return ns.ip
 
@@ -143,50 +143,50 @@
             nameservers[nameserver] = {"name": nameserver, "ip": "exception", "hit": False}
 
     dnsdemux=[]
-    for sliver in dnsdemux_slice.slivers.all():
+    for instance in dnsdemux_slice.instances.all():
         ip=None
         try:
-            ip = get_public_ip(dnsdemux_service, sliver)
+            ip = get_public_ip(dnsdemux_service, instance)
         except Exception, e:
             ip = "Exception: " + str(e)
         if not ip:
             try:
-                ip = socket.gethostbyname(sliver.node.name)
+                ip = socket.gethostbyname(instance.node.name)
             except:
-                ip = "??? " + sliver.node.name
+                ip = "??? " + instance.node.name
 
-        sliver_nameservers = []
+        instance_nameservers = []
         for ns in nameservers.values():
             if ns["ip"]==ip:
-                sliver_nameservers.append(ns["name"])
+                instance_nameservers.append(ns["name"])
                 ns["hit"]=True
 
-        # now find the dnsredir sliver that is also on this node
-        watcherd_dnsredir = "no-redir-sliver"
-        for dnsredir_sliver in dnsredir_slice.slivers.all():
-            if dnsredir_sliver.node == sliver.node:
-                watcherd_dnsredir = lookup_tag(dnsredir_service, dnsredir_sliver, "watcher.watcher.msg")
+        # now find the dnsredir instance that is also on this node
+        watcherd_dnsredir = "no-redir-instance"
+        for dnsredir_instance in dnsredir_slice.instances.all():
+            if dnsredir_instance.node == instance.node:
+                watcherd_dnsredir = lookup_tag(dnsredir_service, dnsredir_instance, "watcher.watcher.msg")
 
-        watcherd_dnsdemux = lookup_tag(dnsdemux_service, sliver, "watcher.watcher.msg")
+        watcherd_dnsdemux = lookup_tag(dnsdemux_service, instance, "watcher.watcher.msg")
 
-        dnsdemux.append( {"name": sliver.node.name,
-                       "watcher.DNS.msg": lookup_tag(dnsdemux_service, sliver, "watcher.DNS.msg"),
-                       "watcher.DNS.time": lookup_time(dnsdemux_service, sliver, "watcher.DNS.time"),
+        dnsdemux.append( {"name": instance.node.name,
+                       "watcher.DNS.msg": lookup_tag(dnsdemux_service, instance, "watcher.DNS.msg"),
+                       "watcher.DNS.time": lookup_time(dnsdemux_service, instance, "watcher.DNS.time"),
                        "ip": ip,
-                       "nameservers": sliver_nameservers,
+                       "nameservers": instance_nameservers,
                        "dnsdemux_config_age": compute_config_run(watcherd_dnsdemux),
                        "dnsredir_config_age": compute_config_run(watcherd_dnsredir) })
 
     hpc=[]
-    for sliver in hpc_slice.slivers.all():
-        watcherd_hpc = lookup_tag(hpc_service, sliver, "watcher.watcher.msg")
+    for instance in hpc_slice.instances.all():
+        watcherd_hpc = lookup_tag(hpc_service, instance, "watcher.watcher.msg")
 
-        hpc.append( {"name": sliver.node.name,
-                     "watcher.HPC-hb.msg": lookup_tag(hpc_service, sliver, "watcher.HPC-hb.msg"),
-                     "watcher.HPC-hb.time": lookup_time(hpc_service, sliver, "watcher.HPC-hb.time"),
-                     "watcher.HPC-fetch.msg": lookup_tag(hpc_service, sliver, "watcher.HPC-fetch.msg"),
-                     "watcher.HPC-fetch.time": lookup_time(hpc_service, sliver, "watcher.HPC-fetch.time"),
-                     "watcher.HPC-fetch.urls": json_default(lookup_tag(hpc_service, sliver, "watcher.HPC-fetch-urls.msg"), []),
+        hpc.append( {"name": instance.node.name,
+                     "watcher.HPC-hb.msg": lookup_tag(hpc_service, instance, "watcher.HPC-hb.msg"),
+                     "watcher.HPC-hb.time": lookup_time(hpc_service, instance, "watcher.HPC-hb.time"),
+                     "watcher.HPC-fetch.msg": lookup_tag(hpc_service, instance, "watcher.HPC-fetch.msg"),
+                     "watcher.HPC-fetch.time": lookup_time(hpc_service, instance, "watcher.HPC-fetch.time"),
+                     "watcher.HPC-fetch.urls": json_default(lookup_tag(hpc_service, instance, "watcher.HPC-fetch-urls.msg"), []),
                      "config_age": compute_config_run(watcherd_hpc),
 
         })
diff --git a/xos/core/xoslib/methods/sliceplus.py b/xos/core/xoslib/methods/sliceplus.py
index 12f7c1a..c339789 100644
--- a/xos/core/xoslib/methods/sliceplus.py
+++ b/xos/core/xoslib/methods/sliceplus.py
@@ -66,7 +66,7 @@
 
         class Meta:
             model = SlicePlus
-            fields = ('humanReadableName', 'id','created','updated','enacted','name','enabled','omf_friendly','description','slice_url','site','max_slivers','service','network','mount_data_sets',
+            fields = ('humanReadableName', 'id','created','updated','enacted','name','enabled','omf_friendly','description','slice_url','site','max_instances','service','network','mount_data_sets',
                       'default_image', 'default_flavor',
                       'serviceClass','creator','networks','sliceInfo','network_ports','backendIcon','backendHtml','site_allocation','site_ready','users',"user_names","current_user_can_see")
 
diff --git a/xos/core/xoslib/methods/sshkeys.py b/xos/core/xoslib/methods/sshkeys.py
index a714212..8413e65 100644
--- a/xos/core/xoslib/methods/sshkeys.py
+++ b/xos/core/xoslib/methods/sshkeys.py
@@ -16,16 +16,16 @@
 
     def get(self, request, format=None):
         instances=[]
-        for sliver in self.get_queryset().all():
-            if sliver.instance_id:
-                instances.append( {"id": sliver.instance_id,
-                                   "public_keys": sliver.get_public_keys(),
-                                   "node_name": sliver.node.name } )
+        for instance in self.get_queryset().all():
+            if instance.instance_id:
+                instances.append( {"id": instance.instance_id,
+                                   "public_keys": instance.get_public_keys(),
+                                   "node_name": instance.node.name } )
 
         return Response(instances)
 
     def get_queryset(self):
-        queryset = queryset=Sliver.objects.all()
+        queryset = queryset=Instance.objects.all()
 
         node_name = self.request.QUERY_PARAMS.get('node_name', None)
         if node_name is not None:
@@ -38,15 +38,15 @@
     method_name = "sshkeys"
 
     def get(self, request, format=None, pk=0):
-        slivers = self.get_queryset().filter(instance_id=pk)
-        if not slivers:
-            raise XOSNotFound("didn't find sliver for instance %s" % pk)
-        return Response( [ {"id": slivers[0].instance_id,
-                            "public_keys": slivers[0].get_public_keys(),
-                            "node_name": slivers[0].node.name } ])
+        instances = self.get_queryset().filter(instance_id=pk)
+        if not instances:
+            raise XOSNotFound("didn't find instance for instance %s" % pk)
+        return Response( [ {"id": instances[0].instance_id,
+                            "public_keys": instances[0].get_public_keys(),
+                            "node_name": instances[0].node.name } ])
 
     def get_queryset(self):
-        queryset = queryset=Sliver.objects.all()
+        queryset = queryset=Instance.objects.all()
 
         node_name = self.request.QUERY_PARAMS.get('node_name', None)
         if node_name is not None:
diff --git a/xos/core/xoslib/methods/volttenant.py b/xos/core/xoslib/methods/volttenant.py
index ba0e909..e5998da 100644
--- a/xos/core/xoslib/methods/volttenant.py
+++ b/xos/core/xoslib/methods/volttenant.py
@@ -44,10 +44,10 @@
             vcpe = obj.vcpe
             if not vcpe:
                 return None
-            sliver = vcpe.sliver
-            if not sliver:
+            instance = vcpe.instance
+            if not instance:
                 return None
-            return sliver.node.name
+            return instance.node.name
 
 class VOLTTenantList(XOSListCreateAPIView):
     serializer_class = VOLTTenantIdSerializer
diff --git a/xos/core/xoslib/objects/cordsubscriber.py b/xos/core/xoslib/objects/cordsubscriber.py
index 63dfec2..318d54c 100644
--- a/xos/core/xoslib/objects/cordsubscriber.py
+++ b/xos/core/xoslib/objects/cordsubscriber.py
@@ -1,4 +1,4 @@
-from core.models import Slice, SlicePrivilege, SliceRole, Sliver, Site, Node, User
+from core.models import Slice, SlicePrivilege, SliceRole, Instance, Site, Node, User
 from cord.models import VOLTTenant, CordSubscriberRoot
 from plus import PlusObjectMixin
 from operator import itemgetter, attrgetter
@@ -40,8 +40,8 @@
                      ("cdn_enable", "vcpe.cdn_enable"),
                      ("image", "vcpe.image.id"),
                      ("image_name", "vcpe.image.name"),
-                     ("sliver", "vcpe.sliver.id"),
-                     ("sliver_name", "vcpe.sliver.name"),
+                     ("instance", "vcpe.instance.id"),
+                     ("instance_name", "vcpe.instance.name"),
                      ("routeable_subnet", "vcpe.vbng.routeable_subnet"),
                      ("vcpe_id", "vcpe.id"),
                      ("vbng_id", "vcpe.vbng.id"),
@@ -119,8 +119,8 @@
                      ("ssh_command", "volt.vcpe.ssh_command"),
                      ("image", "volt.vcpe.image.id"),
                      ("image_name", "volt.vcpe.image.name"),
-                     ("sliver", "volt.vcpe.sliver.id"),
-                     ("sliver_name", "volt.vcpe.sliver.name"),
+                     ("instance", "volt.vcpe.instance.id"),
+                     ("instance_name", "volt.vcpe.instance.name"),
                      ("routeable_subnet", "volt.vcpe.vbng.routeable_subnet"),
                      ("vcpe_id", "volt.vcpe.id"),
                      ("vbng_id", "volt.vcpe.vbng.id"),
diff --git a/xos/core/xoslib/objects/sliceplus.py b/xos/core/xoslib/objects/sliceplus.py
index 47c93d7..9d2868f 100644
--- a/xos/core/xoslib/objects/sliceplus.py
+++ b/xos/core/xoslib/objects/sliceplus.py
@@ -1,4 +1,4 @@
-from core.models import Slice, SlicePrivilege, SliceRole, Sliver, Site, Node, User
+from core.models import Slice, SlicePrivilege, SliceRole, Instance, Site, Node, User
 from plus import PlusObjectMixin
 from operator import itemgetter, attrgetter
 from rest_framework.exceptions import APIException
@@ -22,16 +22,16 @@
             used_sites = {}
             ready_sites = {}
             used_deployments = {}
-            sliverCount = 0
+            instanceCount = 0
             sshCommands = []
-            for sliver in self.slivers.all():
-                site = sliver.node.site_deployment.site
-                deployment = sliver.node.site_deployment.deployment
+            for instance in self.instances.all():
+                site = instance.node.site_deployment.site
+                deployment = instance.node.site_deployment.deployment
                 used_sites[site.name] = used_sites.get(site.name, 0) + 1
                 used_deployments[deployment.name] = used_deployments.get(deployment.name, 0) + 1
-                sliverCount = sliverCount + 1
+                instanceCount = instanceCount + 1
 
-                sshCommand = sliver.get_ssh_command()
+                sshCommand = instance.get_ssh_command()
                 if sshCommand:
                     sshCommands.append(sshCommand)
 
@@ -57,7 +57,7 @@
             self._sliceInfo= {"sitesUsed": used_sites,
                     "sitesReady": ready_sites,
                     "deploymentsUsed": used_deployments,
-                    "sliverCount": sliverCount,
+                    "instanceCount": instanceCount,
                     "siteCount": len(used_sites.keys()),
                     "users": users,
                     "roles": [],
@@ -127,10 +127,10 @@
         nodeList = []
         for node in Node.objects.all():
             if (node.site_deployment.site.id in siteIDList):
-                node.sliverCount = 0
-                for sliver in node.slivers.all():
-                     if sliver.slice.id == self.id:
-                         node.sliverCount = node.sliverCount + 1
+                node.instanceCount = 0
+                for instance in node.instances.all():
+                     if instance.slice.id == self.id:
+                         node.instanceCount = node.instanceCount + 1
                 nodeList.append(node)
         return nodeList
 
@@ -170,58 +170,58 @@
         print "save_site_allocation, reset=",reset
 
         if (not self._site_allocation):
-            # Must be a sliver that was just created, and has not site_allocation
+            # Must be a instance that was just created, and has not site_allocation
             # field.
             return
 
-        all_slice_slivers = self.slivers.all()
+        all_slice_instances = self.instances.all()
         for site_name in self._site_allocation.keys():
             desired_allocation = self._site_allocation[site_name]
 
-            # make a list of the slivers for this site
-            slivers = []
-            for sliver in all_slice_slivers:
-                if sliver.node.site_deployment.site.name == site_name:
-                    slivers.append(sliver)
+            # make a list of the instances for this site
+            instances = []
+            for instance in all_slice_instances:
+                if instance.node.site_deployment.site.name == site_name:
+                    instances.append(instance)
 
-            # delete extra slivers
-            while (reset and len(slivers)>0) or (len(slivers) > desired_allocation):
-                sliver = slivers.pop()
+            # delete extra instances
+            while (reset and len(instances)>0) or (len(instances) > desired_allocation):
+                instance = instances.pop()
                 if (not noAct):
-                    print "deleting sliver", sliver
-                    sliver.delete()
+                    print "deleting instance", instance
+                    instance.delete()
                 else:
-                    print "would delete sliver", sliver
+                    print "would delete instance", instance
 
-            # add more slivers
-            if (len(slivers) < desired_allocation):
+            # add more instances
+            if (len(instances) < desired_allocation):
                 site = Site.objects.get(name = site_name)
                 nodes = self.get_node_allocation([site])
 
                 if (not nodes):
                     raise APIException(detail="no nodes in site %s" % site_name)
 
-                while (len(slivers) < desired_allocation):
+                while (len(instances) < desired_allocation):
                     # pick the least allocated node
-                    nodes = sorted(nodes, key=attrgetter("sliverCount"))
+                    nodes = sorted(nodes, key=attrgetter("instanceCount"))
                     node = nodes[0]
 
-                    sliver = Sliver(name=node.name,
+                    instance = Instance(name=node.name,
                             slice=self,
                             node=node,
                             image = self.default_image,
                             flavor = self.default_flavor,
                             creator = self.creator,
                             deployment = node.site_deployment.deployment)
-                    sliver.caller = self.caller
-                    slivers.append(sliver)
+                    instance.caller = self.caller
+                    instances.append(instance)
                     if (not noAct):
-                        print "added sliver", sliver
-                        sliver.save()
+                        print "added instance", instance
+                        instance.save()
                     else:
-                        print "would add sliver", sliver
+                        print "would add instance", instance
 
-                    node.sliverCount = node.sliverCount + 1
+                    node.instanceCount = node.instanceCount + 1
 
     def save_users(self, noAct = False):
         new_users = self._update_users
diff --git a/xos/ec2_observer/deleters/instance_deleter.py b/xos/ec2_observer/deleters/instance_deleter.py
new file mode 100644
index 0000000..60f9e47
--- /dev/null
+++ b/xos/ec2_observer/deleters/instance_deleter.py
@@ -0,0 +1,14 @@
+from core.models import Instance, SliceDeployments
+from observer.deleter import Deleter
+
+class InstanceDeleter(Deleter):
+    model='Instance'
+
+    def call(self, pk):
+        instance = Instance.objects.get(pk=pk)
+        if instance.instance_id:
+            driver = self.driver.client_driver(caller=instance.creator, 
+                                               tenant=instance.slice.name,
+                                               deployment=instance.deploymentNetwork.name)
+            driver.destroy_instance(instance.instance_id)
+        instance.delete()
diff --git a/xos/ec2_observer/deleters/network_instance_deleter.py b/xos/ec2_observer/deleters/network_instance_deleter.py
new file mode 100644
index 0000000..8a8f516
--- /dev/null
+++ b/xos/ec2_observer/deleters/network_instance_deleter.py
@@ -0,0 +1,13 @@
+from core.models import NetworkInstance
+from observer.deleter import Deleter
+
+class NetworkInstanceDeleter(Deleter):
+    model='NetworkInstance'
+
+    def call(self, pk):
+        network_instance = NetworkInstances.objects.get(pk=pk)
+        # handle openstack delete
+
+        network_instance.delete() 
+
+    
diff --git a/xos/ec2_observer/deleters/network_sliver_deleter.py b/xos/ec2_observer/deleters/network_sliver_deleter.py
deleted file mode 100644
index 71ba040..0000000
--- a/xos/ec2_observer/deleters/network_sliver_deleter.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from core.models import NetworkSliver
-from observer.deleter import Deleter
-
-class NetworkSliverDeleter(Deleter):
-    model='NetworkSliver'
-
-    def call(self, pk):
-        network_sliver = NetworkSlivers.objects.get(pk=pk)
-        # handle openstack delete
-
-        network_sliver.delete() 
-
-    
diff --git a/xos/ec2_observer/deleters/sliver_deleter.py b/xos/ec2_observer/deleters/sliver_deleter.py
deleted file mode 100644
index 097f0f7..0000000
--- a/xos/ec2_observer/deleters/sliver_deleter.py
+++ /dev/null
@@ -1,14 +0,0 @@
-from core.models import Sliver, SliceDeployments
-from observer.deleter import Deleter
-
-class SliverDeleter(Deleter):
-    model='Sliver'
-
-    def call(self, pk):
-        sliver = Sliver.objects.get(pk=pk)
-        if sliver.instance_id:
-            driver = self.driver.client_driver(caller=sliver.creator, 
-                                               tenant=sliver.slice.name,
-                                               deployment=sliver.deploymentNetwork.name)
-            driver.destroy_instance(sliver.instance_id)
-        sliver.delete()
diff --git a/xos/ec2_observer/event_loop.py b/xos/ec2_observer/event_loop.py
index bdbbab0..fb91ee8 100644
--- a/xos/ec2_observer/event_loop.py
+++ b/xos/ec2_observer/event_loop.py
@@ -49,7 +49,7 @@
 	return ig
 
 class XOSObserver:
-	#sync_steps = [SyncNetworks,SyncNetworkSlivers,SyncSites,SyncSitePrivilege,SyncSlices,SyncSliceMemberships,SyncSlivers,SyncSliverIps,SyncExternalRoutes,SyncUsers,SyncRoles,SyncNodes,SyncImages,GarbageCollector]
+	#sync_steps = [SyncNetworks,SyncNetworkInstances,SyncSites,SyncSitePrivilege,SyncSlices,SyncSliceMemberships,SyncInstances,SyncInstanceIps,SyncExternalRoutes,SyncUsers,SyncRoles,SyncNodes,SyncImages,GarbageCollector]
 	sync_steps = []
 
 	
diff --git a/xos/ec2_observer/steps/__init__.py b/xos/ec2_observer/steps/__init__.py
index ed44fdb..de7a1fd 100644
--- a/xos/ec2_observer/steps/__init__.py
+++ b/xos/ec2_observer/steps/__init__.py
@@ -1,12 +1,12 @@
 #from .sync_external_routes import SyncExternalRoutes
-#from .sync_network_slivers import SyncNetworkSlivers
+#from .sync_network_instances import SyncNetworkInstances
 #from .sync_networks import SyncNetworks
 #from .sync_network_deployments import SyncNetworkDeployments
 #from .sync_site_privileges import SyncSitePrivilege
 #from .sync_slice_memberships import SyncSliceMemberships
 #from .sync_slices import SyncSlices
-#from .sync_sliver_ips import SyncSliverIps
-#from .sync_slivers import SyncSlivers
+#from .sync_instance_ips import SyncInstanceIps
+#from .sync_instances import SyncInstances
 #from .sync_users import SyncUsers
 #from .sync_roles import SyncRoles
 #from .sync_nodes import SyncNodes
diff --git a/xos/ec2_observer/steps/sync_slivers.py b/xos/ec2_observer/steps/sync_instances.py
similarity index 62%
rename from xos/ec2_observer/steps/sync_slivers.py
rename to xos/ec2_observer/steps/sync_instances.py
index a86b4c4..3dc5f0e 100644
--- a/xos/ec2_observer/steps/sync_slivers.py
+++ b/xos/ec2_observer/steps/sync_instances.py
@@ -4,7 +4,7 @@
 from django.db.models import F, Q
 from xos.config import Config
 from ec2_observer.syncstep import SyncStep
-from core.models.sliver import Sliver
+from core.models.instance import Instance
 from core.models.slice import SlicePrivilege, SliceDeployments
 from core.models.network import Network, NetworkSlice, NetworkDeployments
 from util.logger import Logger, logging
@@ -16,53 +16,53 @@
 
 logger = Logger(level=logging.INFO)
 
-class SyncSlivers(SyncStep):
-    provides=[Sliver]
+class SyncInstances(SyncStep):
+    provides=[Instance]
     requested_interval=0
 
     def fetch_pending(self, deletion):
         if deletion:
-            object_source = Sliver.deleted_objects
+            object_source = Instance.deleted_objects
         else:
-            object_source = Sliver.objects
+            object_source = Instance.objects
 
-        all_slivers = object_source.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
-        my_slivers = [] 
+        all_instances = object_source.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
+        my_instances = [] 
 
-        for sliver in all_slivers:
-            sd = SliceDeployments.objects.filter(Q(slice=sliver.slice))
+        for instance in all_instances:
+            sd = SliceDeployments.objects.filter(Q(slice=instance.slice))
             if (sd):
                 if (sd.deployment.name=='Amazon EC2'):
-                    my_slivers.append(sliver)
-            if (sliver.node.deployment.name=='Amazon EC2'):
-                my_slivers.append(sliver)
-        return my_slivers
+                    my_instances.append(instance)
+            if (instance.node.deployment.name=='Amazon EC2'):
+                my_instances.append(instance)
+        return my_instances
 
-    def delete_record(self, sliver):
-        user = sliver.creator
+    def delete_record(self, instance):
+        user = instance.creator
         e = get_creds(user=user, site=user.site)
-        result = aws_run('ec2 terminate-instances --instance-ids=%s'%sliver.instance_id, env=e)
+        result = aws_run('ec2 terminate-instances --instance-ids=%s'%instance.instance_id, env=e)
 
-    def sync_record(self, sliver):
-        logger.info("sync'ing sliver:%s deployment:%s " % (sliver, sliver.node.deployment))
+    def sync_record(self, instance):
+        logger.info("sync'ing instance:%s deployment:%s " % (instance, instance.node.deployment))
 
-        if not sliver.instance_id:
+        if not instance.instance_id:
             # public keys
-            slice_memberships = SlicePrivilege.objects.filter(slice=sliver.slice)
+            slice_memberships = SlicePrivilege.objects.filter(slice=instance.slice)
             pubkeys = [sm.user.public_key for sm in slice_memberships if sm.user.public_key]
 
-            if sliver.creator.public_key:
-                pubkeys.append(sliver.creator.public_key)
+            if instance.creator.public_key:
+                pubkeys.append(instance.creator.public_key)
 
-            if sliver.slice.creator.public_key:
-                pubkeys.append(sliver.slice.creator.public_key) 
+            if instance.slice.creator.public_key:
+                pubkeys.append(instance.slice.creator.public_key) 
 
             # netowrks
             # include all networks available to the slice and/or associated network templates
             #nics = []
-            #networks = [ns.network for ns in NetworkSlice.objects.filter(slice=sliver.slice)]  
+            #networks = [ns.network for ns in NetworkSlice.objects.filter(slice=instance.slice)]  
             #network_deployments = NetworkDeployments.objects.filter(network__in=networks, 
-                                                                    #deployment=sliver.node.deployment)
+                                                                    #deployment=instance.node.deployment)
             # Gather private networks first. This includes networks with a template that has
             # visibility = private and translation = none
             #for network_deployment in network_deployments:
@@ -78,11 +78,11 @@
             #       nics.append({'net-id': net['id']}) 
             # look up image id
 
-            instance_type = sliver.node.name.rsplit('.',1)[0]
+            instance_type = instance.node.name.rsplit('.',1)[0]
 
             # Bail out of we don't have a key
-            key_name = sliver.creator.email.lower().replace('@', 'AT').replace('.', '')
-            u = sliver.creator
+            key_name = instance.creator.email.lower().replace('@', 'AT').replace('.', '')
+            u = instance.creator
             s = u.site
             e = get_creds(user=u, site=s)
             key_sig = aws_run('ec2 describe-key-pairs', env=e)
@@ -95,23 +95,23 @@
 
             if (not key_found):
                 # set backend_status
-                raise Exception('Will not sync sliver without key')
+                raise Exception('Will not sync instance without key')
 
-            image_id = sliver.image.path
-            instance_sig = aws_run('ec2 run-instances --image-id %s --instance-type %s --count 1 --key-name %s --placement AvailabilityZone=%s'%(image_id,instance_type,key_name,sliver.node.site.name), env=e)
-            sliver.instance_id = instance_sig['Instances'][0]['InstanceId']
-            sliver.save()
+            image_id = instance.image.path
+            instance_sig = aws_run('ec2 run-instances --image-id %s --instance-type %s --count 1 --key-name %s --placement AvailabilityZone=%s'%(image_id,instance_type,key_name,instance.node.site.name), env=e)
+            instance.instance_id = instance_sig['Instances'][0]['InstanceId']
+            instance.save()
             state = instance_sig['Instances'][0]['State']['Code']
             if (state==16):
-                sliver.ip = instance_sig['Instances'][0]['PublicIpAddress']
-                sliver.save()
+                instance.ip = instance_sig['Instances'][0]['PublicIpAddress']
+                instance.save()
             else:
                 # This status message should go into backend_status
                 raise Exception('Waiting for instance to start')
         else:
-            ret = aws_run('ec2 describe-instances --instance-ids %s'%sliver.instance_id, env=e)
+            ret = aws_run('ec2 describe-instances --instance-ids %s'%instance.instance_id, env=e)
             state = ret['Reservations'][0]['Instances'][0]['State']['Code']
             if (state==16):
-                sliver.ip = ret['Reservations'][0]['Instances'][0]['PublicIpAddress']
-                sliver.save()
+                instance.ip = ret['Reservations'][0]['Instances'][0]['PublicIpAddress']
+                instance.save()
 
diff --git a/xos/ec2_observer/syncstep.py b/xos/ec2_observer/syncstep.py
index 72adb87..e15e719 100644
--- a/xos/ec2_observer/syncstep.py
+++ b/xos/ec2_observer/syncstep.py
@@ -57,7 +57,7 @@
             objs = main_obj.deleted_objects.all()
 
         return objs
-        #return Sliver.objects.filter(ip=None)
+        #return Instance.objects.filter(ip=None)
     
     def check_dependencies(self, obj, failed):
         for dep in self.dependencies:
diff --git a/xos/hpc/models.py b/xos/hpc/models.py
index 48ae0f0..e49bf4e 100644
--- a/xos/hpc/models.py
+++ b/xos/hpc/models.py
@@ -18,16 +18,16 @@
     cmi_hostname = StrippedCharField(max_length=254, null=True, blank=True)
 
     hpc_port80 = models.BooleanField(default=True, help_text="Enable port 80 for HPC")
-    watcher_hpc_network = StrippedCharField(max_length=254, null=True, blank=True, help_text="Network for hpc_watcher to contact hpc sliver")
-    watcher_dnsdemux_network = StrippedCharField(max_length=254, null=True, blank=True, help_text="Network for hpc_watcher to contact dnsdemux sliver")
-    watcher_dnsredir_network = StrippedCharField(max_length=254, null=True, blank=True, help_text="Network for hpc_watcher to contact dnsredir sliver")
+    watcher_hpc_network = StrippedCharField(max_length=254, null=True, blank=True, help_text="Network for hpc_watcher to contact hpc instance")
+    watcher_dnsdemux_network = StrippedCharField(max_length=254, null=True, blank=True, help_text="Network for hpc_watcher to contact dnsdemux instance")
+    watcher_dnsredir_network = StrippedCharField(max_length=254, null=True, blank=True, help_text="Network for hpc_watcher to contact dnsredir instance")
 
     @property
     def scale(self):
         hpc_slices = [x for x in self.slices.all() if "hpc" in x.name]
         if not hpc_slices:
             return 0
-        return hpc_slices[0].slivers.count()
+        return hpc_slices[0].instances.count()
 
     @scale.setter
     def scale(self, value):
diff --git a/xos/hpc_wizard/xos_analytics.py b/xos/hpc_wizard/xos_analytics.py
index a95d3ae..9502aa1 100644
--- a/xos/hpc_wizard/xos_analytics.py
+++ b/xos/hpc_wizard/xos_analytics.py
@@ -15,7 +15,7 @@
 from django.conf import settings
 from django import db
 from django.db import connection
-from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice, Service
+from core.models import Slice, Instance, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice, Service
 
 BLUE_LOAD=5000000
 RED_LOAD=15000000
@@ -228,17 +228,17 @@
                 # we didn't find it in the data model
                 continue
 
-            allocated_slivers = 0
+            allocated_instances = 0
             if model_site and slice:
-                for sliver in slice.slivers.all():
-                    if sliver.node.site == model_site:
-                        allocated_slivers = allocated_slivers + 1
+                for instance in slice.instances.all():
+                    if instance.node.site == model_site:
+                        allocated_instances = allocated_instances + 1
 
             row["lat"] = float(model_site.location.latitude)
             row["long"] = float(model_site.location.longitude)
             row["url"] = model_site.site_url
             row["numNodes"] = model_site.nodes.count()
-            row["allocated_slivers"] = allocated_slivers
+            row["allocated_instances"] = allocated_instances
 
             max_cpu = row.get("max_avg_cpu", row.get("max_cpu",0))
             cpu=float(max_cpu)/100.0
diff --git a/xos/importer/plclassic/importer.py b/xos/importer/plclassic/importer.py
index 864f4b9..de8628b 100644
--- a/xos/importer/plclassic/importer.py
+++ b/xos/importer/plclassic/importer.py
@@ -7,7 +7,7 @@
 from plclassic.site_importer import SiteImporter
 from plclassic.user_importer import UserImporter
 from plclassic.slice_importer import SliceImporter
-from plclassic.sliver_importer import SliverImporter
+from plclassic.instance_importer import InstanceImporter
 
 
 class Call:
@@ -36,14 +36,14 @@
         self.sites = SiteImporter(api)
         self.slices = SliceImporter(api)
         self.users = UserImporter(api)
-        self.slivers = SliverImporter(api)
+        self.instances = InstanceImporter(api)
 
     def run(self):
         self.sites.run()
         self.users.run()
         self.slices.run(remote_sites=self.sites.remote_sites, 
                         local_sites=self.sites.local_sites)
-        self.slivers.run()           
+        self.instances.run()           
 
 
 
diff --git a/xos/importer/plclassic/sliver_importer.py b/xos/importer/plclassic/instance_importer.py
similarity index 82%
rename from xos/importer/plclassic/sliver_importer.py
rename to xos/importer/plclassic/instance_importer.py
index 3f7912f..0858572 100644
--- a/xos/importer/plclassic/sliver_importer.py
+++ b/xos/importer/plclassic/instance_importer.py
@@ -1,6 +1,6 @@
 from PLC.Nodes import Nodes
 
-class SliverImporter:
+class InstanceImporter:
 
     def __init__(self, api):
         self.api = api
diff --git a/xos/model_autodeletion.py b/xos/model_autodeletion.py
index f5288a0..2bfc48c 100644
--- a/xos/model_autodeletion.py
+++ b/xos/model_autodeletion.py
@@ -1 +1 @@
-ephemeral_models = ['ReservedResource','Sliver','Image','Network','Port','Tag','SitePrivilege','SliceMembership','SliceTag','Reservation','Slice']
+ephemeral_models = ['ReservedResource','Instance','Image','Network','Port','Tag','SitePrivilege','SliceMembership','SliceTag','Reservation','Slice']
diff --git a/xos/model_policies/__init__.py b/xos/model_policies/__init__.py
index a74e7be..36c6e25 100644
--- a/xos/model_policies/__init__.py
+++ b/xos/model_policies/__init__.py
@@ -1,5 +1,5 @@
 from .model_policy_Slice import *
-from .model_policy_Sliver import *
+from .model_policy_Instance import *
 from .model_policy_User import *
 from .model_policy_Network import *
 from .model_policy_Site import *
diff --git a/xos/model_policies/model_policy_Instance.py b/xos/model_policies/model_policy_Instance.py
new file mode 100644
index 0000000..a13428d
--- /dev/null
+++ b/xos/model_policies/model_policy_Instance.py
@@ -0,0 +1,13 @@
+
+def handle(instance):
+    from core.models import Controller, ControllerSlice, ControllerNetwork, NetworkSlice
+
+    networks = [ns.network for ns in NetworkSlice.objects.filter(slice=instance.slice)]
+    controller_networks = ControllerNetwork.objects.filter(network__in=networks,
+                                                                controller=instance.node.site_deployment.controller)
+
+    for cn in controller_networks:
+        if (cn.lazy_blocked):	
+		cn.lazy_blocked=False
+		cn.backend_register = '{}'
+		cn.save()
diff --git a/xos/model_policies/model_policy_Sliver.py b/xos/model_policies/model_policy_Sliver.py
index 0004e33..a13428d 100644
--- a/xos/model_policies/model_policy_Sliver.py
+++ b/xos/model_policies/model_policy_Sliver.py
@@ -1,10 +1,10 @@
 
-def handle(sliver):
+def handle(instance):
     from core.models import Controller, ControllerSlice, ControllerNetwork, NetworkSlice
 
-    networks = [ns.network for ns in NetworkSlice.objects.filter(slice=sliver.slice)]
+    networks = [ns.network for ns in NetworkSlice.objects.filter(slice=instance.slice)]
     controller_networks = ControllerNetwork.objects.filter(network__in=networks,
-                                                                controller=sliver.node.site_deployment.controller)
+                                                                controller=instance.node.site_deployment.controller)
 
     for cn in controller_networks:
         if (cn.lazy_blocked):	
diff --git a/xos/model_policy.py b/xos/model_policy.py
index 2813416..ce59a32 100644
--- a/xos/model_policy.py
+++ b/xos/model_policy.py
@@ -59,7 +59,7 @@
         return
 
     # These are the models whose children get deleted when they are
-    delete_policy_models = ['Slice','Sliver','Network']
+    delete_policy_models = ['Slice','Instance','Network']
     sender_name = instance.__class__.__name__
     policy_name = 'model_policy_%s'%sender_name
     noargs = False
@@ -97,10 +97,10 @@
         pass
 
 def run_policy():
-    from core.models import Sliver,Slice,Controller,Network,User,SlicePrivilege,Site,SitePrivilege,Image,ControllerSlice,ControllerUser,ControllerSite
+    from core.models import Instance,Slice,Controller,Network,User,SlicePrivilege,Site,SitePrivilege,Image,ControllerSlice,ControllerUser,ControllerSite
     while (True):
         start = time.time()
-        models = [Sliver,Slice, Controller, Network, User, SlicePrivilege, Site, SitePrivilege, Image, ControllerSlice, ControllerSite, ControllerUser]
+        models = [Instance,Slice, Controller, Network, User, SlicePrivilege, Site, SitePrivilege, Image, ControllerSlice, ControllerSite, ControllerUser]
         objects = []
         deleted_objects = []
 
diff --git a/xos/observers/base/SyncSliverUsingAnsible.py b/xos/observers/base/SyncSliverUsingAnsible.py
index c824595..9455780 100644
--- a/xos/observers/base/SyncSliverUsingAnsible.py
+++ b/xos/observers/base/SyncSliverUsingAnsible.py
@@ -13,7 +13,7 @@
 
 logger = Logger(level=logging.INFO)
 
-class SyncSliverUsingAnsible(SyncStep):
+class SyncInstanceUsingAnsible(SyncStep):
     # All of the following should be defined for classes derived from this
     # base class. Examples below use VCPETenant.
 
@@ -36,13 +36,13 @@
 
         return {}
 
-    def get_sliver(self, o):
-        # We need to know what sliver is associated with the object. Let's
-        # assume 'o' has a field called 'sliver'. If the field is called
+    def get_instance(self, o):
+        # We need to know what instance is associated with the object. Let's
+        # assume 'o' has a field called 'instance'. If the field is called
         # something else, or if custom logic is needed, then override this
         # method.
 
-        return o.sliver
+        return o.instance
 
     def run_playbook(self, o, fields):
         tStart = time.time()
@@ -61,9 +61,9 @@
     def sync_record(self, o):
         logger.info("sync'ing object %s" % str(o))
 
-        sliver = self.get_sliver(o)
-        if not sliver:
-            self.defer_sync(o, "waiting on sliver")
+        instance = self.get_instance(o)
+        if not instance:
+            self.defer_sync(o, "waiting on instance")
             return
 
         if not os.path.exists(self.service_key_name):
@@ -71,9 +71,9 @@
 
         service_key = file(self.service_key_name).read()
 
-        fields = { "sliver_name": sliver.name,
-                   "hostname": sliver.node.name,
-                   "instance_id": sliver.instance_id,
+        fields = { "instance_name": instance.name,
+                   "hostname": instance.node.name,
+                   "instance_id": instance.instance_id,
                    "private_key": service_key,
                    "ansible_tag": "vcpe_tenant_" + str(o.id)
                  }
diff --git a/xos/observers/hpc/hpc_watcher.py b/xos/observers/hpc/hpc_watcher.py
index d098257..7c49aae 100644
--- a/xos/observers/hpc/hpc_watcher.py
+++ b/xos/observers/hpc/hpc_watcher.py
@@ -1,7 +1,7 @@
 """
     hpc_watcher.py
 
-    Daemon to watch the health of HPC and RR slivers.
+    Daemon to watch the health of HPC and RR instances.
 
     This deamon uses HpcHealthCheck objects in the Data Model to conduct
     periodic tests of HPC and RR nodes. Two types of Health Checks are
@@ -25,9 +25,9 @@
      In addition to the above, HPC heartbeat probes are conducted, similar to
      the ones that dnsredir conducts.
 
-     The results of health checks are stored in a tag attached to the Sliver
+     The results of health checks are stored in a tag attached to the Instance
      the healthcheck was conducted against. If all healthchecks of a particular
-     variety were successful for a sliver, then "success" will be stored in
+     variety were successful for a instance, then "success" will be stored in
      the tag. Otherwise, the first healthcheck to fail will be stored in the
      tag.
 
@@ -351,50 +351,50 @@
         Thread.__init__(self)
         self.daemon = True
 
-    def get_public_ip(self, service, sliver):
+    def get_public_ip(self, service, instance):
         network_name = None
-        if "hpc" in sliver.slice.name:
+        if "hpc" in instance.slice.name:
             network_name = getattr(service, "watcher_hpc_network", None)
-        elif "demux" in sliver.slice.name:
+        elif "demux" in instance.slice.name:
             network_name = getattr(service, "watcher_dnsdemux_network", None)
-        elif "redir" in sliver.slice.name:
+        elif "redir" in instance.slice.name:
             network_name = getattr(service, "watcher_dnsredir_network", None)
 
         if network_name and network_name.lower()=="nat":
             return None
 
         if (network_name is None) or (network_name=="") or (network_name.lower()=="public"):
-            return sliver.get_public_ip()
+            return instance.get_public_ip()
 
-        for ns in sliver.ports.all():
+        for ns in instance.ports.all():
             if (ns.ip) and (ns.network.name==network_name):
                 return ns.ip
 
         raise ValueError("Couldn't find network %s" % str(network_name))
 
-    def set_status(self, sliver, service, kind, msg, check_error=True):
-        #print sliver.node.name, kind, msg
+    def set_status(self, instance, service, kind, msg, check_error=True):
+        #print instance.node.name, kind, msg
         if check_error:
-            sliver.has_error = (msg!="success")
+            instance.has_error = (msg!="success")
 
-        sliver_type = ContentType.objects.get_for_model(sliver)
+        instance_type = ContentType.objects.get_for_model(instance)
 
-        t = Tag.objects.filter(service=service, name=kind+".msg", content_type__pk=sliver_type.id, object_id=sliver.id)
+        t = Tag.objects.filter(service=service, name=kind+".msg", content_type__pk=instance_type.id, object_id=instance.id)
         if t:
             t=t[0]
             if (t.value != msg):
                 t.value = msg
                 t.save()
         else:
-            Tag(service=service, name=kind+".msg", content_object = sliver, value=msg).save()
+            Tag(service=service, name=kind+".msg", content_object = instance, value=msg).save()
 
-        t = Tag.objects.filter(service=service, name=kind+".time", content_type__pk=sliver_type.id, object_id=sliver.id)
+        t = Tag.objects.filter(service=service, name=kind+".time", content_type__pk=instance_type.id, object_id=instance.id)
         if t:
             t=t[0]
             t.value = str(time.time())
             t.save()
         else:
-            Tag(service=service, name=kind+".time", content_object = sliver, value=str(time.time())).save()
+            Tag(service=service, name=kind+".time", content_object = instance, value=str(time.time())).save()
 
     def get_service_slices(self, service, kind=None):
         try:
@@ -416,51 +416,51 @@
         for i in range(0,10):
             DnsResolver(queue = self.resolver_queue)
 
-    def check_request_routers(self, service, slivers):
-        for sliver in slivers:
-            sliver.has_error = False
+    def check_request_routers(self, service, instances):
+        for instance in instances:
+            instance.has_error = False
 
             try:
-                ip = self.get_public_ip(service, sliver)
+                ip = self.get_public_ip(service, instance)
             except Exception, e:
-                self.set_status(sliver, service, "watcher.DNS", "exception: %s" % str(e))
+                self.set_status(instance, service, "watcher.DNS", "exception: %s" % str(e))
                 continue
             if not ip:
                 try:
-                    ip = socket.gethostbyname(sliver.node.name)
+                    ip = socket.gethostbyname(instance.node.name)
                 except:
-                    self.set_status(sliver, service, "watcher.DNS", "dns resolution failure")
+                    self.set_status(instance, service, "watcher.DNS", "dns resolution failure")
                     continue
 
             if not ip:
-                self.set_status(sliver, service, "watcher.DNS", "no IP address")
+                self.set_status(instance, service, "watcher.DNS", "no IP address")
                 continue
 
             checks = HpcHealthCheck.objects.filter(kind="dns")
             if not checks:
-                self.set_status(sliver, service, "watcher.DNS", "no DNS HealthCheck tests configured")
+                self.set_status(instance, service, "watcher.DNS", "no DNS HealthCheck tests configured")
 
             for check in checks:
-                self.resolver_queue.submit_job({"domain": check.resource_name, "server": ip, "port": 53, "sliver": sliver, "result_contains": check.result_contains})
+                self.resolver_queue.submit_job({"domain": check.resource_name, "server": ip, "port": 53, "instance": instance, "result_contains": check.result_contains})
 
         while self.resolver_queue.outstanding > 0:
             result = self.resolver_queue.get_result()
-            sliver = result["sliver"]
-            if (result["status"]!="success") and (not sliver.has_error):
-                self.set_status(sliver, service, "watcher.DNS", result["status"])
+            instance = result["instance"]
+            if (result["status"]!="success") and (not instance.has_error):
+                self.set_status(instance, service, "watcher.DNS", result["status"])
 
-        for sliver in slivers:
-            if not sliver.has_error:
-                self.set_status(sliver, service, "watcher.DNS", "success")
+        for instance in instances:
+            if not instance.has_error:
+                self.set_status(instance, service, "watcher.DNS", "success")
 
     def run_once(self):
         for hpcService in HpcService.objects.all():
             for slice in self.get_service_slices(hpcService, "dnsdemux"):
-                self.check_request_routers(hpcService, slice.slivers.all())
+                self.check_request_routers(hpcService, slice.instances.all())
 
         for rrService in RequestRouterService.objects.all():
             for slice in self.get_service_slices(rrService, "dnsdemux"):
-                self.check_request_routers(rrService, slice.slivers.all())
+                self.check_request_routers(rrService, slice.instances.all())
 
     def run(self):
         while True:
@@ -477,26 +477,26 @@
         for i in range(0, 10):
             HpcHeartbeat(queue = self.heartbeat_queue)
 
-    def probe_hpc(self, service, slivers):
-        for sliver in slivers:
-            sliver.has_error = False
+    def probe_hpc(self, service, instances):
+        for instance in instances:
+            instance.has_error = False
 
-            self.heartbeat_queue.submit_job({"server": sliver.node.name, "port": 8009, "sliver": sliver})
+            self.heartbeat_queue.submit_job({"server": instance.node.name, "port": 8009, "instance": instance})
 
         while self.heartbeat_queue.outstanding > 0:
             result = self.heartbeat_queue.get_result()
-            sliver = result["sliver"]
-            if (result["status"]!="success") and (not sliver.has_error):
-                self.set_status(sliver, service, "watcher.HPC-hb", result["status"])
+            instance = result["instance"]
+            if (result["status"]!="success") and (not instance.has_error):
+                self.set_status(instance, service, "watcher.HPC-hb", result["status"])
 
-        for sliver in slivers:
-            if not sliver.has_error:
-                self.set_status(sliver, service, "watcher.HPC-hb", "success")
+        for instance in instances:
+            if not instance.has_error:
+                self.set_status(instance, service, "watcher.HPC-hb", "success")
 
     def run_once(self):
         for hpcService in HpcService.objects.all():
             for slice in self.get_service_slices(hpcService, "hpc"):
-                self.probe_hpc(hpcService, slice.slivers.all())
+                self.probe_hpc(hpcService, slice.instances.all())
 
     def run(self):
         while True:
@@ -513,42 +513,42 @@
         for i in range(0, 10):
             HpcFetchUrl(queue = self.fetch_queue)
 
-    def fetch_hpc(self, service, slivers):
-        for sliver in slivers:
-            sliver.has_error = False
-            sliver.url_status = []
+    def fetch_hpc(self, service, instances):
+        for instance in instances:
+            instance.has_error = False
+            instance.url_status = []
 
             checks = HpcHealthCheck.objects.filter(kind="http")
             if not checks:
-                self.set_status(sliver, service, "watcher.HPC-fetch", "no HTTP HealthCheck tests configured")
+                self.set_status(instance, service, "watcher.HPC-fetch", "no HTTP HealthCheck tests configured")
 
             for check in checks:
                 if (not check.resource_name) or (":" not in check.resource_name):
-                    self.set_status(sliver, service, "watcher.HPC-fetch", "malformed resource_name: " + str(check.resource_name))
+                    self.set_status(instance, service, "watcher.HPC-fetch", "malformed resource_name: " + str(check.resource_name))
                     break
 
                 (domain, url) = check.resource_name.split(":",1)
 
-                self.fetch_queue.submit_job({"server": sliver.node.name, "port": 80, "sliver": sliver, "domain": domain, "url": url})
+                self.fetch_queue.submit_job({"server": instance.node.name, "port": 80, "instance": instance, "domain": domain, "url": url})
 
         while self.fetch_queue.outstanding > 0:
             result = self.fetch_queue.get_result()
-            sliver = result["sliver"]
+            instance = result["instance"]
             if (result["status"] == "success"):
-                sliver.url_status.append( (result["domain"] + result["url"], "success", result["bytes_downloaded"], result["total_time"]) )
-            if (result["status"]!="success") and (not sliver.has_error):
-                self.set_status(sliver, service, "watcher.HPC-fetch", result["status"])
+                instance.url_status.append( (result["domain"] + result["url"], "success", result["bytes_downloaded"], result["total_time"]) )
+            if (result["status"]!="success") and (not instance.has_error):
+                self.set_status(instance, service, "watcher.HPC-fetch", result["status"])
 
-        for sliver in slivers:
-            self.set_status(sliver, service, "watcher.HPC-fetch-urls", json.dumps(sliver.url_status), check_error=False)
-            if not sliver.has_error:
-                self.set_status(sliver, service, "watcher.HPC-fetch", "success")
+        for instance in instances:
+            self.set_status(instance, service, "watcher.HPC-fetch-urls", json.dumps(instance.url_status), check_error=False)
+            if not instance.has_error:
+                self.set_status(instance, service, "watcher.HPC-fetch", "success")
 
     def run_once(self):
         for hpcService in HpcService.objects.all():
             for slice in self.get_service_slices(hpcService, "hpc"):
                 try:
-                    self.fetch_hpc(hpcService, slice.slivers.all())
+                    self.fetch_hpc(hpcService, slice.instances.all())
                 except:
                     traceback.print_exc()
 
@@ -567,41 +567,41 @@
         for i in range(0, 10):
              WatcherWorker(queue = self.fetch_queue)
 
-    def fetch_watcher(self, service, slivers):
-        for sliver in slivers:
+    def fetch_watcher(self, service, instances):
+        for instance in instances:
             try:
-                ip = self.get_public_ip(service, sliver)
+                ip = self.get_public_ip(service, instance)
             except Exception, e:
-                self.set_status(sliver, service, "watcher.watcher", json.dumps({"status": "exception: %s" % str(e)}) )
+                self.set_status(instance, service, "watcher.watcher", json.dumps({"status": "exception: %s" % str(e)}) )
                 continue
             if not ip:
                 try:
-                    ip = socket.gethostbyname(sliver.node.name)
+                    ip = socket.gethostbyname(instance.node.name)
                 except:
-                    self.set_status(sliver, service, "watcher.watcher", json.dumps({"status": "dns resolution failure"}) )
+                    self.set_status(instance, service, "watcher.watcher", json.dumps({"status": "dns resolution failure"}) )
                     continue
 
             if not ip:
-                self.set_status(sliver, service, "watcher.watcher", json.dumps({"status": "no IP address"}) )
+                self.set_status(instance, service, "watcher.watcher", json.dumps({"status": "no IP address"}) )
                 continue
 
             port = 8015
-            if ("redir" in sliver.slice.name):
+            if ("redir" in instance.slice.name):
                 port = 8016
-            elif ("demux" in sliver.slice.name):
+            elif ("demux" in instance.slice.name):
                 port = 8017
 
-            self.fetch_queue.submit_job({"server": ip, "port": port, "sliver": sliver})
+            self.fetch_queue.submit_job({"server": ip, "port": port, "instance": instance})
 
         while self.fetch_queue.outstanding > 0:
             result = self.fetch_queue.get_result()
-            sliver = result["sliver"]
-            self.set_status(sliver, service, "watcher.watcher", result["status"])
+            instance = result["instance"]
+            self.set_status(instance, service, "watcher.watcher", result["status"])
 
     def run_once(self):
         for hpcService in HpcService.objects.all():
             for slice in self.get_service_slices(hpcService):
-                self.fetch_watcher(hpcService, slice.slivers.all())
+                self.fetch_watcher(hpcService, slice.instances.all())
 
     def run(self):
         while True:
diff --git a/xos/observers/hpc/hpclib.py b/xos/observers/hpc/hpclib.py
index 30dbe87..51864a5 100644
--- a/xos/observers/hpc/hpclib.py
+++ b/xos/observers/hpc/hpclib.py
@@ -99,11 +99,11 @@
 
         for slice in slices:
             if slice.name.endswith("cmi"):
-                for sliver in slice.slivers.all():
-                    if sliver.node:
-                         return sliver.node.name
+                for instance in slice.instances.all():
+                    if instance.node:
+                         return instance.node.name
 
-        raise Exception("Failed to find a CMI sliver")
+        raise Exception("Failed to find a CMI instance")
 
     @property
     def client(self):
diff --git a/xos/observers/vbng/steps/sync_vbngtenant.py b/xos/observers/vbng/steps/sync_vbngtenant.py
index 18adfc8..8868d6f 100644
--- a/xos/observers/vbng/steps/sync_vbngtenant.py
+++ b/xos/observers/vbng/steps/sync_vbngtenant.py
@@ -63,10 +63,10 @@
             raise Exception("More than one vCPE tenant is associated with vBNG %s" % str(o.id))
 
         vcpe = vcpes[0]
-        sliver = vcpe.sliver
+        instance = vcpe.instance
 
-        if not sliver:
-            raise Exception("No sliver associated with vBNG %s" % str(o.id))
+        if not instance:
+            raise Exception("No instance associated with vBNG %s" % str(o.id))
 
         if not vcpe.wan_ip:
             self.defer_sync(o, "does not have a WAN IP yet")
@@ -75,7 +75,7 @@
             # this should never happen; WAN MAC is computed from WAN IP
             self.defer_sync(o, "does not have a WAN MAC yet")
 
-        return (vcpe.wan_ip, vcpe.wan_mac, vcpe.sliver.node.name)
+        return (vcpe.wan_ip, vcpe.wan_mac, vcpe.instance.node.name)
 
     def sync_record(self, o):
         logger.info("sync'ing VBNGTenant %s" % str(o))
diff --git a/xos/observers/vcpe/observer_ansible_test.py b/xos/observers/vcpe/observer_ansible_test.py
index 1b4358d..77715af 100644
--- a/xos/observers/vcpe/observer_ansible_test.py
+++ b/xos/observers/vcpe/observer_ansible_test.py
@@ -37,7 +37,7 @@
 """
 
 observer.ansible.run_template_ssh("test.yaml",
-                                  {"sliver_name": "onlab_test405-378",
+                                  {"instance_name": "onlab_test405-378",
                                    "instance_id": "instance-0000004d",
                                    "hostname": "node67.washington.vicci.org",
                                    "private_key": private_key})
diff --git a/xos/observers/vcpe/steps/ansible_test/xos.py b/xos/observers/vcpe/steps/ansible_test/xos.py
index 3ef72ab..eb4f3eb 100755
--- a/xos/observers/vcpe/steps/ansible_test/xos.py
+++ b/xos/observers/vcpe/steps/ansible_test/xos.py
@@ -48,13 +48,13 @@
         self.HASHED_KEY_MAGIC = "|1|"
         self.has_pipelining = True
         #self.instance_id = "instance-00000045" # C.get_config(C.p, "xos", "instance_id", "INSTANCE_ID", None)
-        #self.sliver_name = "onlab_hpc-355" # C.get_config(C.p, "xos", "sliver_name", "SLIVER_NAME", None)
+        #self.instance_name = "onlab_hpc-355" # C.get_config(C.p, "xos", "instance_name", "SLIVER_NAME", None)
 
         inject={}
         inject= utils.combine_vars(inject, self.runner.inventory.get_variables(self.host))
 
         self.instance_id = inject["instance_id"]
-        self.sliver_name = inject["sliver_name"]
+        self.instance_name = inject["instance_name"]
 
         fcntl.lockf(self.runner.process_lockfile, fcntl.LOCK_EX)
         self.cp_dir = utils.prepare_writeable_dir('$HOME/.ansible/cp',mode=0700)
@@ -282,7 +282,7 @@
         if self.ipv6:
             ssh_cmd += ['-6']
         #ssh_cmd += [self.host]
-        ssh_cmd += [self.sliver_name]
+        ssh_cmd += [self.instance_name]
 
         if su and su_user:
             sudocmd, prompt, success_key = utils.make_su_cmd(su_user, executable, cmd)
diff --git a/xos/observers/vcpe/steps/sync_vcpetenant.py b/xos/observers/vcpe/steps/sync_vcpetenant.py
index ecc7b7c..1a45b54 100644
--- a/xos/observers/vcpe/steps/sync_vcpetenant.py
+++ b/xos/observers/vcpe/steps/sync_vcpetenant.py
@@ -8,7 +8,7 @@
 from xos.config import Config
 from observer.syncstep import SyncStep
 from observer.ansible import run_template_ssh
-from observers.base.SyncSliverUsingAnsible import SyncSliverUsingAnsible
+from observers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
 from core.models import Service, Slice
 from cord.models import VCPEService, VCPETenant, VOLTTenant
 from hpc.models import HpcService, CDNPrefix
@@ -22,7 +22,7 @@
 
 logger = Logger(level=logging.INFO)
 
-class SyncVCPETenant(SyncSliverUsingAnsible):
+class SyncVCPETenant(SyncInstanceUsingAnsible):
     provides=[VCPETenant]
     observes=VCPETenant
     requested_interval=0
@@ -67,21 +67,21 @@
             for service in HpcService.objects.all():
                 for slice in service.slices.all():
                     if "dnsdemux" in slice.name:
-                        for sliver in slice.slivers.all():
-                            for ns in sliver.ports.all():
+                        for instance in slice.instances.all():
+                            for ns in instance.ports.all():
                                 if ns.ip and ns.network.labels and (vcpe_service.backend_network_label in ns.network.labels):
                                     dnsdemux_ip = ns.ip
             if not dnsdemux_ip:
                 logger.info("failed to find a dnsdemux on network %s" % vcpe_service.backend_network_label)
         else:
-            # Connect to dnsdemux using the sliver's public address
+            # Connect to dnsdemux using the instance's public address
             for service in HpcService.objects.all():
                 for slice in service.slices.all():
                     if "dnsdemux" in slice.name:
-                        for sliver in slice.slivers.all():
+                        for instance in slice.instances.all():
                             if dnsdemux_ip=="none":
                                 try:
-                                    dnsdemux_ip = socket.gethostbyname(sliver.node.name)
+                                    dnsdemux_ip = socket.gethostbyname(instance.node.name)
                                 except:
                                     pass
             if not dnsdemux_ip:
@@ -99,8 +99,8 @@
         bbs_addrs = []
         if vcpe_service.bbs_slice:
             if vcpe_service.backend_network_label:
-                for bbs_sliver in vcpe_service.bbs_slice.slivers.all():
-                    for ns in bbs_sliver.ports.all():
+                for bbs_instance in vcpe_service.bbs_slice.instances.all():
+                    for ns in bbs_instance.ports.all():
                         if ns.ip and ns.network.labels and (vcpe_service.backend_network_label in ns.network.labels):
                             bbs_addrs.append(ns.ip)
             else:
@@ -147,11 +147,11 @@
             # Ansible uses the service's keypair in order to SSH into the
             # instance. It would be bad if the slice had no service.
 
-            raise Exception("Slice %s is not associated with a service" % sliver.slice.name)
+            raise Exception("Slice %s is not associated with a service" % instance.slice.name)
 
         # Make sure the slice is configured properly
-        if (service != o.sliver.slice.service):
-            raise Exception("Slice %s is associated with some service that is not %s" % (str(sliver.slice), str(service)))
+        if (service != o.instance.slice.service):
+            raise Exception("Slice %s is associated with some service that is not %s" % (str(instance.slice), str(service)))
 
         # only enable filtering if we have a subscriber object (see below)
         url_filter_enable = False
diff --git a/xos/openstack/sliveragent.py b/xos/openstack/instanceagent.py
similarity index 67%
rename from xos/openstack/sliveragent.py
rename to xos/openstack/instanceagent.py
index 4aea44d..8e50cf3 100644
--- a/xos/openstack/sliveragent.py
+++ b/xos/openstack/instanceagent.py
@@ -2,10 +2,10 @@
 import sys
 #os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
 import time
-from core.models.sliver import Sliver
+from core.models.instance import Instance
 from openstack.manager import OpenStackManager
 
-class SliverAgent:
+class InstanceAgent:
 
     def run(self):
         manager = OpenStackManager()
@@ -15,25 +15,25 @@
 
         while True :
             # fill in null ip addresses 
-            slivers = Sliver.objects.filter(ip=None)
-            for sliver in slivers:
+            instances = Instance.objects.filter(ip=None)
+            for instance in instances:
                 # update connection
                 manager.client.connect(username=manager.client.keystone.username,
                                password=manager.client.keystone.password,
-                               tenant=sliver.slice.name)  
-                sliver.os_manager = manager
-                servers = manager.client.nova.servers.findall(id=sliver.instance_id)
+                               tenant=instance.slice.name)  
+                instance.os_manager = manager
+                servers = manager.client.nova.servers.findall(id=instance.instance_id)
                 if not servers:
                     continue
                 server = servers[0]
-                ips = server.addresses.get(sliver.slice.name, [])
+                ips = server.addresses.get(instance.slice.name, [])
                 if not ips:
                     continue
-                sliver.ip = ips[0]['addr']
-                sliver.save()
+                instance.ip = ips[0]['addr']
+                instance.save()
             time.sleep(7)
                 
                                         
 if __name__ == '__main__':
-    SliverAgent().run()
+    InstanceAgent().run()
                  
diff --git a/xos/openstack/manager.py b/xos/openstack/manager.py
index 42b1ef1..45d49b4 100644
--- a/xos/openstack/manager.py
+++ b/xos/openstack/manager.py
@@ -314,47 +314,47 @@
         return networks
 
     @require_enabled
-    def save_sliver(self, sliver):
+    def save_instance(self, instance):
         metadata_update = {}
-        if ("numberCores" in sliver.changed_fields):
-            metadata_update["cpu_cores"] = str(sliver.numberCores)
+        if ("numberCores" in instance.changed_fields):
+            metadata_update["cpu_cores"] = str(instance.numberCores)
 
-        for tag in sliver.slice.tags.all():
+        for tag in instance.slice.tags.all():
             if tag.name.startswith("sysctl-"):
                 metadata_update[tag.name] = tag.value
 
-        if not sliver.instance_id:
-            nics = self.get_requested_networks(sliver.slice)
+        if not instance.instance_id:
+            nics = self.get_requested_networks(instance.slice)
             for nic in nics:
                 # If a network hasn't been instantiated yet, then we'll fail
-                # during slice creation. Defer saving the sliver for now.
+                # during slice creation. Defer saving the instance for now.
                 if not nic.get("net-id", None):
-                    sliver.save()   # in case it hasn't been saved yet
+                    instance.save()   # in case it hasn't been saved yet
                     return
-            slice_memberships = SliceMembership.objects.filter(slice=sliver.slice)
+            slice_memberships = SliceMembership.objects.filter(slice=instance.slice)
             pubkeys = [sm.user.public_key for sm in slice_memberships if sm.user.public_key]
-            pubkeys.append(sliver.creator.public_key)
-            instance = self.driver.spawn_instance(name=sliver.name,
-                                   key_name = sliver.creator.keyname,
-                                   image_id = sliver.image.image_id,
-                                   hostname = sliver.node.name,
+            pubkeys.append(instance.creator.public_key)
+            instance = self.driver.spawn_instance(name=instance.name,
+                                   key_name = instance.creator.keyname,
+                                   image_id = instance.image.image_id,
+                                   hostname = instance.node.name,
                                    pubkeys = pubkeys,
                                    nics = nics,
                                    metadata = metadata_update )
-            sliver.instance_id = instance.id
-            sliver.instance_name = getattr(instance, 'OS-EXT-SRV-ATTR:instance_name')
+            instance.instance_id = instance.id
+            instance.instance_name = getattr(instance, 'OS-EXT-SRV-ATTR:instance_name')
         else:
             if metadata_update:
-                self.driver.update_instance_metadata(sliver.instance_id, metadata_update)
+                self.driver.update_instance_metadata(instance.instance_id, metadata_update)
 
-        sliver.save()
-        sliver.enacted = datetime.now()
-        sliver.save(update_fields=['enacted'])
+        instance.save()
+        instance.enacted = datetime.now()
+        instance.save(update_fields=['enacted'])
 
     @require_enabled
-    def delete_sliver(self, sliver):
-        if sliver.instance_id:
-            self.driver.destroy_instance(sliver.instance_id) 
+    def delete_instance(self, instance):
+        if instance.instance_id:
+            self.driver.destroy_instance(instance.instance_id) 
     
 
     def refresh_nodes(self):
diff --git a/xos/openstack/reservationagent.py b/xos/openstack/reservationagent.py
index cee5269..5cb9c8e 100644
--- a/xos/openstack/reservationagent.py
+++ b/xos/openstack/reservationagent.py
@@ -4,14 +4,14 @@
 #os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
 import time
 import django.utils
-from core.models.sliver import Sliver
+from core.models.instance import Instance
 from core.models.reservation import Reservation, ReservedResource
 
 class ReservationAgent:
 
     def run(self):
         while True :
-            slivers = {}
+            instances = {}
 
             tNow = django.utils.timezone.now()
             print "Processing reservations, tNow is %s" % tNow
@@ -22,25 +22,25 @@
                     print "    deleting expired reservation"
                     reservation.delete()
                 for reservedResource in reservation.reservedresources.all():
-                    sliver_resources = slivers.get(reservedResource.sliver.id, {})
-                    sliver_resources[reservedResource.resource.name] = reservedResource.quantity
-                    slivers[reservedResource.sliver.id] = sliver_resources
+                    instance_resources = instances.get(reservedResource.instance.id, {})
+                    instance_resources[reservedResource.resource.name] = reservedResource.quantity
+                    instances[reservedResource.instance.id] = instance_resources
 
-            print "Sliver reservation set"
-            for (sliverid, sliver_resources) in slivers.items():
-                print "  sliver", sliverid,
-                for (name, value) in sliver_resources.items():
+            print "Instance reservation set"
+            for (instanceid, instance_resources) in instances.items():
+                print "  instance", instanceid,
+                for (name, value) in instance_resources.items():
                     print str(name)+":", value,
                 print
 
-            print "Updating slivers"
-            for sliver in Sliver.objects.all():
-                sliver_resv = slivers.get(sliver.id, {})
-                numberCores = sliver_resv.get("numberCores", 0)
-                if numberCores != sliver.numberCores:
-                    print "sliver %s setting numberCores to %s" % (sliver.name, numberCores)
-                    sliver.numberCores = numberCores
-                    sliver.save()
+            print "Updating instances"
+            for instance in Instance.objects.all():
+                instance_resv = instances.get(instance.id, {})
+                numberCores = instance_resv.get("numberCores", 0)
+                if numberCores != instance.numberCores:
+                    print "instance %s setting numberCores to %s" % (instance.name, numberCores)
+                    instance.numberCores = numberCores
+                    instance.save()
 
             print "sleep"
             time.sleep(7)
diff --git a/xos/openstack_observer/ansible.py b/xos/openstack_observer/ansible.py
index 0e006ae..fad7610 100755
--- a/xos/openstack_observer/ansible.py
+++ b/xos/openstack_observer/ansible.py
@@ -136,7 +136,7 @@
 
 def run_template_ssh(name, opts, path='', expected_num=None):
     instance_id = opts["instance_id"]
-    sliver_name = opts["sliver_name"]
+    instance_name = opts["instance_name"]
     hostname = opts["hostname"]
     private_key = opts["private_key"]
     nat_ip = opts["nat_ip"]
@@ -167,7 +167,7 @@
     f.close()
 
     f = open(hosts_pathname, "w")
-    f.write("[%s]\n" % sliver_name)
+    f.write("[%s]\n" % instance_name)
     if proxy_ssh:
         f.write("%s ansible_ssh_private_key_file=%s\n" % (hostname, private_key_pathname))
     else:
diff --git a/xos/openstack_observer/ceilometer.py b/xos/openstack_observer/ceilometer.py
index 9944a9c..792515e 100644
--- a/xos/openstack_observer/ceilometer.py
+++ b/xos/openstack_observer/ceilometer.py
@@ -14,7 +14,7 @@
     from core.models import *
     filter_dict = {
             'ControllerSlice':[ControllerSlice, 'tenant_id', 'project_id'],
-            'Sliver':[Sliver, 'instance_id', 'resource_id'],
+            'Instance':[Instance, 'instance_id', 'resource_id'],
             'ControllerSite':[ControllerSite, 'tenant_id', 'project_id']
     }
 
diff --git a/xos/openstack_observer/event_loop.py b/xos/openstack_observer/event_loop.py
index b6eceb3..fc07e7d 100644
--- a/xos/openstack_observer/event_loop.py
+++ b/xos/openstack_observer/event_loop.py
@@ -192,9 +192,10 @@
 		pp = pprint.PrettyPrinter(indent=4)
 		pp.pprint(step_graph)
 		self.ordered_steps = toposort(self.dependency_graph, map(lambda s:s.__name__,self.sync_steps))
-		#self.ordered_steps = ['SyncRoles', 'SyncControllerSites', 'SyncControllerSitePrivileges','SyncImages', 'SyncControllerImages','SyncControllerUsers','SyncControllerUserSitePrivileges','SyncControllerSlices', 'SyncControllerSlicePrivileges', 'SyncControllerUserSlicePrivileges', 'SyncControllerNetworks','SyncSlivers']
+		#self.ordered_steps = ['SyncRoles', 'SyncControllerSites', 'SyncControllerSitePrivileges','SyncImages', 'SyncControllerImages','SyncControllerUsers','SyncControllerUserSitePrivileges','SyncControllerSlices', 'SyncControllerSlicePrivileges', 'SyncControllerUserSlicePrivileges', 'SyncControllerNetworks','SyncInstances']
 		#self.ordered_steps = ['SyncControllerSites','SyncRoles','SyncControllerUsers','SyncControllerSlices','SyncControllerNetworks']
 		#self.ordered_steps = ['SyncControllerNetworks']
+		#self.ordered_steps = ['SyncInstances','SyncNetworkInstances']
 
 		print "Order of steps=",self.ordered_steps
 
diff --git a/xos/openstack_observer/steps/sync_controller_networks.py b/xos/openstack_observer/steps/sync_controller_networks.py
index eecba85..54f2466 100644
--- a/xos/openstack_observer/steps/sync_controller_networks.py
+++ b/xos/openstack_observer/steps/sync_controller_networks.py
@@ -8,7 +8,7 @@
 from observer.syncstep import *
 from core.models.network import *
 from core.models.slice import *
-from core.models.sliver import Sliver
+from core.models.instance import Instance
 from util.logger import observer_logger as logger
 from observer.ansible import *
 from openstack.driver import OpenStackDriver
diff --git a/xos/openstack_observer/steps/sync_controller_slices.py b/xos/openstack_observer/steps/sync_controller_slices.py
index ef69496..c456a2f 100644
--- a/xos/openstack_observer/steps/sync_controller_slices.py
+++ b/xos/openstack_observer/steps/sync_controller_slices.py
@@ -42,7 +42,7 @@
             controller_user = controller_users[0]
             roles = ['admin']
 
-        max_instances=int(controller_slice.slice.max_slivers)
+        max_instances=int(controller_slice.slice.max_instances)
         tenant_fields = {'endpoint':controller_slice.controller.auth_url,
                          'admin_user': controller_slice.controller.admin_user,
                          'admin_password': controller_slice.controller.admin_password,
@@ -60,7 +60,7 @@
         if (not controller_slice.tenant_id):
             try:
                 driver = OpenStackDriver().admin_driver(controller=controller_slice.controller)
-                driver.shell.nova.quotas.update(tenant_id=tenant_id, instances=int(controller_slice.slice.max_slivers))
+                driver.shell.nova.quotas.update(tenant_id=tenant_id, instances=int(controller_slice.slice.max_instances))
             except:
                 logger.log_exc('Could not update quota for %s'%controller_slice.slice.name)
                 raise Exception('Could not update quota for %s'%controller_slice.slice.name)
diff --git a/xos/openstack_observer/steps/sync_instances.py b/xos/openstack_observer/steps/sync_instances.py
new file mode 100644
index 0000000..cbcdec6
--- /dev/null
+++ b/xos/openstack_observer/steps/sync_instances.py
@@ -0,0 +1,196 @@
+import os
+import base64
+import socket
+from django.db.models import F, Q
+from xos.config import Config
+from xos.settings import RESTAPI_HOSTNAME, RESTAPI_PORT
+from observer.openstacksyncstep import OpenStackSyncStep
+from core.models.instance import Instance
+from core.models.slice import Slice, SlicePrivilege, ControllerSlice
+from core.models.network import Network, NetworkSlice, ControllerNetwork
+from observer.ansible import *
+from observer.syncstep import *
+from util.logger import observer_logger as logger
+
+def escape(s):
+    s = s.replace('\n',r'\n').replace('"',r'\"')
+    return s
+
+class SyncInstances(OpenStackSyncStep):
+    provides=[Instance]
+    requested_interval=0
+    observes=Instance
+
+    def get_userdata(self, instance, pubkeys):
+        userdata = '#cloud-config\n\nopencloud:\n   slicename: "%s"\n   hostname: "%s"\n   restapi_hostname: "%s"\n   restapi_port: "%s"\n' % (instance.slice.name, instance.node.name, RESTAPI_HOSTNAME, str(RESTAPI_PORT))
+        userdata += 'ssh_authorized_keys:\n'
+        for key in pubkeys:
+            userdata += '  - %s\n' % key
+        return userdata
+
+    def sync_record(self, instance):
+        logger.info("sync'ing instance:%s slice:%s controller:%s " % (instance, instance.slice.name, instance.node.site_deployment.controller))
+        controller_register = json.loads(instance.node.site_deployment.controller.backend_register)
+
+        if (controller_register.get('disabled',False)):
+            raise InnocuousException('Controller %s is disabled'%instance.node.site_deployment.controller.name)
+
+        metadata_update = {}
+        if (instance.numberCores):
+            metadata_update["cpu_cores"] = str(instance.numberCores)
+
+        for tag in instance.slice.tags.all():
+            if tag.name.startswith("sysctl-"):
+                metadata_update[tag.name] = tag.value
+
+        # public keys
+        slice_memberships = SlicePrivilege.objects.filter(slice=instance.slice)
+        pubkeys = set([sm.user.public_key for sm in slice_memberships if sm.user.public_key])
+        if instance.creator.public_key:
+            pubkeys.add(instance.creator.public_key)
+
+        if instance.slice.creator.public_key:
+            pubkeys.add(instance.slice.creator.public_key)
+
+        if instance.slice.service and instance.slice.service.public_key:
+            pubkeys.add(instance.slice.service.public_key)
+
+        # Handle any ports that are already created and attached to the sliver.
+        # If we do have a port for a network, then add that network to an
+        # exclude list so we won't try to auto-create ports on that network
+        # when instantiating.
+        ports = []
+        exclude_networks = set()
+        exclude_templates = set()
+        for ns in sliver.ports.all():
+            if not ns.port_id:
+                raise DeferredException("Port %s on sliver %s has no id; Try again later" % (str(ns), str(sliver)) )
+            ports.append(ns.port_id)
+            exclude_networks.add(ns.network)
+            exclude_templates.add(ns.network.template)
+
+        nics = []
+        networks = [ns.network for ns in NetworkSlice.objects.filter(slice=instance.slice)]
+        networks = [n for n in networks if (n not in exclude_networks)]
+        controller_networks = ControllerNetwork.objects.filter(network__in=networks,
+                                                                controller=instance.node.site_deployment.controller)
+
+        for controller_network in controller_networks:
+            if controller_network.network.template.visibility == 'private' and \
+               controller_network.network.template.translation == 'none':
+                   if not controller_network.net_id:
+                        raise DeferredException("Private Network %s has no id; Try again later" % controller_network.network.name)
+                   nics.append(controller_network.net_id)
+
+        # Now include network templates, for those networks that use a
+        # shared_network_name.
+        network_templates = [network.template.shared_network_name for network in networks \
+                             if network.template.shared_network_name]
+        network_templates = [nt for nt in network_templates if (nt not in exclude_templates)]
+
+        #driver = self.driver.client_driver(caller=instance.creator, tenant=instance.slice.name, controller=instance.controllerNetwork)
+        driver = self.driver.admin_driver(tenant='admin', controller=instance.node.site_deployment.controller)
+        nets = driver.shell.quantum.list_networks()['networks']
+        for net in nets:
+            if net['name'] in network_templates:
+                nics.append(net['id'])
+
+        # If the slice isn't connected to anything, then at least put it on
+        # the public network.
+        if (not nics) and (not ports):
+            for net in nets:
+                if net['name']=='public':
+                    nics.append(net['id'])
+
+        image_name = None
+        controller_images = instance.image.controllerimages.filter(controller=instance.node.site_deployment.controller)
+        if controller_images:
+            image_name = controller_images[0].image.name
+            logger.info("using image from ControllerImage object: " + str(image_name))
+
+        if image_name is None:
+            controller_driver = self.driver.admin_driver(controller=instance.node.site_deployment.controller)
+            images = controller_driver.shell.glanceclient.images.list()
+            for image in images:
+                if image.name == instance.image.name or not image_name:
+                    image_name = image.name
+                    logger.info("using image from glance: " + str(image_name))
+
+        try:
+            legacy = Config().observer_legacy
+        except:
+            legacy = False
+
+        if (legacy):
+            host_filter = instance.node.name.split('.',1)[0]
+        else:
+            host_filter = instance.node.name.strip()
+
+        availability_zone_filter = 'nova:%s'%host_filter
+        instance_name = '%s-%d'%(instance.slice.name,instance.id)
+
+        userData = self.get_userdata(instance, pubkeys)
+        if instance.userData:
+            userData = instance.userData
+
+        controller = instance.node.site_deployment.controller
+        tenant_fields = {'endpoint':controller.auth_url,
+                     'admin_user': instance.creator.email,
+                     'admin_password': instance.creator.remote_password,
+                     'admin_tenant': instance.slice.name,
+                     'tenant': instance.slice.name,
+                     'tenant_description': instance.slice.description,
+                     'name':instance_name,
+                     'ansible_tag':instance_name,
+                     'availability_zone': availability_zone_filter,
+                     'image_name':image_name,
+                     'flavor_name':instance.flavor.name,
+                     'nics':nics,
+                     'ports':ports,
+                     'meta':metadata_update,
+                     'user_data':r'%s'%escape(userData)}
+
+        res = run_template('sync_instances.yaml', tenant_fields,path='instances', expected_num=1)
+        instance_id = res[0]['info']['OS-EXT-SRV-ATTR:instance_name']
+        instance_uuid = res[0]['id']
+
+        try:
+            hostname = res[0]['info']['OS-EXT-SRV-ATTR:hypervisor_hostname']
+            ip = socket.gethostbyname(hostname)
+            instance.ip = ip
+        except:
+            pass
+
+        instance.instance_id = instance_id
+        instance.instance_uuid = instance_uuid
+        instance.instance_name = instance_name
+        instance.save()
+
+    def delete_record(self, instance):
+        controller_register = json.loads(instance.node.site_deployment.controller.backend_register)
+
+        if (controller_register.get('disabled',False)):
+            raise InnocuousException('Controller %s is disabled'%instance.node.site_deployment.controller.name)
+
+        instance_name = '%s-%d'%(instance.slice.name,instance.id)
+        controller = instance.node.site_deployment.controller
+        tenant_fields = {'endpoint':controller.auth_url,
+                     'admin_user': instance.creator.email,
+                     'admin_password': instance.creator.remote_password,
+                     'admin_tenant': instance.slice.name,
+                     'tenant': instance.slice.name,
+                     'tenant_description': instance.slice.description,
+                     'name':instance_name,
+                     'ansible_tag':instance_name,
+                     'delete': True}
+
+        try:
+            res = run_template('sync_instances.yaml', tenant_fields,path='instances', expected_num=1)
+        except Exception,e:
+            print "Could not sync %s"%instance_name
+            #import traceback
+            #traceback.print_exc()
+            raise e
+
+        if (len(res)!=1):
+            raise Exception('Could not delete instance %s'%instance.slice.name)
diff --git a/xos/openstack_observer/steps/sync_ports.py b/xos/openstack_observer/steps/sync_ports.py
index b7543f5..15fd4a1 100644
--- a/xos/openstack_observer/steps/sync_ports.py
+++ b/xos/openstack_observer/steps/sync_ports.py
@@ -17,7 +17,7 @@
     #     which Network is associated from the port.
 
     def call(self, **args):
-        logger.info("sync'ing network slivers")
+        logger.info("sync'ing network instances")
 
         ports = Port.objects.all()
         ports_by_id = {}
@@ -36,10 +36,10 @@
         #for (network_id, network) in networks_by_id.items():
         #    logger.info("   %s: %s" % (network_id, network.name))
 
-        slivers = Sliver.objects.all()
-        slivers_by_instance_uuid = {}
-        for sliver in slivers:
-            slivers_by_instance_uuid[sliver.instance_uuid] = sliver
+        instances = Instance.objects.all()
+        instances_by_instance_uuid = {}
+        for instance in instances:
+            instances_by_instance_uuid[instance.instance_uuid] = instance
 
         # Get all ports in all controllers
 
@@ -84,25 +84,25 @@
                 #logger.info("port %s is not a compute port, it is a %s" % (port["id"], port["device_owner"]))
                 continue
 
-            sliver = slivers_by_instance_uuid.get(port['device_id'], None)
-            if not sliver:
-                logger.info("no sliver for port %s device_id %s" % (port["id"], port['device_id']))
+            instance = instances_by_instance_uuid.get(port['device_id'], None)
+            if not instance:
+                logger.info("no instance for port %s device_id %s" % (port["id"], port['device_id']))
                 continue
 
             network = networks_by_id.get(port['network_id'], None)
             if not network:
                 # maybe it's public-nat or public-dedicated. Search the templates for
-                # the id, then see if the sliver's slice has some network that uses
+                # the id, then see if the instance's slice has some network that uses
                 # that template
                 template = templates_by_id.get(port['network_id'], None)
-                if template and sliver.slice:
-                    for candidate_network in sliver.slice.networks.all():
+                if template and instance.slice:
+                    for candidate_network in instance.slice.networks.all():
                          if candidate_network.template == template:
                              network=candidate_network
             if not network:
                 logger.info("no network for port %s network %s" % (port["id"], port["network_id"]))
 
-                # we know it's associated with a sliver, but we don't know
+                # we know it's associated with a instance, but we don't know
                 # which network it is part of.
 
                 continue
@@ -114,7 +114,7 @@
                 networks = network.template.network_set.all()
                 network = None
                 for candidate_network in networks:
-                    if (candidate_network.owner == sliver.slice):
+                    if (candidate_network.owner == instance.slice):
                         print "found network", candidate_network
                         network = candidate_network
 
@@ -128,10 +128,10 @@
 
             ip=port["fixed_ips"][0]["ip_address"]
             mac=port["mac_address"]
-            logger.info("creating Port (%s, %s, %s, %s)" % (str(network), str(sliver), ip, str(port["id"])))
+            logger.info("creating Port (%s, %s, %s, %s)" % (str(network), str(instance), ip, str(port["id"])))
 
             ns = Port(network=network,
-                               sliver=sliver,
+                               instance=instance,
                                ip=ip,
                                mac=mac,
                                port_id=port["id"])
@@ -144,9 +144,9 @@
 
         # For ports that were created by the user, find that ones
         # that don't have neutron ports, and create them.
-        for port in Port.objects.filter(port_id__isnull=True, sliver__isnull=False):
+        for port in Port.objects.filter(port_id__isnull=True, instance__isnull=False):
             #logger.info("XXX working on port %s" % port)
-            controller = port.sliver.node.site_deployment.controller
+            controller = port.instance.node.site_deployment.controller
             if controller:
                 cn=port.network.controllernetworks.filter(controller=controller)
                 if not cn:
@@ -163,9 +163,9 @@
                     continue
                 try:
                     # We need to use a client driver that specifies the tenant
-                    # of the destination sliver. Nova-compute will not connect
-                    # ports to slivers if the port's tenant does not match
-                    # the sliver's tenant.
+                    # of the destination instance. Nova-compute will not connect
+                    # ports to instances if the port's tenant does not match
+                    # the instance's tenant.
 
                     # A bunch of stuff to compensate for OpenStackDriver.client_driveR()
                     # not being in working condition.
@@ -174,7 +174,7 @@
                     caller = port.network.owner.creator
                     auth = {'username': caller.email,
                             'password': caller.remote_password,
-                            'tenant': port.sliver.slice.name} # port.network.owner.name}
+                            'tenant': port.instance.slice.name} # port.network.owner.name}
                     client = OpenStackClient(controller=controller, **auth) # cacert=self.config.nova_ca_ssl_cert,
                     driver = OpenStackDriver(client=client)
 
@@ -212,18 +212,18 @@
                 neutron_nat_list = []
 
             if (neutron_nat_list != nat_list):
-                logger.info("Setting nat:forward_ports for port %s network %s sliver %s to %s" % (str(port.port_id), str(port.network.id), str(port.sliver), str(nat_list)))
+                logger.info("Setting nat:forward_ports for port %s network %s instance %s to %s" % (str(port.port_id), str(port.network.id), str(port.instance), str(nat_list)))
                 try:
-                    driver = self.driver.admin_driver(controller=port.sliver.node.site_deployment.controller,tenant='admin')
+                    driver = self.driver.admin_driver(controller=port.instance.node.site_deployment.controller,tenant='admin')
                     driver.shell.quantum.update_port(port.port_id, {"port": {"nat:forward_ports": nat_list}})
                 except:
                     logger.log_exc("failed to update port with nat_list %s" % str(nat_list))
                     continue
             else:
-                #logger.info("port %s network %s sliver %s nat %s is already set" % (str(port.port_id), str(port.network.id), str(port.sliver), str(nat_list)))
+                #logger.info("port %s network %s instance %s nat %s is already set" % (str(port.port_id), str(port.network.id), str(port.instance), str(nat_list)))
                 pass
 
-    def delete_record(self, network_sliver):
+    def delete_record(self, network_instance):
         # Nothing to do, this is an OpenCloud object
         pass
 
diff --git a/xos/openstack_observer/steps/sync_slivers.py b/xos/openstack_observer/steps/sync_slivers.py
deleted file mode 100644
index d98c2d2..0000000
--- a/xos/openstack_observer/steps/sync_slivers.py
+++ /dev/null
@@ -1,196 +0,0 @@
-import os
-import base64
-import socket
-from django.db.models import F, Q
-from xos.config import Config
-from xos.settings import RESTAPI_HOSTNAME, RESTAPI_PORT
-from observer.openstacksyncstep import OpenStackSyncStep
-from core.models.sliver import Sliver
-from core.models.slice import Slice, SlicePrivilege, ControllerSlice
-from core.models.network import Network, NetworkSlice, ControllerNetwork
-from observer.ansible import *
-from observer.syncstep import *
-from util.logger import observer_logger as logger
-
-def escape(s):
-    s = s.replace('\n',r'\n').replace('"',r'\"')
-    return s
-
-class SyncSlivers(OpenStackSyncStep):
-    provides=[Sliver]
-    requested_interval=0
-    observes=Sliver
-
-    def get_userdata(self, sliver, pubkeys):
-        userdata = '#cloud-config\n\nopencloud:\n   slicename: "%s"\n   hostname: "%s"\n   restapi_hostname: "%s"\n   restapi_port: "%s"\n' % (sliver.slice.name, sliver.node.name, RESTAPI_HOSTNAME, str(RESTAPI_PORT))
-        userdata += 'ssh_authorized_keys:\n'
-        for key in pubkeys:
-            userdata += '  - %s\n' % key
-        return userdata
-
-    def sync_record(self, sliver):
-        logger.info("sync'ing sliver:%s slice:%s controller:%s " % (sliver, sliver.slice.name, sliver.node.site_deployment.controller))
-        controller_register = json.loads(sliver.node.site_deployment.controller.backend_register)
-
-        if (controller_register.get('disabled',False)):
-            raise InnocuousException('Controller %s is disabled'%sliver.node.site_deployment.controller.name)
-
-        metadata_update = {}
-        if (sliver.numberCores):
-            metadata_update["cpu_cores"] = str(sliver.numberCores)
-
-        for tag in sliver.slice.tags.all():
-            if tag.name.startswith("sysctl-"):
-                metadata_update[tag.name] = tag.value
-
-        # public keys
-        slice_memberships = SlicePrivilege.objects.filter(slice=sliver.slice)
-        pubkeys = set([sm.user.public_key for sm in slice_memberships if sm.user.public_key])
-        if sliver.creator.public_key:
-            pubkeys.add(sliver.creator.public_key)
-
-        if sliver.slice.creator.public_key:
-            pubkeys.add(sliver.slice.creator.public_key)
-
-        if sliver.slice.service and sliver.slice.service.public_key:
-            pubkeys.add(sliver.slice.service.public_key)
-
-        # Handle any ports that are already created and attached to the sliver.
-        # If we do have a port for a network, then add that network to an
-        # exclude list so we won't try to auto-create ports on that network
-        # when instantiating.
-        ports = []
-        exclude_networks = set()
-        exclude_templates = set()
-        for ns in sliver.ports.all():
-            if not ns.port_id:
-                raise DeferredException("Port %s on sliver %s has no id; Try again later" % (str(ns), str(sliver)) )
-            ports.append(ns.port_id)
-            exclude_networks.add(ns.network)
-            exclude_templates.add(ns.network.template)
-
-        nics = []
-        networks = [ns.network for ns in NetworkSlice.objects.filter(slice=sliver.slice)]
-        networks = [n for n in networks if (n not in exclude_networks)]
-        controller_networks = ControllerNetwork.objects.filter(network__in=networks,
-                                                                controller=sliver.node.site_deployment.controller)
-
-        for controller_network in controller_networks:
-            if controller_network.network.template.visibility == 'private' and \
-               controller_network.network.template.translation == 'none':
-                   if not controller_network.net_id:
-                        raise DeferredException("Private Network %s has no id; Try again later" % controller_network.network.name)
-                   nics.append(controller_network.net_id)
-
-        # Now include network templates, for those networks that use a
-        # shared_network_name.
-        network_templates = [network.template.shared_network_name for network in networks \
-                             if network.template.shared_network_name]
-        network_templates = [nt for nt in network_templates if (nt not in exclude_templates)]
-
-        #driver = self.driver.client_driver(caller=sliver.creator, tenant=sliver.slice.name, controller=sliver.controllerNetwork)
-        driver = self.driver.admin_driver(tenant='admin', controller=sliver.node.site_deployment.controller)
-        nets = driver.shell.quantum.list_networks()['networks']
-        for net in nets:
-            if net['name'] in network_templates:
-                nics.append(net['id'])
-
-        # If the slice isn't connected to anything, then at least put it on
-        # the public network.
-        if (not nics) and (not ports):
-            for net in nets:
-                if net['name']=='public':
-                    nics.append(net['id'])
-
-        image_name = None
-        controller_images = sliver.image.controllerimages.filter(controller=sliver.node.site_deployment.controller)
-        if controller_images:
-            image_name = controller_images[0].image.name
-            logger.info("using image from ControllerImage object: " + str(image_name))
-
-        if image_name is None:
-            controller_driver = self.driver.admin_driver(controller=sliver.node.site_deployment.controller)
-            images = controller_driver.shell.glanceclient.images.list()
-            for image in images:
-                if image.name == sliver.image.name or not image_name:
-                    image_name = image.name
-                    logger.info("using image from glance: " + str(image_name))
-
-        try:
-            legacy = Config().observer_legacy
-        except:
-            legacy = False
-
-        if (legacy):
-            host_filter = sliver.node.name.split('.',1)[0]
-        else:
-            host_filter = sliver.node.name.strip()
-
-        availability_zone_filter = 'nova:%s'%host_filter
-        sliver_name = '%s-%d'%(sliver.slice.name,sliver.id)
-
-        userData = self.get_userdata(sliver, pubkeys)
-        if sliver.userData:
-            userData = sliver.userData
-
-        controller = sliver.node.site_deployment.controller
-        tenant_fields = {'endpoint':controller.auth_url,
-                     'admin_user': sliver.creator.email,
-                     'admin_password': sliver.creator.remote_password,
-                     'admin_tenant': sliver.slice.name,
-                     'tenant': sliver.slice.name,
-                     'tenant_description': sliver.slice.description,
-                     'name':sliver_name,
-                     'ansible_tag':sliver_name,
-                     'availability_zone': availability_zone_filter,
-                     'image_name':image_name,
-                     'flavor_name':sliver.flavor.name,
-                     'nics':nics,
-                     'ports':ports,
-                     'meta':metadata_update,
-                     'user_data':r'%s'%escape(userData)}
-
-        res = run_template('sync_slivers.yaml', tenant_fields,path='slivers', expected_num=1)
-        sliver_id = res[0]['info']['OS-EXT-SRV-ATTR:instance_name']
-        sliver_uuid = res[0]['id']
-
-        try:
-            hostname = res[0]['info']['OS-EXT-SRV-ATTR:hypervisor_hostname']
-            ip = socket.gethostbyname(hostname)
-            sliver.ip = ip
-        except:
-            pass
-
-        sliver.instance_id = sliver_id
-        sliver.instance_uuid = sliver_uuid
-        sliver.instance_name = sliver_name
-        sliver.save()
-
-    def delete_record(self, sliver):
-        controller_register = json.loads(sliver.node.site_deployment.controller.backend_register)
-
-        if (controller_register.get('disabled',False)):
-            raise InnocuousException('Controller %s is disabled'%sliver.node.site_deployment.controller.name)
-
-        sliver_name = '%s-%d'%(sliver.slice.name,sliver.id)
-        controller = sliver.node.site_deployment.controller
-        tenant_fields = {'endpoint':controller.auth_url,
-                     'admin_user': sliver.creator.email,
-                     'admin_password': sliver.creator.remote_password,
-                     'admin_tenant': sliver.slice.name,
-                     'tenant': sliver.slice.name,
-                     'tenant_description': sliver.slice.description,
-                     'name':sliver_name,
-                     'ansible_tag':sliver_name,
-                     'delete': True}
-
-        try:
-            res = run_template('sync_slivers.yaml', tenant_fields,path='slivers', expected_num=1)
-        except Exception,e:
-            print "Could not sync %s"%sliver_name
-            #import traceback
-            #traceback.print_exc()
-            raise e
-
-        if (len(res)!=1):
-            raise Exception('Could not delete sliver %s'%sliver.slice.name)
diff --git a/xos/openstack_observer/syncstep.py b/xos/openstack_observer/syncstep.py
index 03f6d16..791a89a 100644
--- a/xos/openstack_observer/syncstep.py
+++ b/xos/openstack_observer/syncstep.py
@@ -80,7 +80,7 @@
             objs = main_obj.deleted_objects.all()
 
         return objs
-        #return Sliver.objects.filter(ip=None)
+        #return Instance.objects.filter(ip=None)
 
     def check_dependencies(self, obj, failed):
         for dep in self.dependencies:
diff --git a/xos/rr_observer/rrlib.py b/xos/rr_observer/rrlib.py
index 20c2341..6968dcd 100644
--- a/xos/rr_observer/rrlib.py
+++ b/xos/rr_observer/rrlib.py
@@ -27,7 +27,7 @@
         pass
     
     def gen_slice_info(self, service=None):   
-        """generates sliver information from slice of request router
+        """generates instance information from slice of request router
         """
 
         if (service is None ):
@@ -40,13 +40,13 @@
     
         '''for slice in service.service.all():
             name = slice.name
-            for sliver in slice.slivers.all():
-                mapping[sliver.name] = str(sliver.ip)
+            for instance in slice.instances.all():
+                mapping[instance.name] = str(instance.ip)
         '''
         return mapping
 
     def gen_servicemap_slice_info(self, servicemap):
-        """generates sliver information from slice of servicemap
+        """generates instance information from slice of servicemap
         """
 
         wzone = Set(['arizona', 'stanford', 'on.lab', 'housten']) # zone=1 in cooden.conf
@@ -56,14 +56,14 @@
         mapping_ip = {}
         slice = servicemap.slice
         name = slice.name
-        for sliver in slice.slivers.all():
-            mapping_ip[sliver.node.name] = socket.gethostbyname(sliver.node.name)
-            #print "sliver name "+sliver.name+str(sliver.ip)+"\n"
-            site = sliver.node.site.name
+        for instance in slice.instances.all():
+            mapping_ip[instance.node.name] = socket.gethostbyname(instance.node.name)
+            #print "instance name "+instance.name+str(instance.ip)+"\n"
+            site = instance.node.site.name
             if(site.lower() in wzone):
-                mapping_zone[sliver.node.name] = str(1)
+                mapping_zone[instance.node.name] = str(1)
             else:
-                mapping_zone[sliver.node.name] = str(2)
+                mapping_zone[instance.node.name] = str(2)
 
         return mapping_ip, mapping_zone
 
diff --git a/xos/syndicate_observer/syndicatelib.py b/xos/syndicate_observer/syndicatelib.py
index 331e925..9044a48 100644
--- a/xos/syndicate_observer/syndicatelib.py
+++ b/xos/syndicate_observer/syndicatelib.py
@@ -61,7 +61,7 @@
    import syndicate_storage.models as models
 
    # get OpenCloud models 
-   from core.models import Slice,Sliver
+   from core.models import Slice,Instance
    
    from django.core.exceptions import ObjectDoesNotExist
    from django.db import IntegrityError
@@ -501,7 +501,7 @@
 def put_principal_data( user_email, observer_secret, public_key_pem, private_key_pem ):
     """
     Seal and store the principal's private key into the database, in a SyndicatePrincipal object,
-    so the sliver-side Syndicate daemon syndicated.py can get them later.
+    so the instance-side Syndicate daemon syndicated.py can get them later.
     Overwrite an existing principal if one exists.
     """
     
@@ -814,9 +814,9 @@
 
 
 #-------------------------------
-def do_push( sliver_hosts, portnum, payload ):
+def do_push( instance_hosts, portnum, payload ):
     """
-    Push a payload to a list of slivers.
+    Push a payload to a list of instances.
     NOTE: this has to be done in one go, since we can't import grequests
     into the global namespace (without wrecking havoc on the credential server),
     but it has to stick around for the push to work.
@@ -837,7 +837,7 @@
     
     # fan-out 
     requests = []
-    for sh in sliver_hosts:
+    for sh in instance_hosts:
       rs = grequests.post( "http://" + sh + ":" + str(portnum), data={"observer_message": payload}, timeout=getattr(CONFIG, "SYNDICATE_HTTP_PUSH_TIMEOUT", 60) )
       requests.append( rs )
       
@@ -873,7 +873,7 @@
        logger.error("No such slice '%s'" % slice_name)
        return None
 
-   hostnames = [s.node.name for s in openstack_slice.slivers.all()]
+   hostnames = [s.node.name for s in openstack_slice.instances.all()]
 
    return hostnames
 
@@ -894,8 +894,8 @@
    for volume state.
    
    NOTE: this is a fall-back mechanism.  The observer should push new 
-   volume state to the slices' slivers.  However, if that fails, the 
-   slivers are configured to poll for volume state periodically.  This 
+   volume state to the slices' instances.  However, if that fails, the 
+   instances are configured to poll for volume state periodically.  This 
    server allows them to do just that.
    
    Responses:
@@ -906,12 +906,12 @@
       GET /<slicename>/SYNDICATE_SLICE_SECRET    -- Reply with the slice secret (TEMPORARY)
    
    
-   NOTE: We want to limit who can learn which Volumes a slice can access, so we'll seal its slivers'
-   credentials with the SliceSecret secret.  The slivers (which have the slice-wide secret) can then decrypt it.
+   NOTE: We want to limit who can learn which Volumes a slice can access, so we'll seal its instances'
+   credentials with the SliceSecret secret.  The instances (which have the slice-wide secret) can then decrypt it.
    However, sealing the listing is a time-consuming process (on the order of 10s), so we only want 
    to do it when we have to.  Since *anyone* can ask for the ciphertext of the volume list,
    we will cache the list ciphertext for each slice for a long-ish amount of time, so we don't
-   accidentally DDoS this server.  This necessarily means that the sliver might see a stale
+   accidentally DDoS this server.  This necessarily means that the instance might see a stale
    volume listing, but that's okay, since the Observer is eventually consistent anyway.
    """
    
@@ -971,7 +971,7 @@
       
       # block the cache.
       # NOTE: don't release the lock until we've generated credentials.
-      # Chances are, there's a thundering herd of slivers coming online.
+      # Chances are, there's a thundering herd of instances coming online.
       # Block them all until we've generated their slice's credentials,
       # and then serve them the cached one.
       
diff --git a/xos/syndicate_observer/syndicatelib_config/config-opencloud.py b/xos/syndicate_observer/syndicatelib_config/config-opencloud.py
index 463b84e..3cd2950 100644
--- a/xos/syndicate_observer/syndicatelib_config/config-opencloud.py
+++ b/xos/syndicate_observer/syndicatelib_config/config-opencloud.py
@@ -11,7 +11,7 @@
 # URL to the Syndicate SMI.  For example, https://syndicate-metadata.appspot.com
 SYNDICATE_SMI_URL="http://localhost:8080"
 
-# If you are going to use OpenID to authenticate the Syndicate sliver daemon,
+# If you are going to use OpenID to authenticate the Syndicate instance daemon,
 # this is the OpenID provider URL.  It is currently used only to generate 
 # identity pages for users, so you can put whatever you want here for now.
 SYNDICATE_OPENID_TRUSTROOT="http://localhost:8081"
@@ -39,7 +39,7 @@
 SYNDICATE_PRIVATE_KEY="/opt/xos/syndicate_observer/syndicatelib_config/pollserver.pem"
 
 # This is the master secret used to generate secrets to seal sensitive information sent to the 
-# Syndicate sliver mount daemons.  It is also used to seal sensitive information
+# Syndicate instance mount daemons.  It is also used to seal sensitive information
 # stored to the Django database.  
 # TODO: think of a way to not have to store this on disk.  Maybe we feed into the
 # observer when it starts up?
@@ -47,14 +47,14 @@
 
 # This is the default port number on which a Syndicate Replica Gateway
 # will be provisioned.  It's a well-known port, and can be the same across
-# slivers, since in OpenCloud, an RG instance only listens to localhost.
+# instances, since in OpenCloud, an RG instance only listens to localhost.
 SYNDICATE_RG_DEFAULT_PORT=38800
 
 # This is the absolute path to the RG's storage driver (which will be automatically
-# pushed to slivers by Syndicate).  See https://github.com/jcnelson/syndicate/wiki/Replica-Gateways
+# pushed to instances by Syndicate).  See https://github.com/jcnelson/syndicate/wiki/Replica-Gateways
 SYNDICATE_RG_CLOSURE=None
 
-# This is the port number the observer listens on for GETs from the Syndicate sliver mount 
+# This is the port number the observer listens on for GETs from the Syndicate instance mount 
 # daemons.  Normally, the oserver pushes (encrypted) commands to the daemons, but if the 
 # daemons are NAT'ed or temporarily partitioned, they will pull commands instead.
 SYNDICATE_HTTP_PORT=65321
@@ -65,7 +65,7 @@
 # This is the number of seconds to wait for pushing a slice credential before timing out.
 SYNDICATE_HTTP_PUSH_TIMEOUT=60
 
-# This is the port number the Syndicate sliver mount daemons listen on.  The observer will 
+# This is the port number the Syndicate instance mount daemons listen on.  The observer will 
 # push commands to them on this port.
 SYNDICATE_SLIVER_PORT=65322
 
diff --git a/xos/syndicate_observer/syndicatelib_config/config.py b/xos/syndicate_observer/syndicatelib_config/config.py
index 463b84e..3cd2950 100644
--- a/xos/syndicate_observer/syndicatelib_config/config.py
+++ b/xos/syndicate_observer/syndicatelib_config/config.py
@@ -11,7 +11,7 @@
 # URL to the Syndicate SMI.  For example, https://syndicate-metadata.appspot.com
 SYNDICATE_SMI_URL="http://localhost:8080"
 
-# If you are going to use OpenID to authenticate the Syndicate sliver daemon,
+# If you are going to use OpenID to authenticate the Syndicate instance daemon,
 # this is the OpenID provider URL.  It is currently used only to generate 
 # identity pages for users, so you can put whatever you want here for now.
 SYNDICATE_OPENID_TRUSTROOT="http://localhost:8081"
@@ -39,7 +39,7 @@
 SYNDICATE_PRIVATE_KEY="/opt/xos/syndicate_observer/syndicatelib_config/pollserver.pem"
 
 # This is the master secret used to generate secrets to seal sensitive information sent to the 
-# Syndicate sliver mount daemons.  It is also used to seal sensitive information
+# Syndicate instance mount daemons.  It is also used to seal sensitive information
 # stored to the Django database.  
 # TODO: think of a way to not have to store this on disk.  Maybe we feed into the
 # observer when it starts up?
@@ -47,14 +47,14 @@
 
 # This is the default port number on which a Syndicate Replica Gateway
 # will be provisioned.  It's a well-known port, and can be the same across
-# slivers, since in OpenCloud, an RG instance only listens to localhost.
+# instances, since in OpenCloud, an RG instance only listens to localhost.
 SYNDICATE_RG_DEFAULT_PORT=38800
 
 # This is the absolute path to the RG's storage driver (which will be automatically
-# pushed to slivers by Syndicate).  See https://github.com/jcnelson/syndicate/wiki/Replica-Gateways
+# pushed to instances by Syndicate).  See https://github.com/jcnelson/syndicate/wiki/Replica-Gateways
 SYNDICATE_RG_CLOSURE=None
 
-# This is the port number the observer listens on for GETs from the Syndicate sliver mount 
+# This is the port number the observer listens on for GETs from the Syndicate instance mount 
 # daemons.  Normally, the oserver pushes (encrypted) commands to the daemons, but if the 
 # daemons are NAT'ed or temporarily partitioned, they will pull commands instead.
 SYNDICATE_HTTP_PORT=65321
@@ -65,7 +65,7 @@
 # This is the number of seconds to wait for pushing a slice credential before timing out.
 SYNDICATE_HTTP_PUSH_TIMEOUT=60
 
-# This is the port number the Syndicate sliver mount daemons listen on.  The observer will 
+# This is the port number the Syndicate instance mount daemons listen on.  The observer will 
 # push commands to them on this port.
 SYNDICATE_SLIVER_PORT=65322
 
diff --git a/xos/tests/slivertest.py b/xos/tests/instancetest.py
similarity index 67%
rename from xos/tests/slivertest.py
rename to xos/tests/instancetest.py
index 60124fd..2813521 100644
--- a/xos/tests/slivertest.py
+++ b/xos/tests/instancetest.py
@@ -1,8 +1,8 @@
 """
-    Basic Sliver Test
+    Basic Instance Test
 
     1) Create a slice1
-    2) Create sliver1 on slice1
+    2) Create instance1 on slice1
 """
 
 import os
@@ -14,15 +14,15 @@
 
 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
 from openstack.manager import OpenStackManager
-from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
+from core.models import Slice, Instance, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
 
 from planetstacktest import PlanetStackTest, fail_unless
 
-class SliverTest(PlanetStackTest):
+class InstanceTest(PlanetStackTest):
     def __init__(self):
         PlanetStackTest.__init__(self)
 
-    def run_sliver1(self):
+    def run_instance1(self):
         slice1Name = self.make_slice_name()
         slice1 = Slice(name = slice1Name,
                        omf_friendly=True,
@@ -30,22 +30,22 @@
                        creator=self.testUser)
         slice1=self.save_and_wait_for_enacted(slice1, nonempty_fields=["tenant_id"])
 
-        sliver1 = Sliver(image = self.testImage,
+        instance1 = Instance(image = self.testImage,
                          creator=self.testUser,
                          slice=slice1,
                          node=self.testNode,
                          deploymentNetwork=self.testDeployment)
-        sliver1=self.save_and_wait_for_enacted(sliver1, nonempty_fields=["instance_id", "ip"])
+        instance1=self.save_and_wait_for_enacted(instance1, nonempty_fields=["instance_id", "ip"])
 
     def run(self):
         self.setup()
         try:
-             self.run_sliver1()
+             self.run_instance1()
         finally:
              self.cleanup()
 
 def main():
-    SliverTest().run()
+    InstanceTest().run()
 
 if __name__=="__main__":
     main()
diff --git a/xos/tests/networktest.py b/xos/tests/networktest.py
index 5390f0f..b4bcbd2 100644
--- a/xos/tests/networktest.py
+++ b/xos/tests/networktest.py
@@ -2,12 +2,12 @@
     Network Data Model Test
 
     1) Create a slice1
-    2) Create sliver1 on slice1
-    3) Verify one quantum network created for sliver1
+    2) Create instance1 on slice1
+    3) Verify one quantum network created for instance1
     4) Create a private network, network1
     5) Connect network1 to slice1
-    6) Create sliver1_2 on slice1
-    7) Verify two quantum networks created for sliver1_2
+    6) Create instance1_2 on slice1
+    7) Verify two quantum networks created for instance1_2
 """
 
 import os
@@ -19,7 +19,7 @@
 
 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
 from openstack.manager import OpenStackManager
-from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
+from core.models import Slice, Instance, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
 
 from planetstacktest import PlanetStackTest, fail_unless, fail
 
@@ -27,10 +27,10 @@
     def __init__(self):
         PlanetStackTest.__init__(self)
 
-    def wait_for_ports(self, sliver, count=1, max_time=120):
-        print "waiting for %d ports on %s" % (count, str(sliver))
+    def wait_for_ports(self, instance, count=1, max_time=120):
+        print "waiting for %d ports on %s" % (count, str(instance))
         while max_time>0:
-            ports = self.manager.driver.shell.quantum.list_ports(device_id=sliver.instance_id)["ports"]
+            ports = self.manager.driver.shell.quantum.list_ports(device_id=instance.instance_id)["ports"]
             if len(ports)==count:
                 return ports
 
@@ -70,15 +70,15 @@
                        creator=self.testUser)
         slice1=self.save_and_wait_for_enacted(slice1, nonempty_fields=["tenant_id"])
 
-        sliver1 = Sliver(image = self.testImage,
+        instance1 = Instance(image = self.testImage,
                          creator=self.testUser,
                          slice=slice1,
                          node=self.testNode,
                          deploymentNetwork=self.testDeployment)
-        sliver1=self.save_and_wait_for_enacted(sliver1, nonempty_fields=["instance_id", "ip"])
+        instance1=self.save_and_wait_for_enacted(instance1, nonempty_fields=["instance_id", "ip"])
 
-        # sliver1 should have only one port, its private network
-        ports = self.wait_for_ports(sliver1, count=1)
+        # instance1 should have only one port, its private network
+        ports = self.wait_for_ports(instance1, count=1)
         self.verify_network_names(ports, [slice1.name])
 
         network1 = Network(name = slice1Name + "-pvt",
@@ -89,14 +89,14 @@
         network1_slice1 = NetworkSlice(network=network1, slice=slice1)
         network1_slice1.save() # does not need to be enacted
 
-        sliver1_2 = Sliver(image = self.testImage,
+        instance1_2 = Instance(image = self.testImage,
                          creator=self.testUser,
                          slice=slice1,
                          node=self.testNode,
                          deploymentNetwork=self.testDeployment)
-        sliver1_2=self.save_and_wait_for_enacted(sliver1_2, nonempty_fields=["instance_id", "ip"])
+        instance1_2=self.save_and_wait_for_enacted(instance1_2, nonempty_fields=["instance_id", "ip"])
 
-        ports = self.wait_for_ports(sliver1_2, count=2)
+        ports = self.wait_for_ports(instance1_2, count=2)
         self.verify_network_names(ports, [slice1.name, network1.name])
 
         self.slice1 = slice1
@@ -118,14 +118,14 @@
         network2_slice2 = NetworkSlice(network=network2, slice=slice2)
         network2_slice2.save() # does not need to be enacted
 
-        sliver2_1 = Sliver(image = self.testImage,
+        instance2_1 = Instance(image = self.testImage,
                          creator=self.testUser,
                          slice=slice2,
                          node=self.testNode,
                          deploymentNetwork=self.testDeployment)
-        sliver2_1=self.save_and_wait_for_enacted(sliver2_1, nonempty_fields=["instance_id", "ip"])
+        instance2_1=self.save_and_wait_for_enacted(instance2_1, nonempty_fields=["instance_id", "ip"])
 
-        ports = self.wait_for_ports(sliver2_1, count=2)
+        ports = self.wait_for_ports(instance2_1, count=2)
         self.verify_network_names(ports, [slice2.name, network2.name])
 
         self.slice2 = slice2
@@ -137,14 +137,14 @@
         network2_slice1 = NetworkSlice(network=self.network2, slice=self.slice1)
         network2_slice1.save()
 
-        sliver1_3 = Sliver(image = self.testImage,
+        instance1_3 = Instance(image = self.testImage,
                          creator=self.testUser,
                          slice=self.slice1,
                          node=self.testNode,
                          deploymentNetwork=self.testDeployment)
-        sliver1_3=self.save_and_wait_for_enacted(sliver1_3, nonempty_fields=["instance_id", "ip"])
+        instance1_3=self.save_and_wait_for_enacted(instance1_3, nonempty_fields=["instance_id", "ip"])
 
-        ports = self.wait_for_ports(sliver1_3, count=3)
+        ports = self.wait_for_ports(instance1_3, count=3)
         self.verify_network_names(ports, [self.slice1.name, self.network1.name, self.network2.name])
 
     def test_nat_net(self):
@@ -164,14 +164,14 @@
         network3_slice3 = NetworkSlice(network=network3, slice=slice3)
         network3_slice3.save() # does not need to be enacted
 
-        sliver3_1 = Sliver(image = self.testImage,
+        instance3_1 = Instance(image = self.testImage,
                          creator=self.testUser,
                          slice=slice3,
                          node=self.testNode,
                          deploymentNetwork=self.testDeployment)
-        sliver3_1=self.save_and_wait_for_enacted(sliver3_1, nonempty_fields=["instance_id", "ip"])
+        instance3_1=self.save_and_wait_for_enacted(instance3_1, nonempty_fields=["instance_id", "ip"])
 
-        ports = self.wait_for_ports(sliver3_1, count=2)
+        ports = self.wait_for_ports(instance3_1, count=2)
         self.verify_network_names(ports, [slice3.name, "nat-net"])
 
     def run(self):
diff --git a/xos/tests/planetstacktest.py b/xos/tests/planetstacktest.py
index 99bd730..baf7efe 100644
--- a/xos/tests/planetstacktest.py
+++ b/xos/tests/planetstacktest.py
@@ -7,7 +7,7 @@
 
 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
 from openstack.manager import OpenStackManager
-from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
+from core.models import Slice, Instance, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
 
 TEST_SITE_NAME = "Princeton University"
 TEST_USER_EMAIL = "sbaker@planetstack.org"
diff --git a/xos/tools/ansible_hosts.py b/xos/tools/ansible_hosts.py
index 0cdb809..9ae3e52 100644
--- a/xos/tools/ansible_hosts.py
+++ b/xos/tools/ansible_hosts.py
@@ -14,7 +14,7 @@
 NODES_API = REST_API + "nodes/"
 SITES_API = REST_API + "sites/"
 SLICES_API = REST_API + "slices/"
-SLIVERS_API = REST_API + "sliver/"
+SLIVERS_API = REST_API + "instance/"
 
 def get_nodes_by_site():
     r = requests.get(SITES_API + "?no_hyperlinks=1", auth=opencloud_auth)
@@ -51,16 +51,16 @@
         nodes[str(nodes["id"])] = node
 
     r = requests.get(SLIVERS_API + "?no_hyperlinks=1", auth=opencloud_auth)
-    slivers = r.json()
-    for slivers in nodes:
-        if sliver["node"] not in nodes:
+    instances = r.json()
+    for instances in nodes:
+        if instance["node"] not in nodes:
             continue
-        if sliver["slice"] not in slices:
+        if instance["slice"] not in slices:
             continue
 
-        hostname = nodes[sliver["node"]].name
+        hostname = nodes[instance["node"]].name
 
-        slices[sliver["slice"]]["hostnames"].append(hostname)
+        slices[instance["slice"]]["hostnames"].append(hostname)
 
     return slices
 """
diff --git a/xos/tools/cleanup_unique.py b/xos/tools/cleanup_unique.py
index 92ce599..a637df1 100644
--- a/xos/tools/cleanup_unique.py
+++ b/xos/tools/cleanup_unique.py
@@ -57,7 +57,7 @@
 seen=[]
 for obj in Port.objects.all():
      seen.append(obj.id)
-     conflicts = Port.objects.filter(network=obj.network, sliver=obj.sliver)
+     conflicts = Port.objects.filter(network=obj.network, instance=obj.instanc)
      for conflict in conflicts:
          if conflict.id not in seen:
              print "Purging", conflict, conflict.id, "due to duplicate of", obj.id
diff --git a/xos/tools/get_instance_ip.py b/xos/tools/get_instance_ip.py
index 0e6a456..dd3c788 100644
--- a/xos/tools/get_instance_ip.py
+++ b/xos/tools/get_instance_ip.py
@@ -11,7 +11,7 @@
 
 NODES_API = REST_API + "nodes/"
 SLICES_API = REST_API + "slices/"
-SLIVERS_API = REST_API + "slivers/"
+INSTANCES_API = REST_API + "instances/"
 PORTS_API = REST_API + "ports/"
 
 opencloud_auth=("demo@onlab.us", "demo")
@@ -29,7 +29,7 @@
      print >> sys.stderr, "Error: failed to find node %s" % host_name
      sys.exit(-1)
 
-def get_slivers(slice_id=None, node_id=None):
+def get_instances(slice_id=None, node_id=None):
     queries = []
     if slice_id:
         queries.append("slice=%s" % str(slice_id))
@@ -41,7 +41,7 @@
     else:
         query_string = ""
 
-    r = requests.get(SLIVERS_API + query_string, auth=opencloud_auth)
+    r = requests.get(INSTANCES_API + query_string, auth=opencloud_auth)
     return r.json()
 
 def main():
@@ -60,19 +60,18 @@
 
     slice_id = get_slice_id(slice_name)
     node_id = get_node_id(hostname)
-    slivers = get_slivers(slice_id, node_id)
+    instances = get_instances(slice_id, node_id)
 
     # get (instance_name, ip) pairs for instances with names and ips
 
-    slivers = [x for x in slivers if x["instance_name"]]
-    slivers = sorted(slivers, key = lambda sliver: sliver["instance_name"])
+    instances = [x for x in instances if x["instance_name"]]
+    instances = sorted(instances, key = lambda instance: instance["instance_name"])
 
     # return the last one in the list (i.e. the newest one)
 
-    sliver_id = slivers[-1]["id"]
+    instance_id = instances[-1]["id"]
 
-    r = requests.get(PORTS_API + "?sliver=%s" % sliver_id, auth=opencloud_auth)
-
+    r = requests.get(NETWORKINSTANCES_API + "?instance=%s" % instance_id, auth=opencloud_auth)
     ports = r.json()
     ips = [x["ip"] for x in ports]
 
diff --git a/xos/tools/get_instance_name.py b/xos/tools/get_instance_name.py
index 3450df5..844ba5a 100644
--- a/xos/tools/get_instance_name.py
+++ b/xos/tools/get_instance_name.py
@@ -9,7 +9,7 @@
 
 NODES_API = REST_API + "nodes/"
 SLICES_API = REST_API + "slices/"
-SLIVERS_API = REST_API + "slivers/"
+SLIVERS_API = REST_API + "instances/"
 
 opencloud_auth=("demo@onlab.us", "demo")
 
@@ -26,7 +26,7 @@
      print >> sys.stderr, "Error: failed to find node %s" % host_name
      sys.exit(-1)
 
-def get_slivers(slice_id=None, node_id=None):
+def get_instances(slice_id=None, node_id=None):
     queries = []
     if slice_id:
         queries.append("slice=%s" % str(slice_id))
@@ -57,9 +57,9 @@
 
     slice_id = get_slice_id(slice_name)
     node_id = get_node_id(hostname)
-    slivers = get_slivers(slice_id, node_id)
+    instances = get_instances(slice_id, node_id)
 
-    instance_names = [x["instance_name"] for x in slivers if x["instance_name"]]
+    instance_names = [x["instance_name"] for x in instances if x["instance_name"]]
 
     # return the last one in the list (i.e. the newest one)
 
diff --git a/xos/tools/init-xos.py b/xos/tools/init-xos.py
index 581eb46..433d444 100644
--- a/xos/tools/init-xos.py
+++ b/xos/tools/init-xos.py
@@ -59,6 +59,6 @@
 ServiceClass(name="Best Effort", description="Best Effort").save()
 
 NetworkTemplate(name="Private", description="A private virtual network", visibility="private", translation="none", topology_kind="bigswitch", controller_kind="none").save()
-NetworkTemplate(name="Public shared IPv4", description="Connect a sliver to the public network", visibility="private", translation="NAT", shared_network_name="nat-net", topology_kind="bigswitch", controller_kind="none").save()
-NetworkTemplate(name="Public dedicated IPv4", description="Connect a sliver to the public network", visibility="public", translation="none", shared_network_name="ext-net", topology_kind="bigswitch", controller_kind="none").save()
+NetworkTemplate(name="Public shared IPv4", description="Connect a instance to the public network", visibility="private", translation="NAT", shared_network_name="nat-net", topology_kind="bigswitch", controller_kind="none").save()
+NetworkTemplate(name="Public dedicated IPv4", description="Connect a instance to the public network", visibility="public", translation="none", shared_network_name="ext-net", topology_kind="bigswitch", controller_kind="none").save()
 
diff --git a/xos/tosca/engine.py b/xos/tosca/engine.py
index 3a4aeb2..efce829 100644
--- a/xos/tosca/engine.py
+++ b/xos/tosca/engine.py
@@ -7,7 +7,7 @@
 sys.path.append("/opt/tosca")
 from translator.toscalib.tosca_template import ToscaTemplate
 
-from core.models import Slice,Sliver,User,Flavor,Node,Image
+from core.models import Slice,Instance,User,Flavor,Node,Image
 from nodeselect import XOSNodeSelector
 from imageselect import XOSImageSelector
 
diff --git a/xos/tosca/flavorselect.py b/xos/tosca/flavorselect.py
index 2f40bcf..cab8e56 100644
--- a/xos/tosca/flavorselect.py
+++ b/xos/tosca/flavorselect.py
@@ -1,7 +1,7 @@
 import os
 import sys
 
-from core.models import Slice,Sliver,User,Flavor,Node,Image
+from core.models import Slice,Instance,User,Flavor,Node,Image
 
 class XOSFlavorSelector(object):
     def __init__(self, user, mem_size=None, num_cpus=None, disk_size=None):
diff --git a/xos/tosca/nodeselect.py b/xos/tosca/nodeselect.py
index 11c3c78..24c5b85 100644
--- a/xos/tosca/nodeselect.py
+++ b/xos/tosca/nodeselect.py
@@ -1,7 +1,7 @@
 import os
 import sys
 
-from core.models import Slice,Sliver,User,Flavor,Node,Image
+from core.models import Slice,Instance,User,Flavor,Node,Image
 
 class XOSNodeSelector(object):
     def __init__(self, user, mem_size=None, num_cpus=None, disk_size=None, hostname = None):
diff --git a/xos/tosca/resources/compute.py b/xos/tosca/resources/compute.py
index 2f33ce5..f01a401 100644
--- a/xos/tosca/resources/compute.py
+++ b/xos/tosca/resources/compute.py
@@ -5,7 +5,7 @@
 sys.path.append("/opt/tosca")
 from translator.toscalib.tosca_template import ToscaTemplate
 
-from core.models import Slice,Sliver,User,Flavor,Node,Image
+from core.models import Slice,Instance,User,Flavor,Node,Image
 from nodeselect import XOSNodeSelector
 from imageselect import XOSImageSelector
 from flavorselect import XOSFlavorSelector
@@ -14,7 +14,7 @@
 
 class XOSCompute(XOSResource):
     provides = "tosca.nodes.Compute"
-    xos_model = Sliver
+    xos_model = Instance
 
     def select_compute_node(self, user, v, hostname=None):
         mem_size = v.get_property_value("mem_size")
@@ -50,14 +50,14 @@
         sliceName = self.get_requirement("tosca.relationships.MemberOfSlice", throw_exception=True)
         slice = self.get_xos_object(Slice, name=sliceName)
 
-        # locate it one the same host as some other sliver
+        # locate it one the same host as some other instance
         colocate_host = None
-        colocate_sliver_name = self.get_requirement("tosca.relationships.SameHost")
+        colocate_instance_name = self.get_requirement("tosca.relationships.SameHost")
         if index is not None:
-            colocate_sliver_name = "%s-%d" % (colocate_sliver_name, index)
-        colocate_slivers = Sliver.objects.filter(name=colocate_sliver_name)
-        if colocate_slivers:
-            colocate_host = colocate_slivers[0].node.name
+            colocate_instance_name = "%s-%d" % (colocate_instance_name, index)
+        colocate_instances = Instance.objects.filter(name=colocate_instance_name)
+        if colocate_instances:
+            colocate_host = colocate_instances[0].node.name
             self.info("colocating on %s" % colocate_host)
 
         capabilities = nodetemplate.get_capabilities()
@@ -84,15 +84,14 @@
 
     def create(self, name = None, index = None):
         xos_args = self.get_xos_args(name=name, index=index)
-        sliver = Sliver(**xos_args)
-        sliver.caller = self.user
-        sliver.no_sync = True
-        sliver.save()
+        instance = Instance(**xos_args)
+        instance.caller = self.user
+        instance.no_sync = True
+        instance.save()
+        self.deferred_sync.append(instance)
 
-        self.deferred_sync.append(sliver)
-
-        self.info("Created Sliver '%s' on node '%s' using flavor '%s' and image '%s'" %
-                  (str(sliver), str(sliver.node), str(sliver.flavor), str(sliver.image)))
+        self.info("Created Instance '%s' on node '%s' using flavor '%s' and image '%s'" %
+                  (str(instance), str(instance.node), str(instance.flavor), str(instance.image)))
 
     def create_or_update(self):
         scalable = self.get_scalable()
@@ -100,10 +99,10 @@
             default_instances = scalable.get("default_instances",1)
             for i in range(0, default_instances):
                 name = "%s-%d" % (self.nodetemplate.name, i)
-                existing_slivers = Sliver.objects.filter(name=name)
-                if existing_slivers:
+                existing_instances = Instance.objects.filter(name=name)
+                if existing_instances:
                     self.info("%s %s already exists" % (self.xos_model.__name__, name))
-                    self.update(existing_slivers[0])
+                    self.update(existing_instances[0])
                 else:
                     self.create(name, index=i)
         else:
@@ -112,12 +111,12 @@
     def get_existing_objs(self):
         scalable = self.get_scalable()
         if scalable:
-            existing_slivers = []
+            existing_instances = []
             max_instances = scalable.get("max_instances",1)
             for i in range(0, max_instances):
                 name = "%s-%d" % (self.nodetemplate.name, i)
-                existing_slivers = existing_slivers + list(Sliver.objects.filter(name=name))
-            return existing_slivers
+                existing_instances = existing_instances + list(Instance.objects.filter(name=name))
+            return existing_instances
         else:
             return super(XOSCompute,self).get_existing_objs()
 
diff --git a/xos/tosca/resources/slice.py b/xos/tosca/resources/slice.py
index 5c576be..d9684f2 100644
--- a/xos/tosca/resources/slice.py
+++ b/xos/tosca/resources/slice.py
@@ -60,8 +60,8 @@
         self.info("Created Slice '%s' on Site '%s'" % (str(slice), str(slice.site)))
 
     def delete(self, obj):
-        if obj.slivers.exists():
-            self.info("Slice %s has active slivers; skipping delete" % obj.name)
+        if obj.instances.exists():
+            self.info("Slice %s has active instances; skipping delete" % obj.name)
             return
         super(XOSSlice, self).delete(obj)
 
diff --git a/xos/xos/settings.py b/xos/xos/settings.py
index 96f62e8..ba5ff1d 100644
--- a/xos/xos/settings.py
+++ b/xos/xos/settings.py
@@ -192,7 +192,7 @@
          'auth.group',
          'auth', 
          'core.network',
-         'core.sliver',
+         'core.instance',
          'core.node',
          'core.image',
          'core.deploymentrole',
diff --git a/xos/xos/xosapi.py b/xos/xos/xosapi.py
index 5dd1ce0..f7be27a 100644
--- a/xos/xos/xosapi.py
+++ b/xos/xos/xosapi.py
@@ -75,8 +75,8 @@
         url(r'xos/slice_privileges/$', SlicePrivilegeList.as_view(), name='sliceprivilege-list'),
         url(r'xos/slice_privileges/(?P<pk>[a-zA-Z0-9\-]+)/$', SlicePrivilegeDetail.as_view(), name ='sliceprivilege-detail'),
     
-        url(r'xos/networkslivers/$', NetworkSliverList.as_view(), name='networksliver-list'),
-        url(r'xos/networkslivers/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkSliverDetail.as_view(), name ='networksliver-detail'),
+        url(r'xos/networkinstances/$', NetworkInstanceList.as_view(), name='networkinstance-list'),
+        url(r'xos/networkinstances/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkInstanceDetail.as_view(), name ='networkinstance-detail'),
     
         url(r'xos/flavors/$', FlavorList.as_view(), name='flavor-list'),
         url(r'xos/flavors/(?P<pk>[a-zA-Z0-9\-]+)/$', FlavorDetail.as_view(), name ='flavor-detail'),
@@ -123,8 +123,8 @@
         url(r'xos/slicecredentials/$', SliceCredentialList.as_view(), name='slicecredential-list'),
         url(r'xos/slicecredentials/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceCredentialDetail.as_view(), name ='slicecredential-detail'),
     
-        url(r'xos/slivers/$', SliverList.as_view(), name='sliver-list'),
-        url(r'xos/slivers/(?P<pk>[a-zA-Z0-9\-]+)/$', SliverDetail.as_view(), name ='sliver-detail'),
+        url(r'xos/instances/$', InstanceList.as_view(), name='instance-list'),
+        url(r'xos/instances/(?P<pk>[a-zA-Z0-9\-]+)/$', InstanceDetail.as_view(), name ='instance-detail'),
     
         url(r'xos/nodes/$', NodeList.as_view(), name='node-list'),
         url(r'xos/nodes/(?P<pk>[a-zA-Z0-9\-]+)/$', NodeDetail.as_view(), name ='node-detail'),
@@ -245,7 +245,7 @@
         'tags': reverse('tag-list', request=request, format=format),
         'invoices': reverse('invoice-list', request=request, format=format),
         'sliceprivileges': reverse('sliceprivilege-list', request=request, format=format),
-        'networkslivers': reverse('networksliver-list', request=request, format=format),
+        'networkinstances': reverse('networkinstance-list', request=request, format=format),
         'flavors': reverse('flavor-list', request=request, format=format),
         'controllersites': reverse('controllersite-list', request=request, format=format),
         'projects': reverse('project-list', request=request, format=format),
@@ -261,7 +261,7 @@
         'usableobjects': reverse('usableobject-list', request=request, format=format),
         'providers': reverse('provider-list', request=request, format=format),
         'slicecredentials': reverse('slicecredential-list', request=request, format=format),
-        'slivers': reverse('sliver-list', request=request, format=format),
+        'instances': reverse('instance-list', request=request, format=format),
         'nodes': reverse('node-list', request=request, format=format),
         'dashboardviews': reverse('dashboardview-list', request=request, format=format),
         'controllernetworks': reverse('controllernetwork-list', request=request, format=format),
@@ -791,7 +791,7 @@
 
 
 
-class NetworkSliverSerializer(serializers.HyperlinkedModelSerializer):
+class NetworkInstanceSerializer(serializers.HyperlinkedModelSerializer):
     id = IdField()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
@@ -804,10 +804,10 @@
         except:
             return None
     class Meta:
-        model = NetworkSliver
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','sliver','ip','port_id',)
+        model = NetworkInstance
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
 
-class NetworkSliverIdSerializer(XOSModelSerializer):
+class NetworkInstanceIdSerializer(XOSModelSerializer):
     id = IdField()
     
     humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
@@ -820,8 +820,8 @@
         except:
             return None
     class Meta:
-        model = NetworkSliver
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','sliver','ip','port_id',)
+        model = NetworkInstance
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
 
 
 
@@ -961,7 +961,7 @@
             return None
     class Meta:
         model = Slice
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','enabled','omf_friendly','description','slice_url','site','max_slivers','service','network','serviceClass','creator','default_flavor','default_image','mount_data_sets','networks','networks',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','enabled','omf_friendly','description','slice_url','site','max_instance','service','network','serviceClass','creator','default_flavor','default_image','mount_data_sets','networks','networks',)
 
 class SliceIdSerializer(XOSModelSerializer):
     id = IdField()
@@ -985,8 +985,7 @@
             return None
     class Meta:
         model = Slice
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','enabled','omf_friendly','description','slice_url','site','max_slivers','service','network','serviceClass','creator','default_flavor','default_image','mount_data_sets','networks','networks',)
-
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','enabled','omf_friendly','description','slice_url','site','max_instances','service','network','serviceClass','creator','default_flavor','default_image','mount_data_sets','networks','networks',)
 
 
 
@@ -1002,7 +1001,7 @@
     
     
     
-    slivers = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='sliver-detail')
+    instances = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='instance-detail')
     
     
     
@@ -1024,7 +1023,7 @@
             return None
     class Meta:
         model = Network
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','template','subnet','ports','labels','owner','guaranteed_bandwidth','permit_all_slices','topology_parameters','controller_url','controller_parameters','network_id','router_id','subnet_id','autoconnect','slices','slices','slivers','routers','routers',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','template','subnet','ports','labels','owner','guaranteed_bandwidth','permit_all_slices','topology_parameters','controller_url','controller_parameters','network_id','router_id','subnet_id','autoconnect','slices','slices','instances','routers','routers',)
 
 class NetworkIdSerializer(XOSModelSerializer):
     id = IdField()
@@ -1038,7 +1037,7 @@
     
     
     
-    slivers = serializers.PrimaryKeyRelatedField(many=True,  queryset = Sliver.objects.all())
+    instances = serializers.PrimaryKeyRelatedField(many=True,  queryset = Instance.objects.all())
     
     
     
@@ -1060,7 +1059,7 @@
             return None
     class Meta:
         model = Network
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','template','subnet','ports','labels','owner','guaranteed_bandwidth','permit_all_slices','topology_parameters','controller_url','controller_parameters','network_id','router_id','subnet_id','autoconnect','slices','slices','slivers','routers','routers',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','template','subnet','ports','labels','owner','guaranteed_bandwidth','permit_all_slices','topology_parameters','controller_url','controller_parameters','network_id','router_id','subnet_id','autoconnect','slices','slices','instances','routers','routers',)
 
 
 
@@ -1415,7 +1414,7 @@
 
 
 
-class SliverSerializer(serializers.HyperlinkedModelSerializer):
+class InstanceSerializer(serializers.HyperlinkedModelSerializer):
     id = IdField()
     
     
@@ -1432,10 +1431,15 @@
         except:
             return None
     class Meta:
+<<<<<<< HEAD
+        model = Instance
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
+=======
         model = Sliver
         fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
+>>>>>>> origin/master
 
-class SliverIdSerializer(XOSModelSerializer):
+class InstanceIdSerializer(XOSModelSerializer):
     id = IdField()
     
     
@@ -1452,8 +1456,13 @@
         except:
             return None
     class Meta:
+<<<<<<< HEAD
+        model = Instance
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
+=======
         model = Sliver
         fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
+>>>>>>> origin/master
 
 
 
@@ -1663,7 +1672,7 @@
             return None
     class Meta:
         model = ReservedResource
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','sliver','resource','quantity','reservationSet',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance','resource','quantity','reservationSet',)
 
 class ReservedResourceIdSerializer(XOSModelSerializer):
     id = IdField()
@@ -1679,7 +1688,7 @@
             return None
     class Meta:
         model = ReservedResource
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','sliver','resource','quantity','reservationSet',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance','resource','quantity','reservationSet',)
 
 
 
@@ -1715,6 +1724,7 @@
     class Meta:
         model = NetworkTemplate
         fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','description','guaranteed_bandwidth','visibility','translation','shared_network_name','shared_network_id','topology_kind','controller_kind',)
+>>>>>>> origin/master
 
 
 
@@ -1846,7 +1856,7 @@
             return None
     class Meta:
         model = Port
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','sliver','ip','port_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
 
 class PortIdSerializer(XOSModelSerializer):
     id = IdField()
@@ -1862,7 +1872,7 @@
             return None
     class Meta:
         model = Port
-        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','sliver','ip','port_id',)
+        fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
 
 
 
@@ -2746,7 +2756,7 @@
 
                  SlicePrivilege: SlicePrivilegeSerializer,
 
-                 NetworkSliver: NetworkSliverSerializer,
+                 NetworkInstance: NetworkInstanceSerializer,
 
                  Flavor: FlavorSerializer,
 
@@ -2778,7 +2788,7 @@
 
                  SliceCredential: SliceCredentialSerializer,
 
-                 Sliver: SliverSerializer,
+                 Instance: InstanceSerializer,
 
                  Node: NodeSerializer,
 
@@ -3418,12 +3428,12 @@
 
 
 
-class NetworkSliverList(XOSListCreateAPIView):
-    queryset = NetworkSliver.objects.select_related().all()
-    serializer_class = NetworkSliverSerializer
-    id_serializer_class = NetworkSliverIdSerializer
+class NetworkInstanceList(XOSListCreateAPIView):
+    queryset = NetworkInstance.objects.select_related().all()
+    serializer_class = NetworkInstanceSerializer
+    id_serializer_class = NetworkInstanceIdSerializer
     filter_backends = (filters.DjangoFilterBackend,)
-    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','sliver','ip','port_id',)
+    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
 
     def get_serializer_class(self):
         no_hyperlinks=False
@@ -3437,13 +3447,13 @@
     def get_queryset(self):
         if (not self.request.user.is_authenticated()):
             raise XOSNotAuthenticated()
-        return NetworkSliver.select_by_user(self.request.user)
+        return NetworkInstance.select_by_user(self.request.user)
 
 
-class NetworkSliverDetail(XOSRetrieveUpdateDestroyAPIView):
-    queryset = NetworkSliver.objects.select_related().all()
-    serializer_class = NetworkSliverSerializer
-    id_serializer_class = NetworkSliverIdSerializer
+class NetworkInstanceDetail(XOSRetrieveUpdateDestroyAPIView):
+    queryset = NetworkInstance.objects.select_related().all()
+    serializer_class = NetworkInstanceSerializer
+    id_serializer_class = NetworkInstanceIdSerializer
 
     def get_serializer_class(self):
         no_hyperlinks=False
@@ -3457,7 +3467,7 @@
     def get_queryset(self):
         if (not self.request.user.is_authenticated()):
             raise XOSNotAuthenticated()
-        return NetworkSliver.select_by_user(self.request.user)
+        return NetworkInstance.select_by_user(self.request.user)
 
     # update() is handled by XOSRetrieveUpdateDestroyAPIView
 
@@ -3611,7 +3621,7 @@
     serializer_class = SliceSerializer
     id_serializer_class = SliceIdSerializer
     filter_backends = (filters.DjangoFilterBackend,)
-    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','enabled','omf_friendly','description','slice_url','site','max_slivers','service','network','serviceClass','creator','default_flavor','default_image','mount_data_sets','networks','networks',)
+    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','enabled','omf_friendly','description','slice_url','site','max_instances','service','network','serviceClass','creator','default_flavor','default_image','mount_data_sets','networks','networks',)
 
     def get_serializer_class(self):
         no_hyperlinks=False
@@ -3658,7 +3668,7 @@
     serializer_class = NetworkSerializer
     id_serializer_class = NetworkIdSerializer
     filter_backends = (filters.DjangoFilterBackend,)
-    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','template','subnet','ports','labels','owner','guaranteed_bandwidth','permit_all_slices','topology_parameters','controller_url','controller_parameters','network_id','router_id','subnet_id','autoconnect','slices','slices','slivers','routers','routers',)
+    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','template','subnet','ports','labels','owner','guaranteed_bandwidth','permit_all_slices','topology_parameters','controller_url','controller_parameters','network_id','router_id','subnet_id','autoconnect','slices','slices','instances','routers','routers',)
 
     def get_serializer_class(self):
         no_hyperlinks=False
@@ -4170,10 +4180,10 @@
 
 
 
-class SliverList(XOSListCreateAPIView):
-    queryset = Sliver.objects.select_related().all()
-    serializer_class = SliverSerializer
-    id_serializer_class = SliverIdSerializer
+class InstanceList(XOSListCreateAPIView):
+    queryset = Instance.objects.select_related().all()
+    serializer_class = InstanceSerializer
+    id_serializer_class = InstanceIdSerializer
     filter_backends = (filters.DjangoFilterBackend,)
     filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
 
@@ -4189,13 +4199,13 @@
     def get_queryset(self):
         if (not self.request.user.is_authenticated()):
             raise XOSNotAuthenticated()
-        return Sliver.select_by_user(self.request.user)
+        return Instance.select_by_user(self.request.user)
 
 
-class SliverDetail(XOSRetrieveUpdateDestroyAPIView):
-    queryset = Sliver.objects.select_related().all()
-    serializer_class = SliverSerializer
-    id_serializer_class = SliverIdSerializer
+class InstanceDetail(XOSRetrieveUpdateDestroyAPIView):
+    queryset = Instance.objects.select_related().all()
+    serializer_class = InstanceSerializer
+    id_serializer_class = InstanceIdSerializer
 
     def get_serializer_class(self):
         no_hyperlinks=False
@@ -4209,7 +4219,7 @@
     def get_queryset(self):
         if (not self.request.user.is_authenticated()):
             raise XOSNotAuthenticated()
-        return Sliver.select_by_user(self.request.user)
+        return Instance.select_by_user(self.request.user)
 
     # update() is handled by XOSRetrieveUpdateDestroyAPIView
 
@@ -4457,7 +4467,7 @@
     serializer_class = ReservedResourceSerializer
     id_serializer_class = ReservedResourceIdSerializer
     filter_backends = (filters.DjangoFilterBackend,)
-    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','sliver','resource','quantity','reservationSet',)
+    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance','resource','quantity','reservationSet',)
 
     def get_serializer_class(self):
         no_hyperlinks=False
@@ -4692,7 +4702,7 @@
     serializer_class = PortSerializer
     id_serializer_class = PortIdSerializer
     filter_backends = (filters.DjangoFilterBackend,)
-    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','sliver','ip','port_id',)
+    filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
 
     def get_serializer_class(self):
         no_hyperlinks=False
