[PATCH] Add installer support for lvm thin provisioning.
Vratislav Podzimek
vpodzime at redhat.com
Wed Jun 26 10:16:14 UTC 2013
On Tue, 2013-06-25 at 15:40 -0500, David Lehman wrote:
> This adds a new autopart type as well as the ability to create thinly-
> provisioned lvm using the custom spoke.
> ---
> anaconda.spec.in | 4 +--
> pyanaconda/installclass.py | 4 +--
> pyanaconda/kickstart.py | 36 +++++++++++++++++++----
> pyanaconda/ui/gui/spokes/custom.glade | 1 +
> pyanaconda/ui/gui/spokes/custom.py | 53 ++++++++++++++++++++++++----------
> pyanaconda/ui/gui/spokes/storage.glade | 6 ++--
> 6 files changed, 77 insertions(+), 27 deletions(-)
>
> diff --git a/anaconda.spec.in b/anaconda.spec.in
> index 382737b..52eda35 100644
> --- a/anaconda.spec.in
> +++ b/anaconda.spec.in
> @@ -21,7 +21,7 @@ Source0: %{name}-%{version}.tar.bz2
> %define gconfversion 2.28.1
> %define intltoolver 0.31.2-3
> %define libnlver 1.0
> -%define pykickstartver 1.99.32
> +%define pykickstartver 1.99.33
> %define yumver 3.4.3-91
> %define partedver 1.8.1
> %define pypartedver 2.5-2
> @@ -80,7 +80,7 @@ BuildRequires: s390utils-devel
> %endif
>
> Requires: anaconda-widgets = %{version}-%{release}
> -Requires: python-blivet >= 0.16
> +Requires: python-blivet >= 0.18
> Requires: gnome-icon-theme-symbolic
> Requires: python-meh >= %{mehver}
> Requires: libreport-anaconda >= 2.0.21-1
> diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
> index 7e04cc4..8f38548 100644
> --- a/pyanaconda/installclass.py
> +++ b/pyanaconda/installclass.py
> @@ -81,10 +81,10 @@ class BaseInstallClass(object):
> def setDefaultPartitioning(self, storage):
> autorequests = [PartSpec(mountpoint="/", fstype=storage.defaultFSType,
> size=1024, maxSize=50*1024, grow=True,
> - btr=True, lv=True, encrypted=True),
> + btr=True, lv=True, thin=True, encrypted=True),
> PartSpec(mountpoint="/home", fstype=storage.defaultFSType,
> size=500, grow=True, requiredSpace=50*1024,
> - btr=True, lv=True, encrypted=True)]
> + btr=True, lv=True, thin=True, encrypted=True)]
>
> bootreqs = platform.setDefaultPartitioning()
> if bootreqs:
> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index fea9697..b88f14e 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -216,7 +216,7 @@ class Authconfig(commands.authconfig.FC3_Authconfig):
> except RuntimeError as msg:
> log.error("Error running /usr/sbin/authconfig %s: %s", args, msg)
>
> -class AutoPart(commands.autopart.F18_AutoPart):
> +class AutoPart(commands.autopart.F19_AutoPart):
> def execute(self, storage, ksdata, instClass):
> from blivet.partitioning import doAutoPartition
>
> @@ -630,7 +630,7 @@ class Lang(commands.lang.F19_Lang):
> def execute(self, *args, **kwargs):
> localization.write_language_configuration(self, ROOT_PATH)
>
> -class LogVol(commands.logvol.F18_LogVol):
> +class LogVol(commands.logvol.F19_LogVol):
> def execute(self, storage, ksdata, instClass):
> for l in self.lvList:
> l.execute(storage, ksdata, instClass)
> @@ -638,7 +638,7 @@ class LogVol(commands.logvol.F18_LogVol):
> if self.lvList:
> growLVM(storage)
>
> -class LogVolData(commands.logvol.F18_LogVolData):
> +class LogVolData(commands.logvol.F19_LogVolData):
> def execute(self, storage, ksdata, instClass):
> devicetree = storage.devicetree
>
> @@ -659,6 +659,10 @@ class LogVolData(commands.logvol.F18_LogVolData):
> else:
> type = storage.defaultFSType
>
> + if self.thin_pool:
> + self.mountpoint = ""
> + type = None
> +
> # Sanity check mountpoint
> if self.mountpoint != "" and self.mountpoint[0] != '/':
> raise KickstartValueError, formatErrorMsg(self.lineno, msg="The mount point \"%s\" is not valid." % (self.mountpoint,))
> @@ -668,6 +672,12 @@ class LogVolData(commands.logvol.F18_LogVolData):
> if not vg:
> raise KickstartValueError, formatErrorMsg(self.lineno, msg="No volume group exists with the name \"%s\". Specify volume groups before logical volumes." % self.vgname)
>
> + pool = None
> + if self.thin_volume:
> + pool = devicetree.getDeviceByName("%s-%s" % (vg.name, self.pool_name))
> + if not pool:
> + raise KickstartValueError, formatErrorMsg(self.lineno, msg="No thin pool exists with the name \"%s\". Specify thin pools before thin volumes." % self.pool_name)
A split candidate line ^^^. I know there are many more such lines right
above, but let's not add more of them. Or maybe an additional patch
splitting them all would be better. I can do it if necessary.
ACK otherwise.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list