From f3575be76a679b16158fea2ba672f36f508e88ff Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 23 Aug 2018 13:20:25 +0100 Subject: [PATCH] MNAIO: Move to using SCSI controller for TRIM support When using file-backed storage, or SSD storage, any erasing done in the VM does not actually clear up the space. By using the virtio-scsi controller the VM is able to use TRIM to clear any blocks which are deleted. This also allows us to use fstrim to reduce the size of the qemu files before we save them for later re-use. Change-Id: Ia9001522ce054ee9f8a6dd38270da3e3fd039813 --- multi-node-aio/playbooks/kvm/kvm-vm.xml.j2 | 10 +++++++--- .../playbooks/pxe/configs/debian/compute.config.j2 | 2 +- .../playbooks/pxe/configs/debian/infra.config.j2 | 2 +- .../playbooks/pxe/configs/debian/vm-compute.config.j2 | 6 +++--- .../playbooks/pxe/configs/debian/vm.config.j2 | 6 +++--- .../playbooks/pxe/configs/redhat/vm-compute.config.j2 | 2 +- .../playbooks/pxe/configs/redhat/vm.config.j2 | 2 +- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/multi-node-aio/playbooks/kvm/kvm-vm.xml.j2 b/multi-node-aio/playbooks/kvm/kvm-vm.xml.j2 index 0fd044f5..722ffeba 100644 --- a/multi-node-aio/playbooks/kvm/kvm-vm.xml.j2 +++ b/multi-node-aio/playbooks/kvm/kvm-vm.xml.j2 @@ -40,16 +40,20 @@ {% elif default_vm_disk_mode == "file" %} - + {% endif %} - -
+ + +
+ +
+
diff --git a/multi-node-aio/playbooks/pxe/configs/debian/compute.config.j2 b/multi-node-aio/playbooks/pxe/configs/debian/compute.config.j2 index da73d941..aad6b3ba 100644 --- a/multi-node-aio/playbooks/pxe/configs/debian/compute.config.j2 +++ b/multi-node-aio/playbooks/pxe/configs/debian/compute.config.j2 @@ -30,7 +30,7 @@ d-i netcfg/wireless_wep string # Pre Install -# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/vda. See Ubuntu bug #1347726. +# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/sda. See Ubuntu bug #1347726. d-i preseed/early_command string \ umount /media || true diff --git a/multi-node-aio/playbooks/pxe/configs/debian/infra.config.j2 b/multi-node-aio/playbooks/pxe/configs/debian/infra.config.j2 index 2cd1bc73..235291ff 100644 --- a/multi-node-aio/playbooks/pxe/configs/debian/infra.config.j2 +++ b/multi-node-aio/playbooks/pxe/configs/debian/infra.config.j2 @@ -30,7 +30,7 @@ d-i netcfg/wireless_wep string # Pre Install -# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/vda. See Ubuntu bug #1347726. +# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/sda. See Ubuntu bug #1347726. d-i preseed/early_command string \ umount /media || true diff --git a/multi-node-aio/playbooks/pxe/configs/debian/vm-compute.config.j2 b/multi-node-aio/playbooks/pxe/configs/debian/vm-compute.config.j2 index 021494c4..643d75de 100644 --- a/multi-node-aio/playbooks/pxe/configs/debian/vm-compute.config.j2 +++ b/multi-node-aio/playbooks/pxe/configs/debian/vm-compute.config.j2 @@ -30,7 +30,7 @@ d-i netcfg/wireless_wep string # Pre Install -# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/vda. See Ubuntu bug #1347726. +# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/sda. See Ubuntu bug #1347726. d-i preseed/early_command string \ umount /media || true @@ -90,7 +90,7 @@ d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-auto/method string lvm -d-i partman-auto/disk string /dev/vda +d-i partman-auto/disk string /dev/sda # For LVM partitioning, you can select how much of the volume group to use # for logical volumes. @@ -111,7 +111,7 @@ d-i partman-auto/expert_recipe string \ 1024 1 100% ext4 \ $primary{ } \ method{ lvm } \ - device{ /dev/vda2 } \ + device{ /dev/sda2 } \ vg_name{ vmvg00 } \ . \ 2048 1 4096 linux-swap \ diff --git a/multi-node-aio/playbooks/pxe/configs/debian/vm.config.j2 b/multi-node-aio/playbooks/pxe/configs/debian/vm.config.j2 index fb25b1fd..78dd06e4 100644 --- a/multi-node-aio/playbooks/pxe/configs/debian/vm.config.j2 +++ b/multi-node-aio/playbooks/pxe/configs/debian/vm.config.j2 @@ -30,7 +30,7 @@ d-i netcfg/wireless_wep string # Pre Install -# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/vda. See Ubuntu bug #1347726. +# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/sda. See Ubuntu bug #1347726. d-i preseed/early_command string \ umount /media || true @@ -90,7 +90,7 @@ d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-auto/method string lvm -d-i partman-auto/disk string /dev/vda +d-i partman-auto/disk string /dev/sda # For LVM partitioning, you can select how much of the volume group to use # for logical volumes. @@ -111,7 +111,7 @@ d-i partman-auto/expert_recipe string \ 1024 1 100% ext4 \ $primary{ } \ method{ lvm } \ - device{ /dev/vda2 } \ + device{ /dev/sda2 } \ vg_name{ vmvg00 } \ . \ 2048 1 4096 linux-swap \ diff --git a/multi-node-aio/playbooks/pxe/configs/redhat/vm-compute.config.j2 b/multi-node-aio/playbooks/pxe/configs/redhat/vm-compute.config.j2 index 5ef267bc..fb0c6aa5 100644 --- a/multi-node-aio/playbooks/pxe/configs/redhat/vm-compute.config.j2 +++ b/multi-node-aio/playbooks/pxe/configs/redhat/vm-compute.config.j2 @@ -9,7 +9,7 @@ selinux --disabled firewall --disabled services --enabled=NetworkManager,sshd eula --agreed -ignoredisk --only-use=vda +ignoredisk --only-use=sda reboot bootloader --location=mbr diff --git a/multi-node-aio/playbooks/pxe/configs/redhat/vm.config.j2 b/multi-node-aio/playbooks/pxe/configs/redhat/vm.config.j2 index a701fdc7..af333d18 100644 --- a/multi-node-aio/playbooks/pxe/configs/redhat/vm.config.j2 +++ b/multi-node-aio/playbooks/pxe/configs/redhat/vm.config.j2 @@ -9,7 +9,7 @@ selinux --disabled firewall --disabled services --enabled=NetworkManager,sshd eula --agreed -ignoredisk --only-use=vda +ignoredisk --only-use=sda reboot bootloader --location=mbr