Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions data/data/install.openshift.io_installconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,52 @@ spec:
ovirt:
description: Ovirt is the configuration used when installing
on oVirt.
properties:
cpu:
description: CPU defines the VM CPU.
properties:
cores:
description: Cores is the number of cores per socket.
Total CPUs is (Sockets * Cores)
format: int32
type: integer
sockets:
description: Sockets is the number of sockets for a
VM. Total CPUs is (Sockets * Cores)
format: int32
type: integer
required:
- cores
- sockets
type: object
instanceTypeID:
description: InstanceTypeID defines the VM instance type
and overrides the hardware parameters of the created VM,
including cpu and memory. If InstanceTypeID is passed,
all memory and cpu variables will be ignored.
type: string
memoryMB:
description: MemoryMB is the size of a VM's memory in MiBs.
format: int32
type: integer
osDisk:
description: OSDisk is the the root disk of the node.
properties:
sizeGB:
description: SizeGB size of the bootable disk in GiB.
format: int64
type: integer
required:
- sizeGB
type: object
vmType:
description: VMType defines the workload type of the VM.
enum:
- ""
- desktop
- server
- high_performance
type: string
type: object
vsphere:
description: VSphere is the configuration used when installing
Expand Down Expand Up @@ -419,6 +465,52 @@ spec:
ovirt:
description: Ovirt is the configuration used when installing on
oVirt.
properties:
cpu:
description: CPU defines the VM CPU.
properties:
cores:
description: Cores is the number of cores per socket.
Total CPUs is (Sockets * Cores)
format: int32
type: integer
sockets:
description: Sockets is the number of sockets for a VM.
Total CPUs is (Sockets * Cores)
format: int32
type: integer
required:
- cores
- sockets
type: object
instanceTypeID:
description: InstanceTypeID defines the VM instance type and
overrides the hardware parameters of the created VM, including
cpu and memory. If InstanceTypeID is passed, all memory
and cpu variables will be ignored.
type: string
memoryMB:
description: MemoryMB is the size of a VM's memory in MiBs.
format: int32
type: integer
osDisk:
description: OSDisk is the the root disk of the node.
properties:
sizeGB:
description: SizeGB size of the bootable disk in GiB.
format: int64
type: integer
required:
- sizeGB
type: object
vmType:
description: VMType defines the workload type of the VM.
enum:
- ""
- desktop
- server
- high_performance
type: string
type: object
vsphere:
description: VSphere is the configuration used when installing
Expand Down Expand Up @@ -1073,6 +1165,52 @@ spec:
used when installing on ovirt for machine pools which do not
define their own platform configuration. Default will set the
image field to the latest RHCOS image.
properties:
cpu:
description: CPU defines the VM CPU.
properties:
cores:
description: Cores is the number of cores per socket.
Total CPUs is (Sockets * Cores)
format: int32
type: integer
sockets:
description: Sockets is the number of sockets for a VM.
Total CPUs is (Sockets * Cores)
format: int32
type: integer
required:
- cores
- sockets
type: object
instanceTypeID:
description: InstanceTypeID defines the VM instance type and
overrides the hardware parameters of the created VM, including
cpu and memory. If InstanceTypeID is passed, all memory
and cpu variables will be ignored.
type: string
memoryMB:
description: MemoryMB is the size of a VM's memory in MiBs.
format: int32
type: integer
osDisk:
description: OSDisk is the the root disk of the node.
properties:
sizeGB:
description: SizeGB size of the bootable disk in GiB.
format: int64
type: integer
required:
- sizeGB
type: object
vmType:
description: VMType defines the workload type of the VM.
enum:
- ""
- desktop
- server
- high_performance
type: string
type: object
dns_vip:
description: DNSVIP is the IP of the internal DNS which will be
Expand Down
25 changes: 13 additions & 12 deletions data/data/ovirt/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ module "template" {
cluster_id = var.cluster_id
openstack_base_image_name = var.openstack_base_image_name
openstack_base_image_local_file_path = var.openstack_base_image_local_file_path
ovirt_template_cpu = var.ovirt_template_cpu
ovirt_template_mem = var.ovirt_template_mem
disk_size_gib = var.ovirt_template_disk_size_gib
ovirt_network_name = var.ovirt_network_name
ovirt_vnic_profile_id = var.ovirt_vnic_profile_id
}
Expand All @@ -30,13 +27,17 @@ module "bootstrap" {
}

