* Generate a nova.conf file.
* Provide a configuration.nix in Nova images. svn path=/nixos/trunk/; revision=27224
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
{ config, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
require = [ "${modulesPath}/virtualisation/nova-image.nix" ];
|
||||||
|
}
|
||||||
@@ -57,7 +57,7 @@ with pkgs.lib;
|
|||||||
|
|
||||||
# Install a configuration.nix.
|
# Install a configuration.nix.
|
||||||
mkdir -p /mnt/etc/nixos
|
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.
|
# Generate the GRUB menu.
|
||||||
chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot
|
chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot
|
||||||
@@ -71,17 +71,8 @@ with pkgs.lib;
|
|||||||
[ { mountPoint = "/";
|
[ { mountPoint = "/";
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
}
|
}
|
||||||
#{ mountPoint = "/ephemeral0";
|
|
||||||
# device = "/dev/xvdc";
|
|
||||||
# neededForBoot = true;
|
|
||||||
#}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
|
||||||
swapDevices =
|
|
||||||
[ { device = "/dev/xvdb"; } ];
|
|
||||||
*/
|
|
||||||
|
|
||||||
boot.kernelParams = [ "console=ttyS0" ];
|
boot.kernelParams = [ "console=ttyS0" ];
|
||||||
|
|
||||||
boot.initrd.kernelModules = [ "aufs" ];
|
boot.initrd.kernelModules = [ "aufs" ];
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ let
|
|||||||
|
|
||||||
nova = pkgs.nova;
|
nova = pkgs.nova;
|
||||||
|
|
||||||
|
novaConf = pkgs.writeText "nova.conf"
|
||||||
|
''
|
||||||
|
--nodaemon
|
||||||
|
--verbose
|
||||||
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -87,7 +93,7 @@ in
|
|||||||
# required to generate key pairs.
|
# required to generate key pairs.
|
||||||
path = [ pkgs.openssl pkgs.openssh ];
|
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
|
# `nova-objectstore' is a simple image server. Useful if you're
|
||||||
@@ -105,7 +111,7 @@ in
|
|||||||
mkdir -m 700 -p /var/lib/nova/images
|
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.
|
# `nova-scheduler' schedules VM execution requests.
|
||||||
@@ -116,7 +122,7 @@ in
|
|||||||
|
|
||||||
startOn = "ip-up";
|
startOn = "ip-up";
|
||||||
|
|
||||||
exec = "${nova}/bin/nova-scheduler --nodaemon --verbose";
|
exec = "${nova}/bin/nova-scheduler --flagfile=${novaConf}";
|
||||||
};
|
};
|
||||||
|
|
||||||
# `nova-compute' starts and manages virtual machines.
|
# `nova-compute' starts and manages virtual machines.
|
||||||
@@ -132,7 +138,7 @@ in
|
|||||||
pkgs.e2fsprogs pkgs.utillinux pkgs.multipath_tools
|
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.
|
# `nova-network' manages networks and allocates IP addresses.
|
||||||
@@ -148,7 +154,7 @@ in
|
|||||||
pkgs.iproute pkgs.bridge_utils pkgs.radvd
|
pkgs.iproute pkgs.bridge_utils pkgs.radvd
|
||||||
];
|
];
|
||||||
|
|
||||||
exec = "${nova}/bin/nova-network --nodaemon --verbose";
|
exec = "${nova}/bin/nova-network --flagfile=${novaConf}";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user