diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ce80f880dd754f4c906dd62ce6246c1f0c51290e --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# Patches for Ganeti + +This repository contains our patches for ganeti which we apply on top of the already patched debian package. +We retrieve the package source from debian, add some patches, build, and copy to our debian repository. +After installation from our repository, we need to pin those to prevent updating from debian's regular sources. +See apt's documentation on pinning. + + +## Interesting Links + +Rebuilding an existing package is described here: +https://wiki.debian.org/BuildingTutorial + +More information on building: +https://wiki.debian.org/HowToPackageForDebian + +The ganeti package uses `quilt` to manage its patches. See this tutorial: +https://raphaelhertzog.com/2012/08/08/how-to-use-quilt-to-manage-patches-in-debian-packages/ + + +## Rebuilding Ganeti + +It boils down to the following steps: + +- `apt-get source ganeti` +- `cd ganeti-2.15.2/debian` +- `quilt import ../remove_blockdev_from_movable_list.patch` and others +- `dch -n` creates a new changelog entry +- `debuild -b -uc -us` builds the package + +At least according to my zsh history. + +If you are building from an already changed version, but without that particular changelog, use: + +- `dch --auto-nmr --newversion $newversion` + +Ideally, you copy the old changelog to the new one. Look up the old version number! +Add "Non-maintainer upload." manually to your list of changes. + + +## Patch Details + +### `fix_ceph_showmap.patch` + +Fixes an incompatibility with current ceph versions. + +See also: https://github.com/ganeti/ganeti/issues/1233 + +### `increase_max_disk_count.patch` + +*sigh* + +There is a constant number of allowed disks that may be attached to a VM. We increase this limit. + +### `remove_blockdev_from_mirrored_list.patch` and `remove_blockdev_from_movable_list.patch` + +Removes block devices from lists of mirrored and movable devices. This prevents such VMs from being migrated. + +This may not solve the general case, but is makes it compatible with our usage. + + +### `add_rbd_cache_support.patch` + +Add caching support for rbd devices. This was disabled for arbritrary external storage. +But this does not make sense for rbd. + + diff --git a/add_rbd_cache_support.patch b/add_rbd_cache_support.patch new file mode 100644 index 0000000000000000000000000000000000000000..71593bed99fffeaf2fbed45df61d4386c0713fe0 --- /dev/null +++ b/add_rbd_cache_support.patch @@ -0,0 +1,20 @@ +Index: ganeti-2.15.2/lib/hypervisor/hv_kvm/__init__.py +=================================================================== +--- ganeti-2.15.2.orig/lib/hypervisor/hv_kvm/__init__.py ++++ ganeti-2.15.2/lib/hypervisor/hv_kvm/__init__.py +@@ -921,12 +921,13 @@ class KVMHypervisor(hv_base.BaseHypervis + disk_cache = up_hvp[constants.HV_DISK_CACHE] + for cfdev, link_name, uri in kvm_disks: + if cfdev.dev_type in constants.DTS_EXT_MIRROR: +- if disk_cache != "none": ++ if disk_cache != "none" and cfdev.dev_type != "rbd": + # TODO: make this a hard error, instead of a silent overwrite + logging.warning("KVM: overriding disk_cache setting '%s' with 'none'" + " to prevent shared storage corruption on migration", + disk_cache) +- cache_val = ",cache=none" ++ disk_cache = "none" ++ cache_val = ",cache=%s" % disk_cache + elif disk_cache != constants.HT_CACHE_DEFAULT: + cache_val = ",cache=%s" % disk_cache + else: diff --git a/fix_ceph_showmap.patch b/fix_ceph_showmap.patch new file mode 100644 index 0000000000000000000000000000000000000000..ab1c59ebf55768268521b71ed5d913b01da10cad --- /dev/null +++ b/fix_ceph_showmap.patch @@ -0,0 +1,11 @@ +--- a/lib/storage/bdev.py ++++ b/lib/storage/bdev.py +@@ -1020,8 +1020,6 @@ class RADOSBlockDevice(base.BlockDev): + showmap_cmd = [ + constants.RBD_CMD, + "showmapped", +- "-p", +- pool, + "--format", + "json" + ] diff --git a/increase_max_disk_count.patch b/increase_max_disk_count.patch new file mode 100644 index 0000000000000000000000000000000000000000..effedba4e4fa77dcbcd4a492e7a792a9f0be5f5a --- /dev/null +++ b/increase_max_disk_count.patch @@ -0,0 +1,11 @@ +--- a/src/Ganeti/HTools/Types.hs 2015-12-16 14:34:43.000000000 +0100 ++++ b/src/Ganeti/HTools/Types.hs 2017-11-03 21:42:53.486742240 +0100 +@@ -215,7 +215,7 @@ + } + + maxDisks :: Int +-maxDisks = 16 ++maxDisks = 64 + + maxNics :: Int + maxNics = 8 diff --git a/remove_blockdev_from_mirrored_list.patch b/remove_blockdev_from_mirrored_list.patch new file mode 100644 index 0000000000000000000000000000000000000000..4231a7a6c057b6a3cb5f67e63f513ed7ad762838 --- /dev/null +++ b/remove_blockdev_from_mirrored_list.patch @@ -0,0 +1,11 @@ +--- a/src/Ganeti/Constants.hs 2015-12-16 14:34:43.000000000 +0100 ++++ b/src/Ganeti/Constants.hs 2017-11-03 20:42:28.489477592 +0100 +@@ -942,7 +942,7 @@ + dtsExtMirror = + ConstantUtils.mkSet $ + map Types.diskTemplateToRaw +- [DTDiskless, DTBlock, DTExt, DTSharedFile, DTRbd, DTGluster] ++ [DTDiskless, DTExt, DTSharedFile, DTRbd, DTGluster] + + -- | The set of non-lvm-based disk templates + dtsNotLvm :: FrozenSet String diff --git a/remove_blockdev_from_movable_list.patch b/remove_blockdev_from_movable_list.patch new file mode 100644 index 0000000000000000000000000000000000000000..bd196baea7eb69ba9321b41a017ef6f3372e4ed3 --- /dev/null +++ b/remove_blockdev_from_movable_list.patch @@ -0,0 +1,10 @@ +--- a/src/Ganeti/HTools/Instance.hs 2015-12-16 14:34:43.000000000 +0100 ++++ b/src/Ganeti/HTools/Instance.hs 2017-11-03 18:34:37.562544893 +0100 +@@ -168,7 +168,6 @@ + movableDiskTemplates :: [T.DiskTemplate] + movableDiskTemplates = + [ T.DTDrbd8 +- , T.DTBlock + , T.DTSharedFile + , T.DTGluster + , T.DTRbd