diff --git a/xos/core/admin.py b/xos/core/admin.py
index c52bd17..efd1058 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -1691,7 +1691,7 @@
     readonly_fields = ('backend_status_icon', )
 
 class NetworkSliversInline(XOSTabularInline):
-    fields = ['backend_status_icon', 'network','sliver','ip']
+    fields = ['backend_status_icon', 'network', 'sliver', 'ip', 'reserve']
     readonly_fields = ("backend_status_icon", "ip", )
     model = NetworkSliver
     selflink_fieldname = "sliver"
diff --git a/xos/core/models/network.py b/xos/core/models/network.py
index ae70d2e..57049e9 100644
--- a/xos/core/models/network.py
+++ b/xos/core/models/network.py
@@ -206,21 +206,26 @@
 
 class NetworkSliver(PlCoreBase):
     network = models.ForeignKey(Network,related_name='networkslivers')
-    sliver = models.ForeignKey(Sliver,related_name='networkslivers')
+    sliver = models.ForeignKey(Sliver, null=True, blank=True, related_name='networkslivers')
     ip = models.GenericIPAddressField(help_text="Sliver ip address", blank=True, null=True)
     port_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum port id")
+    reserve = models.BooleanField(default=False, help_text="Reserve this port for future use")
 
     class Meta:
         unique_together = ('network', 'sliver')
 
     def save(self, *args, **kwds):
-        slice = self.sliver.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
-            #   3) network's permitAllSlices is true
-            raise ValueError("Slice %s is not allowed to connect to network %s" % (str(slice), str(self.network)))
+        if self.sliver:
+            slice = self.sliver.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
+                #   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.sliver) and (not self.reserve):
+            raise ValueError("If NetworkSliver.sliver is false, then NetworkSliver.reserved must be set to True")
 
         if (not self.ip) and (NO_OBSERVER):
             from util.network_subnet_allocator import find_unused_address
@@ -228,10 +233,18 @@
                                           [x.ip for x in self.network.networksliver_set.all()])
         super(NetworkSliver, self).save(*args, **kwds)
 
-    def __unicode__(self):  return u'%s-%s' % (self.network.name, self.sliver.instance_name)
+    def __unicode__(self):
+        if self.sliver:
+            return u'%s-%s' % (self.network.name, self.sliver.instance_name)
+        else:
+            return u'%s-reserved-%s' % (self.network.name, self.id)
 
     def can_update(self, user):
-        return user.can_update_slice(self.sliver.slice)
+        if self.sliver:
+            return user.can_update_slice(self.sliver.slice)
+        if self.network:
+            return user.can_update_slice(self.network.owner)
+        return False
 
     @staticmethod
     def select_by_user(user):
