From 862fe5ad784700a959c1e8552eb31355cedf2888 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 11 May 2011 13:52:49 +0000 Subject: [PATCH] * Generate a nova.conf file. * Provide a configuration.nix in Nova images. svn path=/nixos/trunk/; revision=27224 --- modules/virtualisation/nova-config.nix | 5 +++++ modules/virtualisation/nova-image.nix | 11 +---------- modules/virtualisation/nova.nix | 16 +++++++++++----- 3 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 modules/virtualisation/nova-config.nix diff --git a/modules/virtualisation/nova-config.nix b/modules/virtualisation/nova-config.nix new file mode 100644 index 00000000000..df41f8f88af --- /dev/null +++ b/modules/virtualisation/nova-config.nix @@ -0,0 +1,5 @@ +{ config, pkgs, modulesPath, ... }: + +{ + require = [ "${modulesPath}/virtualisation/nova-image.nix" ]; +} diff --git a/modules/virtualisation/nova-image.nix b/modules/virtualisation/nova-image.nix index 3b3fa28d6bb..f61801e4c64 100644 --- a/modules/virtualisation/nova-image.nix +++ b/modules/virtualisation/nova-image.nix @@ -57,7 +57,7 @@ with pkgs.lib; # Install a configuration.nix. mkdir -p /mnt/etc/nixos - #cp ${./amazon-config.nix} /mnt/etc/nixos/configuration.nix + cp ${./nova-config.nix} /mnt/etc/nixos/configuration.nix # Generate the GRUB menu. chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot @@ -71,17 +71,8 @@ with pkgs.lib; [ { mountPoint = "/"; device = "/dev/disk/by-label/nixos"; } - #{ mountPoint = "/ephemeral0"; - # device = "/dev/xvdc"; - # neededForBoot = true; - #} ]; - /* - swapDevices = - [ { device = "/dev/xvdb"; } ]; - */ - boot.kernelParams = [ "console=ttyS0" ]; boot.initrd.kernelModules = [ "aufs" ]; diff --git a/modules/virtualisation/nova.nix b/modules/virtualisation/nova.nix index f9f6af0b0e2..6b0276f76c6 100644 --- a/modules/virtualisation/nova.nix +++ b/modules/virtualisation/nova.nix @@ -10,6 +10,12 @@ let nova = pkgs.nova; + novaConf = pkgs.writeText "nova.conf" + '' + --nodaemon + --verbose + ''; + in { @@ -87,7 +93,7 @@ in # required to generate key pairs. path = [ pkgs.openssl pkgs.openssh ]; - exec = "${nova}/bin/nova-api"; + exec = "${nova}/bin/nova-api --flagfile=${novaConf}"; }; # `nova-objectstore' is a simple image server. Useful if you're @@ -105,7 +111,7 @@ in mkdir -m 700 -p /var/lib/nova/images ''; - exec = "${nova}/bin/nova-objectstore --nodaemon"; + exec = "${nova}/bin/nova-objectstore --flagfile=${novaConf}"; }; # `nova-scheduler' schedules VM execution requests. @@ -116,7 +122,7 @@ in startOn = "ip-up"; - exec = "${nova}/bin/nova-scheduler --nodaemon --verbose"; + exec = "${nova}/bin/nova-scheduler --flagfile=${novaConf}"; }; # `nova-compute' starts and manages virtual machines. @@ -132,7 +138,7 @@ in pkgs.e2fsprogs pkgs.utillinux pkgs.multipath_tools ]; - exec = "${nova}/bin/nova-compute --nodaemon --verbose"; + exec = "${nova}/bin/nova-compute --flagfile=${novaConf}"; }; # `nova-network' manages networks and allocates IP addresses. @@ -148,7 +154,7 @@ in pkgs.iproute pkgs.bridge_utils pkgs.radvd ]; - exec = "${nova}/bin/nova-network --nodaemon --verbose"; + exec = "${nova}/bin/nova-network --flagfile=${novaConf}"; }; };