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..942be9a 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),
@@ -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,
+            'slivers': 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
