openstack-image-zfs: sizeMB -> virt[...].diskSize
This commit is contained in:
@@ -11,10 +11,25 @@ let
|
|||||||
copyChannel = true;
|
copyChannel = true;
|
||||||
cfg = config.openstackImage;
|
cfg = config.openstackImage;
|
||||||
imageBootMode = if config.openstack.efi then "uefi" else "legacy-bios";
|
imageBootMode = if config.openstack.efi then "uefi" else "legacy-bios";
|
||||||
|
virtualisationOptions = import ../../../modules/virtualisation/virtualisation-options.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../../modules/virtualisation/openstack-config.nix
|
../../../modules/virtualisation/openstack-config.nix
|
||||||
|
virtualisationOptions.diskSize
|
||||||
|
(lib.mkRenamedOptionModuleWith {
|
||||||
|
sinceRelease = 2411;
|
||||||
|
from = [
|
||||||
|
"virtualisation"
|
||||||
|
"openstackImage"
|
||||||
|
"sizeMB"
|
||||||
|
];
|
||||||
|
to = [
|
||||||
|
"virtualisation"
|
||||||
|
"diskSize"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
] ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix);
|
] ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix);
|
||||||
|
|
||||||
options.openstackImage = {
|
options.openstackImage = {
|
||||||
@@ -30,12 +45,6 @@ in
|
|||||||
description = "RAM allocation for build VM";
|
description = "RAM allocation for build VM";
|
||||||
};
|
};
|
||||||
|
|
||||||
sizeMB = mkOption {
|
|
||||||
type = types.int;
|
|
||||||
default = 8192;
|
|
||||||
description = "The size in MB of the image";
|
|
||||||
};
|
|
||||||
|
|
||||||
format = mkOption {
|
format = mkOption {
|
||||||
type = types.enum [
|
type = types.enum [
|
||||||
"raw"
|
"raw"
|
||||||
@@ -61,6 +70,9 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualisation.diskSize = lib.mkDefault (8 * 1024);
|
||||||
|
virtualisation.diskSizeAutoSupported = false;
|
||||||
|
|
||||||
system.build.openstackImage = import ../../../lib/make-single-disk-zfs-image.nix {
|
system.build.openstackImage = import ../../../lib/make-single-disk-zfs-image.nix {
|
||||||
inherit lib config;
|
inherit lib config;
|
||||||
inherit (cfg) contents format name;
|
inherit (cfg) contents format name;
|
||||||
@@ -77,7 +89,7 @@ in
|
|||||||
|
|
||||||
bootSize = 1000;
|
bootSize = 1000;
|
||||||
memSize = cfg.ramMB;
|
memSize = cfg.ramMB;
|
||||||
rootSize = cfg.sizeMB;
|
rootSize = config.virtualisation.diskSize;
|
||||||
rootPoolProperties = {
|
rootPoolProperties = {
|
||||||
ashift = 12;
|
ashift = 12;
|
||||||
autoexpand = "on";
|
autoexpand = "on";
|
||||||
|
|||||||
Reference in New Issue
Block a user