(self, quota=DEFAULT_QUOTA)
Create and mount storage for the given project.
Create and mount storage for the given project.
Create and mount storage for the given project .
def create(self, quota=DEFAULT_QUOTA):
        """
        Create and mount storage for the given project.
        """
        log = self._log("create")
        if len(optimal_stream_sequence(self.streams())) > 0:
            self.import_pool()
            return
        log("create new sparse zvol POOL/zvols/project_id (error if it exists already)")
        cmd("sudo /sbin/zfs create -V %s -s %s"%(quota, self.zvol_fs))
        cmd("sudo /sbin/zfs set sync=disabled %s"%self.zvol_fs)  # CRITICAL to set sync=disabled -- or it is a million times slower
        log("create a pool on the zvol")
        cmd("sudo /sbin/zpool create %s -m '%s' %s"%(self.project_pool, self.project_mnt, self.zvol_dev))
        cmd("sudo /sbin/zfs set compression=lz4 %s"%self.project_pool)
        cmd("sudo /sbin/zfs set dedup=off %s"%self.project_pool)  # dedup (even locally) may be evil!
        cmd("sudo /bin/chown %s:%s %s"%(self.uid, self.uid, self.project_mnt))
        cmd("sudo /bin/chmod og-rwx %s"%self.project_mnt)
def create ( self , quota = DEFAULT_QUOTA ) : log = self . _log ( "create" ) if len ( optimal_stream_sequence ( self . streams ( ) ) ) > 0 : self . import_pool ( ) return log ( "create new sparse zvol POOL/zvols/project_id (error if it exists already)" ) cmd ( "sudo /sbin/zfs create -V %s -s %s" % ( quota , self . zvol_fs ) ) cmd ( "sudo /sbin/zfs set sync=disabled %s" % self . zvol_fs ) # CRITICAL to set sync=disabled -- or it is a million times slower log ( "create a pool on the zvol" ) cmd ( "sudo /sbin/zpool create %s -m '%s' %s" % ( self . project_pool , self . project_mnt , self . zvol_dev ) ) cmd ( "sudo /sbin/zfs set compression=lz4 %s" % self . project_pool ) cmd ( "sudo /sbin/zfs set dedup=off %s" % self . project_pool ) # dedup (even locally) may be evil! cmd ( "sudo /bin/chown %s:%s %s" % ( self . uid , self . uid , self . project_mnt ) ) cmd ( "sudo /bin/chmod og-rwx %s" % self . project_mnt )