Skip to content

Commit

Permalink
Recreate all user VMs, slightly optimize disk inits
Browse files Browse the repository at this point in the history
Sorry y'all :( it won't happen again
  • Loading branch information
diamondburned committed May 9, 2024
1 parent cfbfc16 commit 78ab038
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions user-machines/vm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ in
# TODO: tainted: high-privileges

config = mkIf self.enable ({
systemd.tmpfiles.rules = [
"d ${self.poolDirectory} 0700 root root -"
];

acm.user-vms.usersInfo = imap0 (i: user: {
id = user.id;
ip = ips.ipFromOffset i;
Expand Down Expand Up @@ -175,10 +171,8 @@ in
if [[ -f "$volumePath" ]]; then
log " volume already exists."
else
log " creating volume..."
# Clone the backing store image to a raw image then grow it.
qemu-img convert -O raw -S 0 ${ubuntu.image} "$volumePath"
log " cloning volume from image ${ubuntu.image}..."
cp --no-preserve=mode,ownership ${mkRawImage ubuntu.image} "$volumePath"
# Disable copy-on-write for performance.
chattr +C "$volumePath" 2> /dev/null || {
Expand Down

0 comments on commit 78ab038

Please sign in to comment.