User Tools

Site Tools


soft:server-apps-slices

Slices application

Manage Slices and their Slivers.

Settings

Template settings

  • SLICES_TEMPLATE_TYPES set of tuples (value, verbose name) with available template types, by default: (
    ('debian', 'Debian'),
    ('openwrt', 'OpenWRT'),)
  • SLICES_TEMPLATE_TYPE_DFLT the default template type, 'debian' by default
  • SLICES_TEMPLATE_ARCHS available template architectures, default value: (
    ('amd64', 'amd64'),
    ('x86', 'x86'),)
  • SLICES_TEMPLATE_ARCH_DFLT default template architecture, 'x86' by default
  • SLICES_TEMPLATE_IMAGE_DIR template dir relative to MEDIA_DIR, by default 'templates'
  • SLICES_TEMPLATE_IMAGE_NAME template file name (file renamed on update), by default ' ' (keep file name).
  • SLICES_TEMPLATE_IMAGE_EXTENSIONS list of file extensions accepted as template image, by default ('.tar.gz', '.tgz')

Slice settings

  • SLICES_SLICE_EXP_INTERVAL time interval for slice expiration renewal, 30 days by default: timedelta(30).
  • SLICES_SLICE_EXP_WARN time interval relative to warn the users before slice expiration, 4 days by default: timedelta(4).
  • SLICES_DISABLED_SLIVER_IFACES list of disabled sliver ifaces. i.e. ['management', 'public4'], empty by default []
  • SLICES_SLICE_OVERLAY_DIR slice overlay dir relative to MEDIA_DIR, by default 'overlay'.
  • SLICES_SLICE_OVERLAY_NAME slice overlay file name, by default 'slice-%(pk)d-%(original)s'.
  • SLICES_SLICE_EXP_DATA_DIR experiment data dir relative to MEDIA_DIR, by default 'exp_data/'.
  • SLICES_SLICE_EXP_DATA_NAME slice experiment data file name, by default 'slice-%(pk)d-%(original)s'.

Sliver settings

  • SLICES_SLIVER_OVERLAY_DIR sliver overlay dir relative to MEDIA_DIR, by default 'overlay'.
  • SLICES_SLIVER_OVERLAY_NAME sliver overlay file name, by default 'sliver-%(pk)d-%(original)s'.
  • SLICES_SLIVER_EXP_DATA_DIR experiment data dir relative to MEDIA_DIR, by default 'exp_data/'.
  • SLICES_SLIVER_EXP_DATA_NAME sliver experiment data file name, by default 'sliver-%(pk)d-%(original)s'.
  • SLICES_SLIVER_OVERLAY_EXTENSIONS sliver overlay accepted file extensions, by default ('.tar.gz', '.tgz'))

Actions

  1. Slice renew it update the expiration date now + settings.SLICE_EXPIRATION_INTERVAL. Is intentionally non accumulative in order to prevent abuses.
  2. Slice reset
  3. Sliver reset

Workflow

1. Slice Creation

  1. User visit Slice change list
  2. User click on +Add slice
  3. User fill the add form and click on save and continue edditing
  4. Once the Slice is created a new button for adding slivers appears on top of the page. user clicks it
  5. A list of available nodes is presented (nodes with already slivers of this slice on it doesn't appear). User choose one.
    • Alternative instead of a list the nodes could be presented in an interactive map.
  6. User fill the sliver add forms providing a description and the interfaces he wants
  7. User click on save and it is redirected to Slice change form
  8. User can continue adding slivers until no more nodes are available.

2. Sliver Creation

Sliver Ifaces

The pattern for providing sliver network interfaces is the following:

  1. Create an ifaces.py file under your application directory
  2. Define your app specific ifaces, with specific behavior, like for example MgmtIface provided by tinc:
    class MgmtIface(BaseIface):
        def clean(self, iface):
            if not iface.parent:
                raise ValidationError("Parent is mandatory for isolated interfaces.")
        
        def ipv6_addr(self, iface):
            """ MGMT_IPV6_PREFIX:N:10ii:ssss:ssss:ssss/64 """
            # Hex representation of the needed values
            nr = '10' + int_to_hex_str(iface.nr, 2)
            node_id = int_to_hex_str(iface.sliver.node_id, 4)
            slice_id = int_to_hex_str(iface.sliver.slice_id, 12)
            ipv6_words = TINC_MGMT_IPV6_PREFIX.split(':')[:3]
            ipv6_words.extend([node_id, nr])
            ipv6_words.extend(split_len(slice_id, 4))
            return IP(':'.join(ipv6_words))
  3. Register the iface:
    Sliver.register_iface(MgmtIface, 'management')

The SliverIface methods available for Iface definition customization are:

  • clean(iface)
  • ipv6_addr(iface)
  • ip64_addr(iface)
  • _get_nr(iface)

See more examples on slices/ifaces.py

soft/server-apps-slices.txt · Last modified: 2014/06/02 13:58 by santiago