From 05711c4bbd393af232e0fdbf65ffb4fa59cd5ecb Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Tue, 7 Feb 2023 14:27:19 +0100 Subject: [PATCH 1/5] feat(nebula): adding mac address definition for nics --- README.md | 8 +++++++- modules/nebula/main.tf | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8598339..c4f4011 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # terracadoles -Cadoles Terraform modules \ No newline at end of file +Cadoles Terraform modules + +## Modules + +* virtualMachine +* dns +* nebula \ No newline at end of file diff --git a/modules/nebula/main.tf b/modules/nebula/main.tf index 188c81a..e7342eb 100644 --- a/modules/nebula/main.tf +++ b/modules/nebula/main.tf @@ -100,6 +100,7 @@ resource "opennebula_template" "vm_template" { content { network_id = nic.value.network_id model = "virtio" + mac = nic.value.mac ip = nic.value.ip } } From e785cf9df0faf58cbbdfc13e64d00abbf20f9c61 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Tue, 7 Feb 2023 14:40:58 +0100 Subject: [PATCH 2/5] feat(nebula): removing support for ip in nic This modules is made for matchbox/typhoon Kubernetes provisionning so we need to use "Ethernet" networks and not IPs. --- modules/nebula/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nebula/main.tf b/modules/nebula/main.tf index e7342eb..428cdd1 100644 --- a/modules/nebula/main.tf +++ b/modules/nebula/main.tf @@ -101,7 +101,6 @@ resource "opennebula_template" "vm_template" { network_id = nic.value.network_id model = "virtio" mac = nic.value.mac - ip = nic.value.ip } } permissions = var.permissions From 985fd624ce6b20afcc78a2534eaeadb94bb9be37 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Fri, 24 Feb 2023 06:03:44 +0100 Subject: [PATCH 3/5] feat(nebula): support system data store placement --- modules/nebula/main.tf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/nebula/main.tf b/modules/nebula/main.tf index 428cdd1..de05d75 100644 --- a/modules/nebula/main.tf +++ b/modules/nebula/main.tf @@ -32,6 +32,11 @@ variable "one_prod_ds" { default = "101" } +variable "one_sys_datastore" { + default = "100" +} + + // system image resource "opennebula_image" "system" { for_each = var.vms @@ -88,6 +93,8 @@ resource "opennebula_template" "vm_template" { image_id = opennebula_image.data[each.key].id } + sched_ds_requirements = ( each.value.sysdatastore != "" ? each.value.sysdatastore : var.one_sys_datastore ) + os { arch = "x86_64" boot = "disk0,nic0" From 9dfd0858775edf596bc88136995ba0e0da3253f3 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Fri, 24 Feb 2023 10:32:55 +0100 Subject: [PATCH 4/5] fix(nebula): image driver is not wanted for now --- modules/nebula/main.tf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/nebula/main.tf b/modules/nebula/main.tf index de05d75..a0ec02c 100644 --- a/modules/nebula/main.tf +++ b/modules/nebula/main.tf @@ -3,10 +3,6 @@ variable "vms" { description = "Virtual Machines description" } -variable "image_driver" { - default = "qcow2" -} - variable "image_format" { default = "qcow2" } @@ -46,7 +42,6 @@ resource "opennebula_image" "system" { datastore_id = var.one_prod_ds path = "https://vulcain.cadoles.com/empty_20G" persistent = each.value.system_image_persistent - driver = var.image_driver format = var.image_format dev_prefix = var.dev_prefix permissions = var.permissions @@ -61,7 +56,6 @@ resource "opennebula_image" "data" { datastore_id = var.one_prod_ds description = "data disk for ${each.key}" persistent = each.value.data_image_persistent - driver = var.image_driver format = var.image_format dev_prefix = var.dev_prefix permissions = var.permissions From 7043a580ca08094b80b1077975f1a7c9d88e5209 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Fri, 24 Feb 2023 10:40:18 +0100 Subject: [PATCH 5/5] fix(nebula): add accurate name to VM templates --- modules/nebula/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nebula/main.tf b/modules/nebula/main.tf index a0ec02c..9882f61 100644 --- a/modules/nebula/main.tf +++ b/modules/nebula/main.tf @@ -64,7 +64,7 @@ resource "opennebula_image" "data" { resource "opennebula_template" "vm_template" { for_each = var.vms - name = each.key + name = "${each.key}.${each.value.domain}" cpu = each.value.cpu vcpu = each.value.vcpu memory = each.value.ram