[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/03: hydra: node-129: Expose the SSDs as a new RAID 10 Btrfs array.
From: |
Maxim Cournoyer |
Subject: |
02/03: hydra: node-129: Expose the SSDs as a new RAID 10 Btrfs array. |
Date: |
Wed, 17 May 2023 23:16:49 -0400 (EDT) |
apteryx pushed a commit to branch master
in repository maintenance.
commit 3c8c7e5af0d259d659f20f2156e73d66b7ef4091
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Wed May 17 16:07:31 2023 -0400
hydra: node-129: Expose the SSDs as a new RAID 10 Btrfs array.
* hydra/deploy-node-129.scm (%btrfs-ssd-raid10-uuid): New variable.
(%btrfs-pool-san): Relocate mount point to /mnt/btrfs-pool-san.
(%btrfs-pool-ssd): New variable.
(btrfs-subvolume-mount): Support a #:device-uuid argument.
(node-129-os) [file-systems]: Add %btrfs-pool-ssd. Mount the
@publish-mirror subvolume to /srv/publish/substitutes.
---
hydra/deploy-node-129.scm | 33 +++++++++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/hydra/deploy-node-129.scm b/hydra/deploy-node-129.scm
index 2122e66..77f574c 100644
--- a/hydra/deploy-node-129.scm
+++ b/hydra/deploy-node-129.scm
@@ -47,20 +47,35 @@
(define %common-btrfs-options '(("compress" . "zstd")
("space_cache" . "v2")))
+(define %btrfs-ssd-uuid "43c70fb3-c587-49b7-9c8d-23356d656fae")
+
(define %btrfs-pool-san
(file-system
(device (uuid %btrfs-san-uuid))
- (mount-point "/mnt/btrfs-pool")
+ (mount-point "/mnt/btrfs-pool-san")
(create-mount-point? #t)
(type "btrfs")
(options (alist->file-system-options
(cons '("subvolid" . "5")
%common-btrfs-options)))))
-(define (btrfs-subvolume-mount name mount-point)
- "Return a file system to mount the Btrfs subvolume NAME at MOUNT-POINT."
+(define %btrfs-pool-ssd
(file-system
- (device (uuid %btrfs-san-uuid))
+ (device (uuid %btrfs-ssd-uuid))
+ (mount-point "/mnt/btrfs-pool-ssd")
+ (create-mount-point? #t)
+ (type "btrfs")
+ (options (alist->file-system-options
+ (cons '("subvolid" . "5")
+ %common-btrfs-options)))))
+
+(define* (btrfs-subvolume-mount name mount-point
+ #:key (device-uuid %btrfs-san-uuid))
+ "Return a file system to mount the Btrfs subvolume NAME at
+MOUNT-POINT. DEVICE-UUID can be provided to use a different Btrfs file
+system than the default one hosted on the SAN storage."
+ (file-system
+ (device (uuid device-uuid))
(mount-point mount-point)
(create-mount-point? #t)
(type "btrfs")
@@ -172,10 +187,20 @@ devices {
(mount-point "/boot/efi2")
(device (uuid "FCDB-FA3A" 'fat)) ;/dev/sdb2
(type "vfat"))
+
%btrfs-pool-san ;for convenience
(btrfs-subvolume-mount "@root" "/")
(btrfs-subvolume-mount "@home" "/home")
(btrfs-subvolume-mount "@cache" "/var/cache")
+
+ %btrfs-pool-ssd
+ ;; The renameat2 trick only works on the parent
+ ;; of an active mount point, not on the mount
+ ;; point itself, so introduce a 'publish' parent
+ ;; directory.
+ (btrfs-subvolume-mount "@publish-mirror"
+ "/srv/publish/substitutes"
+ #:device-uuid %btrfs-ssd-uuid)
%base-file-systems))
(services
(cons* (simple-service 'copy-kernel+initrd-to-/boot