diff --git a/juju/home-maas/00-variables.tf b/juju/home-maas/00-variables.tf index aa932b1..b3d3f60 100644 --- a/juju/home-maas/00-variables.tf +++ b/juju/home-maas/00-variables.tf @@ -17,3 +17,23 @@ variable reserved-host-memory { type = string default = "512" } + +variable worker-multiplier { + type = string + default = "0.25" +} + +variable bridge-mappings { + type = string + default = "" + +} +variable data-port { + type = string + default = "" +} + +variable dns-servers { + type = string + default = "" +} diff --git a/juju/home-maas/06-nova-compute.tf b/juju/home-maas/06-nova-compute.tf index 5f29593..9829d8f 100644 --- a/juju/home-maas/06-nova-compute.tf +++ b/juju/home-maas/06-nova-compute.tf @@ -36,6 +36,18 @@ resource "juju_application" "nova-compute" { 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"}, + {vendor_id: "1af4", product_id: "1000", address: "00:06.0"}, + ]) + pci-alias = jsonencode({ + vendor_id: "1af4", + product_id: "1000", + device_type: "type-PCI", + name: "arifpass", + numa_policy: "preferred" + }) } } @@ -50,6 +62,10 @@ resource "juju_application" "ceilometer-agent" { channel = "ussuri/stable" } + config = { + use-internal-endpoints = "true" + } + } resource "juju_application" "neutron-openvswitch" { @@ -72,6 +88,26 @@ resource "juju_application" "neutron-openvswitch" { } +resource "juju_application" "sysconfig-compute" { + name = "sysconfig-compute" + + model = juju_model.cpe-focal.name + + charm { + name = "sysconfig" + channel = "latest/stable" + revision = "19" + } + + config = { +# enable-iommu = "false" + governor = "performance" + enable-pti = "on" + update-grub = "true" + enable-tsx = "true" + } +} + resource "juju_integration" "compute-ceilometer" { model = juju_model.cpe-focal.name @@ -92,12 +128,42 @@ resource "juju_integration" "compute-ovs" { model = juju_model.cpe-focal.name application { - name = juju_application.nova-compute.name + name = juju_application.neutron-openvswitch.name endpoint = "neutron-plugin" } application { - name = juju_application.neutron-openvswitch.name + name = juju_application.nova-compute.name endpoint = "neutron-plugin" } } + +resource "juju_integration" "compute-sysconfig" { + + model = juju_model.cpe-focal.name + + application { + name = juju_application.nova-compute.name + endpoint = "juju-info" + } + + application { + name = juju_application.sysconfig-compute.name + endpoint = "juju-info" + } +} + +resource "juju_integration" "compute-ceph-mon" { + + model = juju_model.cpe-focal.name + + application { + name = juju_application.nova-compute.name + endpoint = "ceph" + } + + application { + name = juju_application.ceph-mon.name + endpoint = "client" + } +} diff --git a/juju/home-maas/07-controllers.tf b/juju/home-maas/07-controllers.tf new file mode 100644 index 0000000..1f92b57 --- /dev/null +++ b/juju/home-maas/07-controllers.tf @@ -0,0 +1,57 @@ +resource "juju_application" "controller-server" { + name = "controller-server" + + model = juju_model.cpe-focal.name + + charm { + name = "ubuntu" + channel = "latest/stable" + revision = "24" + } + + units = 6 + placement = "${join(",",sort([ + juju_machine.all_machines["100"].machine_id, + juju_machine.all_machines["101"].machine_id, + juju_machine.all_machines["102"].machine_id, + juju_machine.all_machines["103"].machine_id, + juju_machine.all_machines["104"].machine_id, + juju_machine.all_machines["105"].machine_id, + ]))}" + +} + +resource "juju_application" "sysconfig-control" { + name = "sysconfig-control" + + model = juju_model.cpe-focal.name + + charm { + name = "sysconfig" + channel = "latest/stable" + revision = "22" + } + + config = { + governor = "performance" + enable-pti = "on" + update-grub = "true" + enable-tsx = "true" + } +} + +resource "juju_integration" "control-sysconfig" { + + model = juju_model.cpe-focal.name + + application { + name = juju_application.controller-server.name + endpoint = "juju-info" + } + + application { + name = juju_application.sysconfig-control.name + endpoint = "juju-info" + } +} + diff --git a/juju/home-maas/08-neutron.tf b/juju/home-maas/08-neutron.tf new file mode 100644 index 0000000..2896253 --- /dev/null +++ b/juju/home-maas/08-neutron.tf @@ -0,0 +1,30 @@ +resource "juju_application" "neutron-gateway" { + name = "neutron-gateway" + + model = juju_model.cpe-focal.name + + charm { + name = "neutron-gateway" + channel = "ussuri/stable" + } + + units = 3 + placement = "${join(",",sort([ + juju_machine.all_machines["100"].machine_id, + juju_machine.all_machines["101"].machine_id, + juju_machine.all_machines["102"].machine_id, + ]))}" + + + config = { + worker-multiplier = var.worker-multiplier + openstack-origin = var.openstack-origin + bridge-mappings = var.bridge-mappings + data-port = var.data-port + aa-profile-mode = "enforce" + dns-servers = var.dns-servers + customize-failure-domain = var.customize-failure-domain + } +} + + diff --git a/juju/home-maas/terraform.tfvars b/juju/home-maas/terraform.tfvars index 4b20ae8..5a0a1d6 100644 --- a/juju/home-maas/terraform.tfvars +++ b/juju/home-maas/terraform.tfvars @@ -19,3 +19,6 @@ machines = [ ] osd-devices = "/dev/sdb /dev/sdc" +data-port = "br-data:ens9" +bridge-mappings = "physnet1:br-data" +dns-servers = "192.168.1.13" diff --git a/openstack/00-init.tf b/openstack/00-init.tf index 3e82c65..d0c1f0e 100644 --- a/openstack/00-init.tf +++ b/openstack/00-init.tf @@ -3,7 +3,7 @@ terraform { required_providers { openstack = { source = "terraform-provider-openstack/openstack" - version = "1.49.0" + version = "1.52.1" } } }