Relevant to Bug # 134638. Simple, very limited addition to allow striped Logical Volumes. Can't choose the number of stripes nor the size of the stripes yet. Working on it. The diffs are attached. Regards. Joel
--- fsset.py-JG 2007-02-15 20:23:09.000000000 +0100 +++ fsset.py 2006-09-27 23:16:56.000000000 +0200 @@ -2279,7 +2279,7 @@
class LogicalVolumeDevice(Device): # note that size is in megabytes! - def __init__(self, vgname, size, lvname, vg, existing = 0, striped=0 ): + def __init__(self, vgname, size, lvname, vg, existing = 0): Device.__init__(self) self.vgname = vgname self.size = size @@ -2288,7 +2288,6 @@ self.isSetup = existing self.doLabel = None self.vg = vg - self.striped = striped
# these are attributes we might want to expose. or maybe not. # self.chunksize @@ -2297,14 +2296,8 @@ # self.extents # self.readaheadsectors
- def setStriped(self, value): - self.striped = value - - def isStriped(self): - return self.striped - def setupDevice(self, chroot="/", devPrefix='/tmp', vgdevice = None): - if not self.isSetup and not self.isStriped(): + if not self.isSetup: lvm.writeForceConf() rc = iutil.execWithRedirect("lvm", ["lvcreate", "-L", @@ -2320,26 +2313,7 @@ self.isSetup = 1
if vgdevice and vgdevice.isNetdev(): self.setAsNetdev() - elif not self.isSetup: - lvm.writeForceConf() - numDevices = len(self.vg.dev.physicalVolumes) - rc = iutil.execWithRedirect("lvm", - ["lvcreate", - "-i%d" % (numDevices,), - "-I4", # The default size of the strips for now - "-L", "%dM" % (self.size,), - "-n", self.name, "-An", - self.vgname], - stdout = "/tmp/lvmout", - stderr = "/tmp/lvmout", - searchPath = 1) - if rc: - raise SystemError, "Striped lvcreate failed for %s" %(self.name,) - lvm.unlinkConf() - self.isSetup = 1
- if vgdevice and vgdevice.isNetdev(): self.setAsNetdev() - return "/dev/%s" % (self.getDevice(),)
def getDevice(self, asBoot = 0):
--- lvm_dialog_gui.py-JG 2007-02-15 19:36:54.000000000 +0100 +++ lvm_dialog_gui.py 2006-07-21 20:51:56.000000000 +0200 @@ -364,15 +364,6 @@ (model, iter) = selection.get_selected() return iter
- def toggleStripButton(self, button, args): - # When the strip button is toggled we must modify Entry - # We use `not` because we recive the state of the button after its toggled - entry, totalSize = args - if not button.get_active(): - entry.set_editable(True) - else: - entry.set_text("%s" % (totalSize,)) - entry.set_editable(False)
def editLogicalVolume(self, logrequest, isNew = 0): if isNew: @@ -462,48 +453,6 @@ row += 1
if not logrequest or not logrequest.getPreExisting(): - stripCombo = gtk.CheckButton(label="Striped", use_underline=True) - stripCombo.connect("toggled", self.toggleStripButton , (sizeEntry,logrequest.getActualSize(self.partitions, self.diskset) ) ) - pesize = int(self.peCombo.get_active_value()) - (tspace, uspace, fspace) = self.computeSpaceValues(usepe=pesize) - NSPV = len(self.getSelectedPhysicalVolumes(self.lvmlist.get_model())) # Number os Selected Physical Volumes - if NSPV < 2: - # Not enough available lvm partitions - stripCombo.set_active(False) - stripCombo.set_sensitive(False) - sizeEntry.set_editable(True) - elif len(self.logvolreqs) == 0: - # There are no previous requests. - stripCombo.set_active(False) - stripCombo.set_sensitive(True) - sizeEntry.set_editable(True) - elif len(self.logvolreqs) == 1 and fspace != 0: - # It is adding a new logvol and one already exists - stripCombo.set_active(False) - stripCombo.set_sensitive(False) - sizeEntry.set_editable(True) - logrequest.setStriped(False) - elif len(self.logvolreqs) == 1 and fspace == 0: - # We can have a striped or non striped volume - # Just set the value to that of the logrequest. - stripCombo.set_active(logrequest.isStriped()) - sizeEntry.set_editable(not logrequest.isStriped()) - elif len(self.logvolreqs) > 1 : - # We got more than 1 logvol - stripCombo.set_active(False) - stripCombo.set_sensitive(False) # Non editable - sizeEntry.set_editable(True) - else: - # Negative logvols. raise error - pass - maintable.attach(lbl, 0, 1, row, row+1) - maintable.attach(stripCombo, 1,2,row, row+1) - row += 1 - else: - stripCombo = gtk.CheckButton(label="Striped") - stripCombo.set_active(False) - - if not logrequest or not logrequest.getPreExisting(): pesize = int(self.peCombo.get_active_value()) (tspace, uspace, fspace) = self.computeSpaceValues(usepe=pesize) maxlv = min(lvm.getMaxLVSize(pesize), fspace) @@ -727,17 +676,6 @@ "or make the logical volume(s) smaller.") % (neededSpaceMB, availSpaceMB), custom_icon="error") del tmplogreqs continue - if stripCombo.get_active(): - # We check that there is at least two physical volumes. - if len(self.getSelectedPhysicalVolumes(self.lvmlist.get_model())) < 2: - self.initf.messageWindow(_("Invalid Device Count"), - _("To used the lvm striped functionality you " - "must have more than one physical volume " - "defined for the Volume Group."), custom_icon="error" ) - request.setStriped(1) - else: - request.setStriped(0) -
# everything ok break
--- partRequests.py-JG 2007-02-15 20:06:12.000000000 +0100 +++ partRequests.py 2006-08-18 16:26:38.000000000 +0200 @@ -812,7 +812,7 @@ def __init__(self, fstype, format = None, mountpoint = None, size = None, volgroup = None, lvname = None, preexist = 0, percent = None, grow=0, maxSizeMB=0, - bytesPerInode = 4096, fslabel = None, striped=0): + bytesPerInode = 4096, fslabel = None): """Create a new VolumeGroupRequestSpec object.
fstype is the fsset filesystem type. @@ -827,7 +827,6 @@ maxSizeMB is max size to grow to. bytesPerInode is the size of the inodes on the partition. fslabel is the label of the filesystem on the logical volume. - striped - If the requested logical volume is striped or not. """
# if it's preexisting, the original fstype should be set @@ -854,7 +853,6 @@ self.grow = grow self.maxSizeMB = maxSizeMB self.startSize = size - self.striped = striped if not percent and not size and not preexist: raise RuntimeError, "Error with Volume Group:Logical Volume %s:%s - Logical Volume must specify either percentage of vgsize or size" % (volgroup, lvname) @@ -877,13 +875,12 @@ str = ("LV Request -- mountpoint: %(mount)s uniqueID: %(id)s\n" " type: %(fstype)s format: %(format)s badblocks: %(bb)s\n" " size: %(size)s lvname: %(lvname)s volgroup: %(vgid)s\n" - " bytesPerInode: %(bytesPerInode)s options: '%(fsopts)s'\n" - " striped: %(striped) " % + " bytesPerInode: %(bytesPerInode)s options: '%(fsopts)s'" % {"mount": self.mountpoint, "id": self.uniqueID, "fstype": fsname, "format": self.format, "bb": self.badblocks, "lvname": self.logicalVolumeName, "vgid": self.volumeGroup, "size": size, "bytesPerInode": self.bytesPerInode, - "fsopts": self.fsopts, "striped": self.striped}) + "fsopts": self.fsopts}) return str
def getDevice(self, partitions): @@ -893,8 +890,7 @@ self.dev = fsset.LogicalVolumeDevice(vgname, self.size, self.logicalVolumeName, vg = vg, - existing = self.preexist, - striped = self.striped) + existing = self.preexist) return self.dev
def getActualSize(self, partitions, diskset): @@ -929,9 +925,3 @@ "group's physical extent size.")
return RequestSpec.sanityCheckRequest(self, partitions, skipMntPtExistCheck) - - def setStriped(self, value): - self.striped = value - - def isStriped(self): - return self.striped
Yesterday Joel Andres Granados said:
Relevant to Bug # 134638. Simple, very limited addition to allow striped Logical Volumes. Can't choose the number of stripes nor the size of the stripes yet. Working on it. The diffs are attached.
Thank you! It's a start. I've marked RFE bug #223673 as a dupe.
A question, since your patch doesn't show up in rawhide yet... What is the quickest and most painless way to roll a test netstg2 nowadays? Do these old crib notes http://www.Doty.org/blog/curtis/2006#hacking-anaconda still apply or is there a more modern way that doesn't require mounting a loop?
../C
Curtis Doty wrote:
Yesterday Joel Andres Granados said:
Relevant to Bug # 134638. Simple, very limited addition to allow striped Logical Volumes. Can't choose the number of stripes nor the size of the stripes yet. Working on it. The diffs are attached.
Thank you! It's a start. I've marked RFE bug #223673 as a dupe.
A question, since your patch doesn't show up in rawhide yet... What is the quickest and most painless way to roll a test netstg2 nowadays? Do these old crib notes http://www.Doty.org/blog/curtis/2006#hacking-anaconda still apply or is there a more modern way that doesn't require mounting a loop?
../C
Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list
There are two methods to include any python patch to the anaconda installer. You can make an updates.img image with the patches and place it somewhere in the installation tree or you can create a RHupdates directory and place it somewhere in the installation tree. The exact place to put it may vary but you can look in anacondas docs (/usr/share/doc/anaconda-#.#.#.#/install-methods.txt) to see where to put it. I use the image method with a script to do all the dirty work. I use `sudo` in the script because I have to access a shared installation tree and need to be root to write any changes, but if you have a different setup in your office you can change it. I've used it for fc6 and rawhide and it works fine.
Regards
#!/bin/bash
# This scrit is used to change the updates.img images in the anaconda installer.
use() { echo If there is an images in the directory with the same name, it will be erased. echo The correct way to use uploadfilesCramfs is: echo uploadfilesCramfs /Destination/Path/NameOfImage file1 file2 file3 ... }
if [ $# -lt 2 ];then use exit 0 fi
IMAGE_PATH=$1 TMP_DIR=/tmp/CramfsTEMP shift j=0 for i in $* do FILES[$j]=$i j+=1 done
# Lets erease the previous output file echo If you do not erease the previous image the result may vary. echo For the mkfs.cramfs and rm command to be executed the current user $(whoami) echo Must be on the sudoes file. just add "$(whoami) ALL=/sbin/mkfs.cramfs" echo and "$(whoami) All=/bin/rm" to the sudoer file. echo To edit the sudoer file exec visudo as root. sudo rm -vfi $IMAGE_PATH
# Lets make a temporary directory mkdir $TMP_DIR
# Lets put all the files in the new directory for i in ${FILES[@]} do cp -vf $i $TMP_DIR done sudo /sbin/mkfs.cramfs -v $TMP_DIR $IMAGE_PATH
# Lets erease the temp directory rm -rfv $TMP_DIR
# We are done!!!!
On Thu, 2007-02-15 at 20:50 +0100, Joel Andres Granados wrote:
Relevant to Bug # 134638. Simple, very limited addition to allow striped Logical Volumes. Can't choose the number of stripes nor the size of the stripes yet. Working on it.
A few things -- 1) Your diff is reversed. And it has each file as a separate diff instead of a combined diff with everything together. This makes it a bit harder to look at the whole 2) Is this something that really makes sense to expose in the UI? While I can see having it in the backend code and exposed for users of kickstart, I don't think that it's something which most users are going to understand or want in an interactive install. 3) Duplicating all of the args for lvcreate isn't what you want. It's far better to figure out when we need to pass more options and then just extend the list rather than having to maintain two nearly identical chunks of code
Jeremy
Jeremy Katz wrote:
On Thu, 2007-02-15 at 20:50 +0100, Joel Andres Granados wrote:
Relevant to Bug # 134638. Simple, very limited addition to allow striped Logical Volumes. Can't choose the number of stripes nor the size of the stripes yet. Working on it.
A few things --
- Your diff is reversed. And it has each file as a separate diff
instead of a combined diff with everything together. This makes it a bit harder to look at the whole
It was my first diff, sorry. I'll change the order of the files and do combined diff for my next posts.
- Is this something that really makes sense to expose in the UI? While
I can see having it in the backend code and exposed for users of kickstart, I don't think that it's something which most users are going to understand or want in an interactive install.
Good point. I agree that the installation might be difficult to understand and maybe it wouldn't be a good idea to include striped functionality in the distribution but on the other hand I can think of a situation where the striped functionality in the UI could come in handy. Say if I wanted to install a great number of machines with a kickstart file generated by the first custom install I could choose my striped setup and then replicate in all the boxes. Moreover it could be shown only if a parameter is passed to the anaconda script. something like --show-striped, in this way only the advanced users would be able to see it. I'm not saying that its done, given that all my striped code is hard coded into the gui code, but it is a possibility. This can also be considered as a workaround, For anyone that wants the striped options in the gui we can point them to the files, they can create a RHupdated or updates.img with them and have the functionality.
- Duplicating all of the args for lvcreate isn't what you want. It's
far better to figure out when we need to pass more options and then just extend the list rather than having to maintain two nearly identical chunks of code
I agree. I realized this after the function was done. I didn't know how the lvm command worked so I coded another lvcreate command thinking I needed it.
Regards Joel.
anaconda-devel@lists.stg.fedoraproject.org