Exemplo n.º 1
0
 def _create_snapshot(self, origin_path):
     if self.snapshot_with_cache:
         snap_path = self._create_cache()
     else:
         snap_path = self.snapshot_dev
     snapshot_name = self.snapshot_name
     snapshot_path = dmsetup.snapshot(origin_path, snapshot_name, snap_path)
     self._final_path = snapshot_path
     return snapshot_path
Exemplo n.º 2
0
 def create(self):
     LOG.debug("VMThunder: start VM instance %s according origin_path %s" %(self.instance_name, self.origin_path))
     snapshot_path, self.snapshot_link = self.snapshot.create_snapshot()
     self.instance_path = dmsetup.snapshot(self.origin_path, self.snapshot_name, snapshot_path)
     #change link for OpenStack
     commands.unlink(self.snapshot_link)
     if not os.path.exists(self.snapshot_link):
         commands.link(self.instance_path, self.snapshot_link)
     LOG.debug("VMThunder: success! snapshot_link = %s" % self.snapshot_link)
     return self.snapshot_link
Exemplo n.º 3
0
 def create(self):
     LOG.debug("VMThunder: start VM instance %s according origin_path %s" %(self.instance_name, self.origin_path))
     snapshot_path = self.snapshot.create_snapshot()
     self.instance_path = dmsetup.snapshot(self.origin_path, self.snapshot_name, snapshot_path)
     LOG.debug("VMThunder: success! instance_path = %s" % self.instance_path)
     return self.instance_path
Exemplo n.º 4
0
 def _create_snapshot(self, origin_path):
     snapshot_name = self._snapshot_name()
     snapshot_path = dmsetup.snapshot(origin_path, snapshot_name, self.snapshot_dev)
     self.snapshot_path = snapshot_path
     return snapshot_path
Exemplo n.º 5
0
 def _create_snapshot(self, origin_path):
     cached_path = self._create_cache()
     snapshot_name = self._snapshot_name()
     snapshot_path = dmsetup.snapshot(origin_path, snapshot_name, cached_path)
     self.snapshot_path = snapshot_path
     return snapshot_path