From 3836e8eb02af239c99d70d9b7fe1497d0906e04a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 7 Apr 2011 09:59:11 +0000 Subject: [PATCH] * Properly initialise Nova's state. svn path=/nixos/trunk/; revision=26735 --- modules/virtualisation/nova.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/virtualisation/nova.nix b/modules/virtualisation/nova.nix index a838f7f63d47..d858e6947a8f 100644 --- a/modules/virtualisation/nova.nix +++ b/modules/virtualisation/nova.nix @@ -41,7 +41,7 @@ in config = mkIf cfg.enableSingleNode { - environment.systemPackages = [ nova ]; + environment.systemPackages = [ nova pkgs.euca2ools ]; environment.etc = [ # The Paste configuration file for nova-api. @@ -56,6 +56,19 @@ in # `qemu-nbd' required the `nbd' kernel module. boot.kernelModules = [ "nbd" ]; + + system.activationScripts.nova = + '' + mkdir -m 700 -p /var/lib/nova + + # Allow the CA certificate generation script (called by + # nova-api) to work. + mkdir -m 700 -p /var/lib/nova/CA /var/lib/nova/CA/private + cp -p ${nova}/libexec/nova/openssl.cnf.tmpl /var/lib/nova/CA/ + + # Initialise the SQLite database. + ${nova}/bin/nova-manage db sync + ''; # `nova-api' receives and executes external client requests from # tools such as euca2ools. It listens on port 8773 (XML) and 8774 @@ -67,6 +80,8 @@ in startOn = "ip-up"; + path = [ pkgs.openssl ]; + exec = "${nova}/bin/nova-api"; };