From 5e46b881675cda0613233574b0b70531b4a82a31 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 11 Nov 2019 22:54:14 +0000 Subject: [PATCH] libvirt: Resize specifically to 16G Today for IaaS clouds, we default to an instance type, which then in turn usually provides a default size. RHCOS resizes on boot to that size, distinct from its "default" 16G size. However, libvirt installs were inheriting our default size. We'd like to shrink it because we plan to land encryption: https://github.com/openshift/enhancements/pull/15 And the less data we need to encrypt, the better. (In the future I'd like to make this configurable with a variable, but let's just prepare for the encryption work now) --- data/data/libvirt/bootstrap/main.tf | 2 ++ data/data/libvirt/volume/main.tf | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/data/data/libvirt/bootstrap/main.tf b/data/data/libvirt/bootstrap/main.tf index 2b70f448b34..b526c277bb1 100644 --- a/data/data/libvirt/bootstrap/main.tf +++ b/data/data/libvirt/bootstrap/main.tf @@ -2,6 +2,8 @@ resource "libvirt_volume" "bootstrap" { name = "${var.cluster_id}-bootstrap" base_volume_id = var.base_volume_id pool = var.pool + # If you change this, you probably want to change the control plane/workers too + size = 16000000000 } resource "libvirt_ignition" "bootstrap" { diff --git a/data/data/libvirt/volume/main.tf b/data/data/libvirt/volume/main.tf index ee6257b0116..3071da3f2c0 100644 --- a/data/data/libvirt/volume/main.tf +++ b/data/data/libvirt/volume/main.tf @@ -1,5 +1,13 @@ -resource "libvirt_volume" "coreos_base" { - name = "${var.cluster_id}-base" +resource "libvirt_volume" "coreos_orig" { + name = "${var.cluster_id}-orig" source = var.image pool = var.pool } + +resource "libvirt_volume" "coreos_base" { + name = "${var.cluster_id}-base" + base_volume_id = libvirt_volume.coreos_orig.id + pool = var.pool + # If you change this, you probably want to change the bootstrap too + size = 16000000000 +}