From a14b89c21d2d49c01875c88933570832b48f9e72 Mon Sep 17 00:00:00 2001 From: Stefan Kober Date: Wed, 10 Sep 2025 12:36:08 +0200 Subject: [PATCH 1/4] controller: start and configure serial proxy In order to have support for `openstack console url show --serial` we have to enable the serial proxy. On-behalf-of: SAP stefan.kober@sap.com --- modules/controller/nova.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/modules/controller/nova.nix b/modules/controller/nova.nix index b4f3d2c..1ea834b 100644 --- a/modules/controller/nova.nix +++ b/modules/controller/nova.nix @@ -50,6 +50,9 @@ let username = nova password = nova + [serial_console] + enabled = true + [vnc] enabled = true server_listen = $my_ip @@ -299,5 +302,30 @@ in TimeoutStopSec = 15; }; }; + + systemd.services.nova-serialproxy = { + description = "OpenStack Nova serial proxy"; + after = [ + "nova.service" + "mysql.service" + "keystone.service" + "rabbitmq.service" + "network-online.target" + ]; + wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + path = [ cfg.novaPackage ]; + serviceConfig = { + User = "nova"; + Group = "nova"; + Type = "simple"; + ExecStart = pkgs.writeShellScript "nova-serialproxy.sh" '' + nova-serialproxy --config-file ${cfg.config} + ''; + Restart = "on-failure"; + LimitNOFILE = 65535; + TimeoutStopSec = 15; + }; + }; }; } From fcf864d96d00368f5a03bc441637d395f315a2b3 Mon Sep 17 00:00:00 2001 From: Stefan Kober Date: Wed, 10 Sep 2025 12:37:20 +0200 Subject: [PATCH 2/4] compute: configure serial console On-behalf-of: SAP stefan.kober@sap.com --- modules/compute/nova.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/compute/nova.nix b/modules/compute/nova.nix index 565a63b..e0baf74 100644 --- a/modules/compute/nova.nix +++ b/modules/compute/nova.nix @@ -91,6 +91,11 @@ let username = nova password = nova + [serial_console] + enabled = true + serialproxy_host = 0.0.0.0 + proxyclient_address = $my_ip + [vnc] enabled = true server_listen = 0.0.0.0 From 69673cab787ee918ac34c83afb6093ff33481ef7 Mon Sep 17 00:00:00 2001 From: Stefan Kober Date: Tue, 16 Sep 2025 08:57:18 +0200 Subject: [PATCH 3/4] nix: allow port forwarding configuration We add a nixos module to the testing modules. This allows configuring ports for port forwarding for the dashboard and the serialproxy. This way, users can access the dashboard and the web serial console on the host when running the OpenStack controller in a VM. On-behalf-of: SAP stefan.kober@sap.com --- modules/testing/default.nix | 51 ++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/modules/testing/default.nix b/modules/testing/default.nix index 413d4ce..5104c0a 100644 --- a/modules/testing/default.nix +++ b/modules/testing/default.nix @@ -38,6 +38,52 @@ let environment.variables = adminEnv; }; }; + + portForwarding = + { config, lib, ... }: + with lib; + let + cfg = config.openstack-testing; + in + { + options.openstack-testing = { + enable = mkEnableOption "Enable port forwarding." // { + default = true; + }; + dashboardHostPort = mkOption { + default = 8080; + type = types.port; + description = '' + Host port to make the OpenStack dashboard accessible when running + the OpenStack controller in a VM. Dashboard can be accessed via: + localhost: + ''; + }; + serialProxyHostPort = mkOption { + default = 6083; + type = types.port; + description = '' + Host port to make the web console feature available for the + OpenStack dashboard. Changing the value might requires to change + the configuration of the dashboard. + ''; + }; + }; + config = mkIf cfg.enable { + virtualisation.forwardPorts = [ + { + from = "host"; + host.port = cfg.dashboardHostPort; + guest.port = 80; + } + { + from = "host"; + host.port = cfg.serialProxyHostPort; + guest.port = 6083; + } + ]; + }; + }; in { testController = @@ -49,7 +95,10 @@ in }; in { - imports = [ common ]; + imports = [ + common + portForwarding + ]; virtualisation = { cores = 4; From 277cac4278ee50a971ebc3832560d9bd60040227 Mon Sep 17 00:00:00 2001 From: Stefan Kober Date: Thu, 2 Oct 2025 13:51:06 +0200 Subject: [PATCH 4/4] doc: explain Horizon dashboard access As we now have configurable port forwarding to the OpenStack dashboard, we add some additional doc around it. On-behalf-of: SAP stefan.kober@sap.com --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b2053b8..f27368a 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,14 @@ nix build .#tests.x86_64-linux..driverInteractive ./result/bin/nixos-test-driver ``` +#### Dashboard access + +The NixOS tests configure some port forwarding in order to allow access to the +OpenStack dashboard. The port forwarding can be configured via +`openstack-testing.dashboardHostPort` and the default host port used is `8080`. +While a NixOS test is running, the dashboard can be accessed via +`127.0.0.1:8080` or the configured host port. + ## Scope OpenStack is a very large and super actively maintained project. We are aware that we cannot keep track of all its development or offer every single configuration option via NixOS modules.