vod experiment files
[nepi.git] / src / nepi / resources / omf / wilabt_node.py
index eecbe45..0918c3f 100644 (file)
@@ -71,8 +71,8 @@ class WilabtSfaNode(OMFNode):
         host = Attribute("host", "Name of the physical machine",
                 flags = Flags.Design)
 
-        #disk_image = Attribute("disk_image", "Specify a specific disk image for a node",
-        #        flags = Flags.Design)
+        disk_image = Attribute("disk_image", "Specify a specific disk image for a node",
+                flags = Flags.Design)
         
         cls._register_attribute(username)
         cls._register_attribute(identity)
@@ -83,7 +83,7 @@ class WilabtSfaNode(OMFNode):
         cls._register_attribute(gateway_user)
         cls._register_attribute(gateway)
         cls._register_attribute(host)
-        #cls._register_attribute(disk_image)
+        cls._register_attribute(disk_image)
 
     def __init__(self, ec, guid):
         super(WilabtSfaNode, self).__init__(ec, guid)
@@ -130,10 +130,6 @@ class WilabtSfaNode(OMFNode):
         Based on the attributes defined by the user, discover the suitable 
         node for provision.
         """
-        if self._skip_provision():
-            super(WilabtSfaNode, self).do_discover()
-            return
-
         nodes = self.sfaapi.get_resources_hrn()
 
         host = self._get_host()
@@ -159,10 +155,6 @@ class WilabtSfaNode(OMFNode):
         Add node to user's slice and verifing that the node is functioning
         correctly. Check ssh, omf rc running, hostname, file system.
         """
-        if self._skip_provision():
-            super(WilabtSfaNode, self).do_provision()
-            return
-
         provision_ok = False
         ssh_ok = False
         proc_ok = False
@@ -170,10 +162,10 @@ class WilabtSfaNode(OMFNode):
 
         while not provision_ok:
             node = self._node_to_provision
-            if self._slicenode:
-                self._delete_from_slice()
-                self.debug("Waiting 300 sec for re-adding to slice")
-                time.sleep(300) # Timout for the testbed to allow a new reservation
+            #if self._slicenode:
+            #    self._delete_from_slice()
+            #    self.debug("Waiting 480 sec for re-adding to slice")
+            #    time.sleep(480) # Timout for the testbed to allow a new reservation
             self._add_node_to_slice(node)
             t = 0
             while not self._check_if_in_slice([node]) and t < timeout \
@@ -368,11 +360,11 @@ class WilabtSfaNode(OMFNode):
         """
         self.info(" Adding node to slice ")
         slicename = self.get("slicename")
-        #disk_image = self.get("disk_image")
-        #if disk_image is not None:
-        #    properties = {'disk_image': disk_image}
-        #else: properties = None
-        properties = None
+        disk_image = self.get("disk_image")
+        if disk_image is not None:
+            properties = {'disk_image': disk_image}
+        else: properties = None
+        #properties = None
         self.sfaapi.add_resource_to_slice_batch(slicename, host_hrn, properties=properties)
 
     def _delete_from_slice(self):