[Planetlab-devel] initscripts

Thierry Parmentelat thierry.parmentelat at sophia.inria.fr
Thu Dec 20 11:46:13 EST 2007


Hi Fayaiz, and all

We're still having problems with this initscript thing

Here is the situation, as reported by Amine
==
I start with a new Myplc based on the last build:
http://build.one-lab.org/planetlab/2007.12.20--planetlab-f7-linux32/
that contains nodemanager from the svn trunk

I associated an Initscript to a slice(with the id returned by the db  
when I added the initscript)
then locally in the node I restarted the NM , but nothing happens.

My understanding reading the code is that, when the sm.py calls  
GetSlivers(),
the nodemanager looks for a slice attribute named "plc_initscript_id",  
while we naively use the predefined one simply named 'initscript', and  
so our db contains something like this
{'instantiation': u'plc-instantiated', 'name': u'Slice_Name',  
'slice_id': *, 'keys': [], 'expires': 1199363409L, 'attributes':  
[{'name': u'initscript', 'value': u'*'}
                                                                                                                                                                                                       ****
So based on this part of the sm.py code:
******************
for sliver in data['slivers']:
    logger.verbose("sm:GetSlivers in slivers loop")
   .....
   ........
   .........

   rec.setdefault('vref', attr_dict.get('vref', 'default'))
   is_id = attr_dict.get('plc_initscript_id')
   if is_id is not None and is_id in initscripts_by_id:
        rec['initscript'] = initscripts_by_id[is_id]
   else:
    rec['initscript'] = '' "
************
the rec['initscript'] that gets passed to the sliver_vs.py class,
will be empty..

==

I haven't run the code myself, but if the above is correct, we would  
advocate to either
(a) change the predefined slice attribute name to what is expected by  
the nm so that the system works
(b) or change the node manager code to use the predefined name instead
I guess there are implications in terms of legacy that need be taken  
into account.
In any case, it would of course make sense to add the feature that  
we've discussed already, since an initscript name would probably be a  
preferred method for slices to refer to initscripts. To this respect,  
we could simply check whether the value attached to the slice  
attribute is an integer or not, and react accordingly.

We'd appreciate to hear your comments on this matter

Thanks - Thierry
==
PS. fyi - we've started to add a unit test about this in our system  
test suite.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.planet-lab.org/pipermail/devel/attachments/20071220/374322dd/attachment.html


More information about the Devel mailing list