logger.verbose('sliver_vs: %s: create'%name)
vref = rec['vref']
if vref is None:
- logger.log("sliver_vs: %s: ERROR - no vref attached, this is unexpected"%(name))
# added by caglar
# band-aid for short period as old API doesn't have GetSliceFamily function
- #return
vref = "planetlab-f8-i386"
+ logger.log("sliver_vs: %s: ERROR - no vref attached, using hard-wired default %s"%(name,vref))
# used to look in /etc/planetlab/family,
# now relies on the 'GetSliceFamily' extra attribute in GetSlivers()
logger.log ("sliver_vs: %s: ERROR Could not create sliver - vreference image %s not found"%(name,vref))
return
- # guess arch
+ # compute guest personality
try:
(x,y,arch)=vref.split('-')
# mh, this of course applies when 'vref' is e.g. 'netflow'
except:
arch='i386'
- def personality (arch):
- personality="linux32"
- if arch.find("64")>=0:
- personality="linux64"
- return personality
+ def personality (arch): return "linux64" if arch.find("64") >=0 else "linux32"
command=[]
# be verbose
self.set_resources()
# do the configure part from Initscript
- Initscript.configure(self,rec)
-
- Account.configure(self, rec) # install ssh keys
-
+ # i.e. install slice initscript if defined
+ Initscript.configure(self, rec)
+ # install ssh keys
+ Account.configure(self, rec)
+
+ # remember configure() always gets called *before* start()
+ # in particular the slice initscript
+ # is expected to be in place already at this point
def start(self, delay=0):
if self.rspec['enabled'] <= 0:
logger.log('sliver_vs: not starting %s, is not enabled'%self.name)
# expose .ssh for omf_friendly slivers
if 'omf_control' in self.rspec['tags']:
Account.mount_ssh_dir(self.name)
- # if a change has occured in the slice initscript, reflect this in /etc/init.d/vinit.slice
- self.refresh_slice_vinit()
child_pid = os.fork()
if child_pid == 0:
# VServer.start calls fork() internally,