Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
a11b9ed
nix: add option to disable destructive database setup
pkr4711 Aug 3, 2026
c253407
nix: add self build openstack-client to system packages
pkr4711 Aug 3, 2026
628cbf8
nix: move database setup into a separate script
pkr4711 Aug 4, 2026
2029a9c
nix: move keystone setup into a separate script
pkr4711 Aug 4, 2026
70c1dec
nix: move glance setup into a separate script
pkr4711 Aug 4, 2026
c443595
nix: write default credentials into a separate script
pkr4711 Aug 4, 2026
c542c37
nix: move cinder setup into a separate script
pkr4711 Aug 4, 2026
9f885eb
nix: move placement setup into a separate script
pkr4711 Aug 4, 2026
c484c7f
nix: move nova setup into a separate script
pkr4711 Aug 4, 2026
2f4006a
nix: move neutron setup into a separate script
pkr4711 Aug 4, 2026
ac7e227
nix: rename generated scripts
pkr4711 Aug 4, 2026
2b677f4
nix: rename generated scripts
pkr4711 Aug 4, 2026
f8ff827
nix: split database script into create and cleanup
pkr4711 Aug 5, 2026
47dac0b
nix: disable services but create all configurations and systemd units
pkr4711 Aug 5, 2026
46645a4
nix: disable services but create all configurations and systemd units
pkr4711 Aug 5, 2026
1791381
nix: disable services but create all configurations and systemd units
pkr4711 Aug 5, 2026
6fbfa10
nix: rename mysql command and stop services before setup its database
pkr4711 Aug 6, 2026
3010c1f
nix: disable services but create all configurations and systemd units
pkr4711 Aug 6, 2026
d6c64f3
nix: fix mysql database permissions
pkr4711 Aug 6, 2026
6e36c70
nix: keystone configuration
pkr4711 Aug 6, 2026
00cab96
nix: change enabled logic of glance-api service
pkr4711 Aug 6, 2026
b7e9222
nix: change cinder-api deployment to a uwsgi vassal
pkr4711 Aug 6, 2026
bfa0a38
nix: fix cinder setup in CI/CD context
pkr4711 Aug 7, 2026
71b1847
nix: change placement-api deployment to a uwsgi vassal
pkr4711 Aug 7, 2026
916a788
nix: nix cinder listen addresses
pkr4711 Aug 7, 2026
410a053
nix: move global option into separate file
pkr4711 Aug 7, 2026
752bb71
nix: production setup for cinder-storage-node
pkr4711 Aug 7, 2026
a50cbfa
nix: production setup for compute-node
pkr4711 Aug 7, 2026
bb29321
nix: prod setup neutron-openvswitch-agent
pkr4711 Aug 10, 2026
b225d86
nix: fix listen address placement service
pkr4711 Aug 11, 2026
e563749
nix: fix glance persistent directories after reboot
pkr4711 Aug 11, 2026
4c2cd88
nix: add check script for quick controller status
pkr4711 Aug 11, 2026
a1e88f3
nix: fix cinder persistent directories after reboot
pkr4711 Aug 12, 2026
5c666bf
nix: add cinder volume setup script
pkr4711 Aug 12, 2026
5d0c01e
nix: fix nova-compute persistent directories after reboot
pkr4711 Aug 12, 2026
631b17d
nix: add environment config option to cinder
pkr4711 Aug 13, 2026
8801e35
nix: add environment config option to glance
pkr4711 Aug 13, 2026
109f6d6
nix: add environment config option to horizon
pkr4711 Aug 13, 2026
5bcb923
nix: add environment config option to keystone
pkr4711 Aug 13, 2026
858d244
nix: add environment config option to placement
pkr4711 Aug 13, 2026
a44e4b4
nix: fix neutron configuration symlinks
pkr4711 Aug 17, 2026
665ea78
nix: explicitly enable uplink interfaces
pkr4711 Aug 17, 2026
fce3505
nix: update file content after configuration update
pkr4711 Aug 24, 2026
24e88d7
nix: add package designate
pkr4711 Aug 26, 2026
6fe4fe6
nix: add module designate with external knot dns server backend
pkr4711 Aug 27, 2026
d108a90
nix: add e2fsprogs to nova-compute systemd unit
pkr4711 Aug 28, 2026
deca0a4
nix: fix neutron runtime directory setup on controller
pkr4711 Aug 28, 2026
d1406d5
nix: storage module - make path of exported filesystem configurable
pkr4711 Sep 7, 2026
f152934
nix: storage module - add new configuration option: controllerHostname
pkr4711 Sep 7, 2026
b738f7b
nix: storage module - move configuration option into global namespace
pkr4711 Sep 7, 2026
5d9e374
nix: compute module - use new configuration option: controllerHostname
pkr4711 Sep 7, 2026
1396dc2
nix: controller module
pkr4711 Sep 7, 2026
5717263
nix: fix systemd-tmpfiles settings for a production deployment
pkr4711 Sep 8, 2026
ce865dd
nix: designate update
pkr4711 Sep 8, 2026
3491051
nix: fix generated configuration file name
pkr4711 Sep 8, 2026
977a825
nix: use configuration as my_ip value
pkr4711 Sep 8, 2026
c5a1950
nix: storage module - settings
pkr4711 Sep 8, 2026
9da47ae
nix: storage module - move rootwrap configuration into a config option
pkr4711 Sep 8, 2026
4d20366
nix: add option to specify live migration ip address
pkr4711 Sep 9, 2026
f4a0492
nix: more failure resistant script
pkr4711 Sep 15, 2026
8afbfa6
nix: fix typo and more failsafe setup script
pkr4711 Sep 15, 2026
803ac1c
nix: standardize nfs configuration
pkr4711 Sep 15, 2026
b7ce1c6
nix: fix linting
pkr4711 Sep 15, 2026
5314c68
nix: enable caching in keystone
pkr4711 Sep 17, 2026
7d45eb5
nix: fix keystone urls in all services
pkr4711 Sep 17, 2026
fe90f2e
nix: set mariadb max_connections to 500
pkr4711 Sep 17, 2026
60dded9
nix: removed knot3 backend
pkr4711 Sep 18, 2026
598f982
nix: run database cleanup in CI/CD
pkr4711 Sep 18, 2026
dc73faa
nix: bugifxes storage node
pkr4711 Sep 18, 2026
1eb42ce
nix: add openstack packages into system path
pkr4711 Sep 18, 2026
b1f479d
nix: fix neutron-openvswitch-agent systemd unit dependency
pkr4711 Sep 23, 2026
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
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
python3Packages
writeText
lib
libredirect
;
};

