From 680a6b336db459de39a63ec4cc452413b007f49d Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Thu, 2 May 2024 21:44:41 +0100 Subject: [PATCH] Update juju plans to try new placement --- juju/home-maas/01-cloud.tf | 2 +- juju/home-maas/05-ceph.tf | 62 +++++++++++++++++++++++++++++++ juju/home-maas/06-nova-compute.tf | 12 ++++-- juju/home-maas/07-controllers.tf | 3 ++ juju/home-maas/terraform.tfvars | 4 +- juju/init.tf | 2 +- 6 files changed, 78 insertions(+), 7 deletions(-) diff --git a/juju/home-maas/01-cloud.tf b/juju/home-maas/01-cloud.tf index df17b7c..2d72311 100644 --- a/juju/home-maas/01-cloud.tf +++ b/juju/home-maas/01-cloud.tf @@ -2,7 +2,7 @@ resource "juju_model" "cpe-focal" { name = "cpe-focal" cloud { - name = "home-maas" + name = "home-maas" } config = { diff --git a/juju/home-maas/05-ceph.tf b/juju/home-maas/05-ceph.tf index 6969a90..cccb90f 100644 --- a/juju/home-maas/05-ceph.tf +++ b/juju/home-maas/05-ceph.tf @@ -30,6 +30,22 @@ resource "juju_application" "ceph-osd" { } } +resource "juju_machine" "ceph-mon-1" { + model = juju_model.cpe-focal.name + placement = join(":",["lxd",juju_machine.all_machines["101"].machine_id]) +# constraints = "spaces=oam,ceph-access,ceph-replica" +} +resource "juju_machine" "ceph-mon-2" { + model = juju_model.cpe-focal.name + placement = join(":",["lxd",juju_machine.all_machines["102"].machine_id]) +# constraints = "spaces=oam,ceph-access,ceph-replica" +} +resource "juju_machine" "ceph-mon-3" { + model = juju_model.cpe-focal.name + placement = join(":",["lxd",juju_machine.all_machines["103"].machine_id]) +# constraints = "spaces=oam,ceph-access,ceph-replica" +} + resource "juju_application" "ceph-mon" { name = "ceph-mon" @@ -43,6 +59,31 @@ resource "juju_application" "ceph-mon" { units = 3 + placement = "${join(",",sort([ + juju_machine.ceph-mon-1.machine_id, + juju_machine.ceph-mon-2.machine_id, + juju_machine.ceph-mon-3.machine_id, + ]))}" + + endpoint_bindings = [{ + space = "oam" + },{ + space = "ceph-access" + endpoint = "public" + },{ + space = "ceph-access" + endpoint = "osd" + },{ + space = "ceph-access" + endpoint = "client" + },{ + space = "ceph-access" + endpoint = "admin" + },{ + space = "ceph-replica" + endpoint = "cluster" + }] + config = { expected-osd-count = 12 source = var.openstack-origin @@ -51,6 +92,19 @@ resource "juju_application" "ceph-mon" { } } +resource "juju_machine" "ceph-rgw-1" { + model = juju_model.cpe-focal.name + placement = join(":",["lxd",juju_machine.all_machines["101"].machine_id]) +} +resource "juju_machine" "ceph-rgw-2" { + model = juju_model.cpe-focal.name + placement = join(":",["lxd",juju_machine.all_machines["102"].machine_id]) +} +resource "juju_machine" "ceph-rgw-3" { + model = juju_model.cpe-focal.name + placement = join(":",["lxd",juju_machine.all_machines["103"].machine_id]) +} + resource "juju_application" "ceph-radosgw" { name = "ceph-radosgw" @@ -64,6 +118,12 @@ resource "juju_application" "ceph-radosgw" { units = 3 + placement = "${join(",",sort([ + juju_machine.ceph-rgw-1.machine_id, + juju_machine.ceph-rgw-2.machine_id, + juju_machine.ceph-rgw-3.machine_id, + ]))}" + config = { source: var.openstack-origin vip = "10.0.1.224" @@ -84,6 +144,8 @@ resource "juju_application" "hacluster-radosgw" { channel = "2.0.3/stable" } + units = 0 + } resource "juju_integration" "osd-mon" { diff --git a/juju/home-maas/06-nova-compute.tf b/juju/home-maas/06-nova-compute.tf index 9829d8f..f717358 100644 --- a/juju/home-maas/06-nova-compute.tf +++ b/juju/home-maas/06-nova-compute.tf @@ -33,9 +33,9 @@ resource "juju_application" "nova-compute" { virt-type = "kvm" customize-failure-domain = var.customize-failure-domain reserved-host-memory = var.reserved-host-memory - cpu-mode = "custom" - cpu-model = "EPYC-IBPB" - cpu-model-extra-flags = "svm,pcid" + #cpu-mode = "custom" + #cpu-model = "EPYC-IBPB" + #cpu-model-extra-flags = "svm,pcid" pci-passthrough-whitelist = jsonencode([ {vendor_id: "1af4", product_id: "1000", address: "00:08.0"}, {vendor_id: "1af4", product_id: "1000", address: "00:07.0"}, @@ -62,6 +62,8 @@ resource "juju_application" "ceilometer-agent" { channel = "ussuri/stable" } + units = 0 + config = { use-internal-endpoints = "true" } @@ -78,6 +80,8 @@ resource "juju_application" "neutron-openvswitch" { channel = "ussuri/stable" } + units = 0 + config = { data-port = "br-data:ens9" dns-servers = "192.168.1.13" @@ -99,6 +103,8 @@ resource "juju_application" "sysconfig-compute" { revision = "19" } + units = 0 + config = { # enable-iommu = "false" governor = "performance" diff --git a/juju/home-maas/07-controllers.tf b/juju/home-maas/07-controllers.tf index 1f92b57..d4edc85 100644 --- a/juju/home-maas/07-controllers.tf +++ b/juju/home-maas/07-controllers.tf @@ -7,6 +7,7 @@ resource "juju_application" "controller-server" { name = "ubuntu" channel = "latest/stable" revision = "24" + series = "focal" } units = 6 @@ -32,6 +33,8 @@ resource "juju_application" "sysconfig-control" { revision = "22" } + units = 0 + config = { governor = "performance" enable-pti = "on" diff --git a/juju/home-maas/terraform.tfvars b/juju/home-maas/terraform.tfvars index 5a0a1d6..5d4ae39 100644 --- a/juju/home-maas/terraform.tfvars +++ b/juju/home-maas/terraform.tfvars @@ -2,9 +2,9 @@ machines = [ {machine_id=100,constraints="tags=control,asrock01"}, {machine_id=101,constraints="tags=control,asrock02"}, {machine_id=102,constraints="tags=control,asrock03"}, - {machine_id=103,constraints="tags=control,asrock04 spaces=oam"}, + {machine_id=103,constraints="tags=control,asrock04"}, {machine_id=104,constraints="tags=control,asrock02"}, - {machine_id=105,constraints="tags=control,asrock01"}, # needs to be asrock03 + {machine_id=105,constraints="tags=control,asrock03"}, {machine_id=400,constraints="tags=compute,asrock01"}, {machine_id=401,constraints="tags=compute,asrock02"}, {machine_id=402,constraints="tags=compute,asrock03"}, diff --git a/juju/init.tf b/juju/init.tf index cfdf05f..f0bbd73 100644 --- a/juju/init.tf +++ b/juju/init.tf @@ -1,7 +1,7 @@ terraform { required_providers { juju = { - version = "~> 0.10.0" + version = "~> 0.12.0" source = "juju/juju" } }