module "masters" {
source = "./masters"
master_count = var.master_count
ovirt_cluster_id = var.ovirt_cluster_id
ovirt_template_id = module.template.releaseimage_template_id
ignition_master = var.ignition_master
cluster_domain = var.cluster_domain
cluster_id = var.cluster_id
ovirt_master_cpu = var.ovirt_master_cpu
ovirt_master_mem = var.ovirt_master_mem
source = "./masters"
master_count = var.master_count
ovirt_cluster_id = var.ovirt_cluster_id
ovirt_template_id = module.template.releaseimage_template_id
ignition_master = var.ignition_master
cluster_domain = var.cluster_domain
cluster_id = var.cluster_id
ovirt_master_instance_type_id = var.ovirt_master_instance_type_id
ovirt_master_cores = var.ovirt_master_cores
ovirt_master_sockets = var.ovirt_master_sockets
ovirt_master_memory = var.ovirt_master_memory
ovirt_master_vm_type = var.ovirt_master_vm_type
ovirt_master_os_disk_size_gb = var.ovirt_master_os_disk_gb
}
23 changes: 17 additions & 6 deletions data/data/ovirt/masters/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
resource "ovirt_vm" "master" {
count = var.master_count
name = "${var.cluster_id}-master-${count.index}"
cluster_id = var.ovirt_cluster_id
template_id = var.ovirt_template_id
cores = var.ovirt_master_cpu
memory = var.ovirt_master_mem
count = var.master_count
name = "${var.cluster_id}-master-${count.index}"
cluster_id = var.ovirt_cluster_id
template_id = var.ovirt_template_id
instance_type_id = var.ovirt_master_instance_type_id
type = var.ovirt_master_vm_type
cores = var.ovirt_master_cores
sockets = var.ovirt_master_sockets
// if instance type is declared then memory is redundant. Since terraform
// doesn't allow to condionally omit it, it must be passed.
// The number passed is multiplied by 4 and becomes the maximum memory the VM can have.
memory = var.ovirt_master_instance_type_id != "" ? 16348 : var.ovirt_master_memory

initialization {
host_name = "${var.cluster_id}-master-${count.index}"
custom_script = var.ignition_master
}

block_device {
interface = "virtio_scsi"
size = var.ovirt_master_os_disk_size_gb
}
Comment thread
abhinavdahiya marked this conversation as resolved.
Outdated
}

resource "ovirt_tag" "cluster_tag" {
Expand Down
32 changes: 27 additions & 5 deletions data/data/ovirt/masters/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,32 @@ variable "ignition_master" {
description = "master ignition config"
}

variable "ovirt_master_mem" {
type = string
variable "ovirt_master_memory" {
type = string
description = "master VM memory in MiB"
}

variable "ovirt_master_cores" {
type = string
description = "master VM number of cores"
}

variable "ovirt_master_cpu" {
type = string
}
variable "ovirt_master_sockets" {
type = string
description = "master VM number of sockets"
}

variable "ovirt_master_os_disk_size_gb" {
type = string
description = "master VM disk size in GiB"
}

variable "ovirt_master_vm_type" {
type = string
description = "master VM type"
}

variable "ovirt_master_instance_type_id" {
type = string
description = "master VM instance type ID"
}
3 changes: 0 additions & 3 deletions data/data/ovirt/template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ resource "ovirt_vm" "tmp_import_vm" {
count = length(local.existing_id) == 0 ? 1 : 0
name = "tmpvm-for-${ovirt_image_transfer.releaseimage.0.alias}"
cluster_id = var.ovirt_cluster_id
cores = var.ovirt_template_cpu
memory = var.ovirt_template_mem
block_device {
disk_id = ovirt_image_transfer.releaseimage.0.disk_id
interface = "virtio_scsi"
Expand All @@ -70,7 +68,6 @@ resource "ovirt_template" "releaseimage_template" {
// create from vm
vm_id = ovirt_vm.tmp_import_vm.0.id
depends_on = [ovirt_vm.tmp_import_vm]
cores = var.ovirt_template_cpu
}

// finally get the template by name(should be unique), fail if it doesn't exist
Expand Down
13 changes: 0 additions & 13 deletions data/data/ovirt/template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,3 @@ variable "ovirt_vnic_profile_id" {
type = string
description = "The ID of the vnic profile of ovirt's logical network."
}

variable "ovirt_template_mem" {
type = string
}

variable "ovirt_template_cpu" {
type = string
}

variable "disk_size_gib" {
type = number
description = "The size of the template disk for worker/nodes in GiB."
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no new line EOF

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can still see the newline :P

35 changes: 20 additions & 15 deletions data/data/ovirt/variables-ovirt.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,32 @@ variable "ovirt_vnic_profile_id" {
description = "The ID of the vnic profile of ovirt's logical network."
}

variable "ovirt_master_mem" {
type = string
default = "8192"
variable "ovirt_master_memory" {
Comment thread
abhinavdahiya marked this conversation as resolved.
Outdated
type = string
description = "master VM memory in MiB"
}

variable "ovirt_master_cores" {
type = string
description = "master VM number of cores"
}

variable "ovirt_master_cpu" {
type = number
default = 4
variable "ovirt_master_sockets" {
type = string
description = "master VM number of sockets"
}

variable "ovirt_template_mem" {
type = string
default = "16384"
variable "ovirt_master_os_disk_gb" {
type = string
description = "master VM disk size in GiB"
}

variable "ovirt_template_cpu" {
type = number
default = 4
variable "ovirt_master_vm_type" {
type = string
description = "master VM type"
}

variable "ovirt_template_disk_size_gib" {
type = number
default = 25
variable "ovirt_master_instance_type_id" {
type = string
description = "master VM instance type ID"
}
Loading