Expand Down
1 change: 1 addition & 0 deletions modules/compute/compute.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{ ... }:
{
imports = [
../generic/global-options.nix
../generic/controller-host-entry.nix
(import ./neutron.nix { inherit neutron; })
(import ./nova.nix { inherit nova; })
Expand Down
42 changes: 36 additions & 6 deletions modules/compute/neutron.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let
debug = false
# File name for the paste.deploy config for api service (string value)
api_paste_config = ${neutron}/etc/neutron/api-paste.ini
transport_url = rabbit://openstack:openstack@controller
transport_url = rabbit://openstack:openstack@${config.openstack.controllerHostname}
log_dir = /var/log/neutron

[agent]
Expand All @@ -50,6 +50,30 @@ let
filterPath = "/etc/neutron/rootwrap.d";
inherit utils_env;
};

openvswitchPrepareScript = pkgs.writeShellScript "openvswitch-setup.sh" ''
export PATH=${
lib.makeBinPath [
pkgs.openvswitch
]
}:$PATH

ovs-vsctl br-exists br-provider >/dev/null
status=$?

if [[ $status -eq 0 ]]; then
echo "br-provider already exists. No further setup tasks."
else
echo "br-provider didn't exist already. Proceed with basic setup."
set -euxo pipefail
ovs-vsctl add-br br-provider
fi
ovs-vsctl --may-exist add-port br-provider ${cfg.providerInterface}

# enable uplink provider interface
ip link set dev ${cfg.providerInterface} up
'';

in
{
options.neutron = {
Expand All @@ -68,6 +92,13 @@ in
The Neutron OpenVSwitch config.
'';
};
openvswitchPrepare = mkOption {
default = openvswitchPrepareScript;
description = ''
Default OpenVswitch prepare script of systemd unit: neutron-openvswitch-agent.service
This prepare script creates the basic openvswitch setup.
'';
};
providerInterface = mkOption {
default = "eth2";
type = types.str;
Expand All @@ -78,7 +109,7 @@ in
};
};

config = mkIf cfg.enable {
config = {
users.extraUsers.neutron = {
group = "neutron";
isSystemUser = true;
Expand Down Expand Up @@ -136,6 +167,7 @@ in
after = [
"network.target"
"ovsdb.service"
"systemd-networkd.service"
];
wantedBy = [ "multi-user.target" ];
path = with pkgs; [
Expand All @@ -150,14 +182,12 @@ in
conntrack-tools
];
serviceConfig = {
ExecStartPre = pkgs.writeShellScript "neutron-openvswitch-agent-pre.sh" ''
${pkgs.openvswitch}/bin/ovs-vsctl add-br br-provider
${pkgs.openvswitch}/bin/ovs-vsctl add-port br-provider ${cfg.providerInterface}
'';
ExecStartPre = "${cfg.openvswitchPrepare}";
ExecStart = pkgs.writeShellScript "neutron-openvswitch-agent.sh" ''
${neutron}/bin/neutron-openvswitch-agent --config-file=${cfg.config} --config-file=${cfg.openvswitchConfig}
'';
};
enable = cfg.enable;
};
};
}
32 changes: 17 additions & 15 deletions modules/compute/nova.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ let
state_path = /var/lib/nova
rootwrap_config = ${rootwrapConf}
compute_driver = libvirt.LibvirtDriver
my_ip = 10.0.0.39
transport_url = rabbit://openstack:openstack@controller
my_ip = ${config.openstack.myIp}
transport_url = rabbit://openstack:openstack@${config.openstack.controllerHostname}

[api]
auth_strategy = keystone
Expand All @@ -38,12 +38,12 @@ let
connection = sqlite:////var/lib/nova/nova.sqlite

[glance]
api_servers = http://controller:9292
api_servers = http://${config.openstack.controllerHostname}:9292

[keystone_authtoken]
www_authenticate_uri = http://controller:5000/
auth_url = http://controller:5000/
memcached_servers = controller:11211
www_authenticate_uri = http://${config.openstack.controllerHostname}:5000/v3
auth_url = http://${config.openstack.controllerHostname}:5000/v3
memcached_servers = ${config.openstack.controllerHostname}:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
Expand All @@ -55,7 +55,7 @@ let
virt_type = kvm

[neutron]
auth_url = http://controller:5000
auth_url = http://${config.openstack.controllerHostname}:5000/v3
auth_type = password
project_domain_name = Default
user_domain_name = Default
Expand All @@ -76,13 +76,13 @@ let
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
auth_url = http://${config.openstack.controllerHostname}:5000/v3
username = placement
password = placement

[service_user]
send_service_user_token = true
auth_url = http://controller:5000/
auth_url = http://${config.openstack.controllerHostname}:5000/v3
auth_strategy = keystone
auth_type = password
project_domain_name = Default
Expand Down Expand Up @@ -146,7 +146,7 @@ in
};
};

config = mkIf cfg.enable {
config = {
users.extraUsers.nova = {
group = "nova";
isSystemUser = true;
Expand All @@ -162,28 +162,28 @@ in
systemd.tmpfiles.settings = {
"10-nova" = {
"/var/log/nova" = {
D = {
d = {
group = "nova";
mode = "0755";
user = "nova";
};
};
"/var/lock/nova" = {
D = {
d = {
group = "nova";
mode = "0755";
user = "nova";
};
};
"/var/lib/nova" = {
D = {
d = {
group = "nova";
mode = "0755";
user = "nova";
};
};
"/var/lib/nova/instances" = {
D = {
d = {
group = "nova";
mode = "0755";
user = "nova";
Expand All @@ -194,7 +194,7 @@ in
};

services.openiscsi = {
enable = true;
enable = cfg.enable;
name = "iqn.iscsi.${config.networking.hostName}";
};

Expand All @@ -220,6 +220,7 @@ in
lvm2
openiscsi
nfs-utils
e2fsprogs
]
++ cfg.extraPkgs;
environment.PYTHONPATH = "${nova_env}/${pkgs.python3.sitePackages}";
Expand All @@ -228,6 +229,7 @@ in
${cfg.novaPackage}/bin/nova-compute --config-file=${cfg.config}
'';
};
enable = cfg.enable;
};
};
}
72 changes: 59 additions & 13 deletions modules/controller/cinder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ with lib;
let
cfg = config.cinder;

cinderConf = pkgs.writeText "cinder-api.conf" ''
cinderConf = pkgs.writeText "cinder.conf" ''
[DEFAULT]
transport_url = rabbit://openstack:openstack@controller
transport_url = rabbit://openstack:openstack@${config.openstack.controllerHostname}
auth_strategy = keystone
my_ip = controller
my_ip = ${config.openstack.controllerIP}
verify_glance_signatures = disabled

[database]
connection = mysql+pymysql://cinder:cinder@controller/cinder
connection = mysql+pymysql://cinder:cinder@${config.openstack.controllerHostname}/cinder

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
www_authenticate_uri = http://${config.openstack.controllerHostname}:5000/v3
auth_url = http://${config.openstack.controllerHostname}:5000/v3
memcached_servers = ${config.openstack.controllerHostname}:11211
auth_type = password
project_domain_name = default
user_domain_name = default
Expand Down Expand Up @@ -56,8 +56,26 @@ in
The OpenStack Cinder package to use.
'';
};
envCinderApi = mkOption {
type = types.listOf types.str;
default = [
"PYTHONWARNINGS=ignore::DeprecationWarning"
"PATH=$PATH:/run/current-system/sw/bin"
];
description = ''
Environment variables passed to the cinder-api uWSGI vassal.
'';
};
envCinderScheduler = mkOption {
default = {
PYTHONWARNINGS = "ignore::DeprecationWarning";
};
description = ''
Environment variables passed to the cinder-scheduler systemd unit.
'';
};
};
config = mkIf cfg.enable {
config = {

users.extraUsers.cinder = {
group = "cinder";
Expand All @@ -71,21 +89,21 @@ in
systemd.tmpfiles.settings = {
"10-cinder" = {
"/var/lib/cinder/" = {
D = {
d = {
user = "cinder";
group = "cinder";
mode = "0755";
};
};
"/var/lib/cinder/volumes" = {
D = {
d = {
user = "cinder";
group = "cinder";
mode = "0755";
};
};
"/var/log/cinder/" = {
D = {
d = {
user = "cinder";
group = "cinder";
mode = "0755";
Expand All @@ -98,13 +116,14 @@ in
};
"/etc/cinder/cinder.conf" = {
L = {
argument = "${cinderConf}";
argument = "${cfg.config}";
};
};
};
};

systemd.services.cinder-api = {
# create systemd service only if running in non production mode (CI/CD setup)
systemd.services.cinder-api = lib.mkIf (!config.openstack.production_setup) {
description = "OpenStack Cinder API Daemon";
after = [
"cinder.service"
Expand All @@ -121,6 +140,31 @@ in
.cinder-wsgi-wrapped --port 8776
'';
};
enable = cfg.enable;
};

# create uwsgi vassal configuration only in production setup
services.uwsgi = lib.mkIf (config.openstack.production_setup) {
instance.vassals.cinder-api = mkIf cfg.enable {
type = "normal";
http-socket = "0.0.0.0:8776";
wsgi-file = "${cinder}/bin/.cinder-wsgi-wrapped";
pyargv = "--config-file ${cfg.config}";
env = cfg.envCinderApi;

master = true;
processes = 4;
enable-threads = true;
thunder-lock = true;
lazy-apps = true;
die-on-term = true;
vacuum = true;
need-app = true;
buffer-size = 65535;

immediate-uid = "cinder";
immediate-gid = "cinder";
};
};

systemd.services.cinder-scheduler = {
Expand All @@ -140,6 +184,8 @@ in
.cinder-scheduler-wrapped
'';
};
enable = cfg.enable;
environment = cfg.envCinderScheduler;
};
};
}
Loading
Loading