From e59513fc2e18d283108215312ebde23d2fefd895 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 4 Dec 2018 15:52:25 -0500 Subject: [PATCH] libvirt: Add Terraform variables for memory/CPU, bump master to 4GiB My main dev environment is a Lenovo P50 with 64GB of RAM - I got it specifically to run some large VMs (and/or many VMs) specifically with OpenShift in mind. First, default masters to 4096 MiB since we are seeing a default install be overloaded. And for me, increasing RAM on my master to 8GB is a *very* noticeable speed improvement and I think reliabilty; before I saw the apiserver be `OOMKilled` sometimes, and `kswapd0` was constantly doing writeback. These variables aren't bubbled all the way up to the documented installer config, but one can now do e.g.: ``` $ env TF_VAR_libvirt_master_memory=8192 TF_VAR_libvirt_master_vcpu=4 ./bin/openshift-install create cluster --dir=osiris ``` Previously: - https://github.com/openshift/installer/pull/408 - https://github.com/openshift/installer/pull/163 --- data/data/libvirt/main.tf | 4 ++-- data/data/libvirt/variables-libvirt.tf | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/data/data/libvirt/main.tf b/data/data/libvirt/main.tf index ccc4b3a08f1..51c75c46f4c 100644 --- a/data/data/libvirt/main.tf +++ b/data/data/libvirt/main.tf @@ -64,8 +64,8 @@ resource "libvirt_domain" "master" { name = "${var.tectonic_cluster_name}-master-${count.index}" - memory = "3072" - vcpu = "2" + memory = "${var.libvirt_master_memory}" + vcpu = "${var.libvirt_master_vcpu}" coreos_ignition = "${libvirt_ignition.master.id}" diff --git a/data/data/libvirt/variables-libvirt.tf b/data/data/libvirt/variables-libvirt.tf index cb76f1c5504..b48e7913145 100644 --- a/data/data/libvirt/variables-libvirt.tf +++ b/data/data/libvirt/variables-libvirt.tf @@ -32,3 +32,19 @@ variable "tectonic_libvirt_master_ips" { type = "list" description = "the list of desired master ips. Must match tectonic_master_count" } + +# It's definitely recommended to bump this if you can. +variable "libvirt_master_memory" { + type = "string" + description = "RAM in MiB allocated to masters" + default = "4096" +} + +# At some point this one is likely to default to the number +# of physical cores you have. See also +# https://pagure.io/standard-test-roles/pull-request/223 +variable "libvirt_master_vcpu" { + type = "string" + description = "CPUs allocated to masters" + default = "2" +}