Skip to content

Commit

Permalink
libvirt: Add Terraform variables for memory/CPU, bump master to 4GiB
Browse files Browse the repository at this point in the history
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:

 - openshift#408
 - openshift#163
  • Loading branch information
cgwalters committed Dec 5, 2018
1 parent 4ec4ca6 commit e59513f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/data/libvirt/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
16 changes: 16 additions & 0 deletions data/data/libvirt/variables-libvirt.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit e59513f

Please sign in to comment.