Skip to content
Snippets Groups Projects
Unverified Commit 58f4beef authored by Jean-Paul Calderone's avatar Jean-Paul Calderone Committed by GitHub
Browse files

Merge pull request #17 from PrivateStorageio/privatestorageops#182.redeploy-testing-storage-node

Redeploy the testing grid staging node on a new, more stable host.
parents 59374a1d 89fb172b
No related branches found
No related tags found
No related merge requests found
......@@ -43,10 +43,42 @@ Each such file contains a minimal Nix expression supplying critical system confi
"Critical" roughly corresponds to anything which must be specified to have a bootable system.
These files are referenced by the corresponding ``<hostname>.nix`` files.
<hostname>.nix
--------------
Configuring New Storage Nodes
-----------------------------
Storage nodes are brought into the grid in a multi-step process.
Here are the steps to configure a new node,
starting from a minimal NixOS 19.03 or 19.09 installation.
#. Copy ``/etc/nixos/hardware-configuration.nix`` to ``storageNNN-hardware.nix``.
In the case of an EC2 instance, copy ``/etc/nixos/configuration.nix`` instead.
#. Add ``"zfs"`` to ``boot.supportedFilesystems`` in ``storageNNN-hardware.nix``.
#. Create a ``storageNNN-config.nix`` containing further configuration for the new host.
#. Add an entry for the new host to ``grid.nix`` referencing the new files.
#. Deploy to the new host with ``morph deploy morph/grid.nix --on <identifier> boot``.
There will likely be some errors from ZFS-related systemd units which cannot yet succeed because the kernel lacks ZFS support.
#. Log on to the new host and reboot it.
#. Log on to the new host and manually create a storage zpool::
zpool create -m legacy -o ashift=12 root raidz /dev/disk/by-id/{...}
#. Mount the new ZFS filesystem to verify it is working::
mkdir /storage
mount -t zfs root /storage
#. Add a new filesystem entry to ``storageNNN-hardware.nix``::
# Manually created using:
# zpool create -f -m legacy -o ashift=12 root raidz ...
fileSystems."/storage" = {
device = "root";
fsType = "zfs";
};
#. Deploy the new configuration to the host::
morph deploy morph/grid.nix --on <identifier> switch --reboot
Each such file contains the parts of the system configuration that aren't *so* related to hardware.
They are referenced from ``grid.nix``.
.. _`morph`: https://github.com/DBCDK/morph
{ publicIPv4, publicStoragePort, ristrettoSigningKeyPath, ... }: rec {
{ publicIPv4, hardware, publicStoragePort, ristrettoSigningKeyPath, stateVersion, ... }: rec {
deployment = {
secrets = {
......@@ -17,7 +17,7 @@
};
imports = [
./testing000-hardware.nix
hardware
../nixos/modules/private-storage.nix
];
......@@ -27,4 +27,6 @@
inherit publicStoragePort;
ristrettoSigningKeyPath = deployment.secrets.ristretto-signing-key.destination;
};
system.stateVersion = stateVersion;
}
......@@ -10,8 +10,10 @@ import ./make-grid.nix {
stateVersion = "19.03";
} // cfg);
"35.157.216.200" = import ./testing000.nix (cfg // {
publicIPv4 = "35.157.216.200";
"3.120.26.190" = import ./make-testing.nix (cfg // {
publicIPv4 = "3.120.26.190";
hardware = ./testing001-hardware.nix;
stateVersion = "19.03";
});
};
}
{
imports = [
<nixpkgs/nixos/modules/virtualisation/amazon-image.nix>
];
config.ec2.hvm = true;
}
{
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
ec2.hvm = true;
boot.supportedFilesystems = [ "zfs" ];
networking.hostId = "10000000";
# Manually created using:
# zpool create -m legacy -o ashift=12 root raidz /dev/disk/by-id/{nvme-nvme.1d0f-766f6c3038623133353836383465643436363430-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001,nvme-nvme.1d0f-766f6c3034653531383066303134633436653034-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001,nvme-nvme.1d0f-766f6c3062333164633831386366623231373730-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001,nvme-nvme.1d0f-766f6c3061353939623438336661353933636664-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001}
fileSystems."/storage" = {
device = "root";
fsType = "zfs";
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment