From 2f9bbed3a9a3b1a541124f484ae324a809262fb5 Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Thu, 12 Jul 2018 11:27:22 +0100 Subject: [PATCH] Enable discard By default discard/trim requests are disabled for libvirt. This patch enables them by default although in order to actually use them, instances still need be using scsi disk devices. Also this patch only permits Nova storage (e.g. instance root disk) to use discard. For Cinder volumes this must be enabled in Cinder. Change-Id: Iceb22fe5206629bc7b4096f518b8977c2e14def3 Closes-Bug: #1781382 --- templates/mitaka/nova.conf | 1 + templates/newton/nova.conf | 1 + templates/ocata/nova.conf | 1 + templates/pike/nova.conf | 1 + 4 files changed, 4 insertions(+) diff --git a/templates/mitaka/nova.conf b/templates/mitaka/nova.conf index c43095a6..75f0e6f2 100644 --- a/templates/mitaka/nova.conf +++ b/templates/mitaka/nova.conf @@ -207,6 +207,7 @@ live_migration_tunnelled = False {% if use_multipath -%} iscsi_use_multipath = {{ use_multipath }} {% endif %} +hw_disk_discard = unmap {% if virt_type == 'lxd' -%} [lxd] diff --git a/templates/newton/nova.conf b/templates/newton/nova.conf index e57fb1d1..1c951b52 100644 --- a/templates/newton/nova.conf +++ b/templates/newton/nova.conf @@ -207,6 +207,7 @@ live_migration_tunnelled = False {% if use_multipath -%} volume_use_multipath = {{ use_multipath }} {% endif %} +hw_disk_discard = unmap {% if virt_type == 'lxd' -%} [lxd] diff --git a/templates/ocata/nova.conf b/templates/ocata/nova.conf index 5d98d8c7..eb6ea723 100644 --- a/templates/ocata/nova.conf +++ b/templates/ocata/nova.conf @@ -208,6 +208,7 @@ live_migration_tunnelled = False {% if use_multipath -%} volume_use_multipath = {{ use_multipath }} {% endif %} +hw_disk_discard = unmap {% if virt_type == 'lxd' -%} [lxd] diff --git a/templates/pike/nova.conf b/templates/pike/nova.conf index 067728f1..975a261d 100644 --- a/templates/pike/nova.conf +++ b/templates/pike/nova.conf @@ -211,6 +211,7 @@ live_migration_tunnelled = False {% if use_multipath -%} volume_use_multipath = {{ use_multipath }} {% endif %} +hw_disk_discard = unmap {% if virt_type == 'lxd' -%} [lxd]