Exemplo n.º 1
0
    def create_clones(self, task):
        # Set up ZFS and Target management
        zfs = ZFS()
        mgr = TargetManager()
        num_created = 0

        task.set_status_start_creating_clones()

        for arg in task.details['clones']:
            self.create_clone(zfs, arg)
            task.increment_num_clones()

        task.set_status_done_creating_clones()

        # Give udevd a chance to settle down and create associated devices
        task.set_status_start_waiting_udevd()
        zfs.udevd_settle_down()
        task.set_status_done_waiting_udevd()

        task.set_status_start_creating_targets()

        for arg in task.details['clones']:
            self.create_target(mgr, arg)
            task.increment_num_targets()
            task.increment_num_completed()

        task.set_status_done_creating_targets()
        mgr.save()
Exemplo n.º 2
0
    def create_clones(self, task):
        # Set up ZFS and Target management
        zfs = ZFS()
        mgr = TargetManager()
        num_created = 0

        task.set_status_start_creating_clones()

        for arg in task.details['clones']:
            self.create_clone(zfs, arg)
            task.increment_num_clones()

        task.set_status_done_creating_clones()

        # Give udevd a chance to settle down and create associated devices
        task.set_status_start_waiting_udevd()
        zfs.udevd_settle_down()
        task.set_status_done_waiting_udevd()

        task.set_status_start_creating_targets()

        for arg in task.details['clones']:
            self.create_target(mgr, arg)
            task.increment_num_targets()
            task.increment_num_completed()

        task.set_status_done_creating_targets()
        mgr.save()
Exemplo n.º 3
0
 def delete(self):
     try:
         zfs = ZFS()
         args = self.deleteParser.parse_args()
         self.deleteHandler(args)
     except (TypeError, ValueError, CommandError), e:
         return {'status': str(e)}, 501
Exemplo n.º 4
0
    def delete_clones(self, task):
        # Set up ZFS and Target management
        zfs = ZFS()
        mgr = TargetManager()

        task.set_status_start_deleting_targets()

        for arg in task.details['clones']:
            self.remove_target(mgr, arg)
            task.increment_num_clones()

        task.set_status_done_deleting_targets()

        task.set_status_start_deleting_clones()

        for arg in task.details['clones']:
            self.remove_clone(task, zfs, arg)
            task.increment_num_targets()
            task.increment_num_completed()

        task.set_status_done_deleting_clones()
        mgr.save()
Exemplo n.º 5
0
 def deleteHandler(self, args):
     zfs = ZFS()
     zfs.destroy(args)
Exemplo n.º 6
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.create(args)
Exemplo n.º 7
0
 def get(self):
     zfs = ZFS()
     return jsonify(zfs.attributes)
Exemplo n.º 8
0
 def get(self):
     zfs = ZFS()
     return jsonify(zfs.filesystems)
Exemplo n.º 9
0
 def get(self):
     zfs = ZFS()
     return jsonify(zfs.volumes)
Exemplo n.º 10
0
 def get(self):
     zfs = ZFS()
     return jsonify(zfs.snapshots)
Exemplo n.º 11
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.clone(args)
Exemplo n.º 12
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.snapshot(args)
Exemplo n.º 13
0
 def deleteHandler(self, args):
     zfs = ZFS()
     zfs.destroy(args)
Exemplo n.º 14
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.create(args)
Exemplo n.º 15
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.clone(args)
Exemplo n.º 16
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.snapshot(args)