Skip to content

Commit

Permalink
libvirt: Resize specifically to 16G
Browse files Browse the repository at this point in the history
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:
openshift/enhancements#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)
  • Loading branch information
cgwalters committed Nov 15, 2019
1 parent c85edfd commit 5e46b88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions data/data/libvirt/bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
12 changes: 10 additions & 2 deletions data/data/libvirt/volume/main.tf
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 5e46b88

Please sign in to comment.