first quick&dirty implementation:
(*) if SLICE_PREFIX is the default 'pl' then the two legacy slices are created
(*) otherwise they are not, and even deleted in case they were present
this because the myplc doc instructs to perform a first run before configuring
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
+# $Id: db-config,v 1.10 2006/11/28 21:45:53 mlhuang Exp $
#
from plc_config import PLCConfiguration
#
from plc_config import PLCConfiguration
plc_ticket_pubkey = '%KEY%'
# Create/update system slices
plc_ticket_pubkey = '%KEY%'
# Create/update system slices
# XXX Required for old Node Manager
{'name': "pl_conf",
'description': "PlanetLab Slice Creation Service (SCS)",
# XXX Required for old Node Manager
{'name': "pl_conf",
'description': "PlanetLab Slice Creation Service (SCS)",
'attributes': [('cpu_share', "32"),
('plc_slice_type', "VServerSlice"),
('disk_max', "5000000")]},
'attributes': [('cpu_share', "32"),
('plc_slice_type', "VServerSlice"),
('disk_max', "5000000")]},
# PlanetFlow
{'name': plc['slice_prefix'] + "_netflow",
'description': "PlanetFlow Traffic Auditing Service",
# PlanetFlow
{'name': plc['slice_prefix'] + "_netflow",
'description': "PlanetFlow Traffic Auditing Service",
('proper_op', "bind_socket")]},
]
('proper_op', "bind_socket")]},
]
+ ### leaving slice_prefix to default
+ if plc['slice_prefix'] == 'pl':
+ # create them with default slices
+ default_slices += legacy_slices
+ else:
+ # we use another slice prefix : disable legacy slices if already created
+ for legacy_slice in legacy_slices:
+ try:
+ DeleteSlice(legacy_slice['name'])
+ except:
+ pass
+
for default_slice in default_slices:
slices = GetSlices([default_slice['name']])
if slices:
for default_slice in default_slices:
slices = GetSlices([default_slice['name']])
if slices: