Ejemplo n.º 1
0
 def _create_target(self):
     if self.is_local_has_image:
         return
     if not self.has_target:
         LOG.debug("Virtman: start to create target, cache path = %s" %
                   self.cached_path)
         if iscsi.exists(self.iqn):
             self.has_target = True
         else:
             self.target_id = iscsi.create_iscsi_target(self.iqn,
                                                        self.cached_path)
             self.has_target = True
             LOG.debug("Virtman: create target complete, target id = %s" %
                       self.target_id)
Ejemplo n.º 2
0
 def create_target(base_image):
     """
     :type base_image: BlockDeviceBaseImage
     """
     if base_image.is_local_has_image:
         return
     if not base_image.has_target:
         LOG.debug("Virtman: start to create target, cache path = %s" %
                   base_image.cached_path)
         if iscsi.exists(base_image.iqn):
             base_image.has_target = True
         else:
             base_image.target_id = \
                 iscsi.create_iscsi_target(base_image.iqn,
                                           base_image.cached_path)
             base_image.has_target = True
         LOG.debug("Virtman: create target complete, target id = %s" %
                   base_image.target_id)