Closed thomashoneyman closed 4 years ago
@thomashoneyman: You might want to report this as a bug against the nixops
repository, referencing this repository as a reproducing test case. This seems like nixops
is sometimes not respecting the ebsInitialRootDiskSize
option
@Gabriel439 I've created and linked an issue in the nixops
repository. If it seems like we're correct and the issue is there then I'll close this issue; in the meantime I'll leave this open.
I've confirmed that the simple-twitter deployment works IF built on a Linux machine, because in that case the build occurs on the user's machine and only the closure is copied over to the EC2 (taking 2.2GB of space in total).
Users will only encounter this disk size issue if building on a non-Linux machine. In that case the build takes place on the EC2 which requires more disk space.
I can also confirm that I can use the ebsInitialRootDiskSize
option in versions of NixOps after 1.6 (I was using 1.7) if NixOps is built with the aws
plugin.
NixOps versions until 1.6 shipped with options for various cloud providers available, including AWS. After that version, though, cloud providers were split out into various "plugins" and only if the plugin is installed do you get access to the options. The AWS plugin exists in the separate nixops-aws repository.
If I clone the master branch of the NixOps repository and build it with this command:
$ nix-build release.nix -A build.x86_64-linux --arg p "(p: [ p.aws ])"
and then re-deploy with ebsInitialRootDiskSize = 20;
then I properly see a 20GB volume.
Given that I'm now able to deploy this from MacOS by bumping up the disk size using the master branch of NixOps or from a Linux machine without having to do anything else, I'm going to close this issue.
When I attempt to deploy an EC2 instance using the readme commands, the following error prevents the deploy from succeeding:
Steps to reproduce
I cloned the repository and made sure nixops was available in my environment with:
This provides, on my system,
nixops-1.7
. Next, I followed the readme commands:This appears to build briefly on my machine and then begin copying files over to the new EC2 via SSH. Next, the 'no space left on device' error appears.
Troubleshooting
I tried bumping up the available space by switching to a
t2.micro
instance and bumping the disk space from the default of 8gb to 50gb instead:However, this fails again with the same error. I checked the disk space on the target system:
Here, it looks like
/dev/disk/by-label/nixos
has used 100% of the 3gb available and that's mounted at/
; I checked lsblk as well:So I certainly don't seem to have 50gb available, despite the use of
ebsInitialRootDiskSize = 50
. Instead, it looks like just 3gb is available. According to the manual for ebsInitialRootDiskSize:From this I expect that 3gb is the default size given to a
t2.nano
ort2.micro
instance and thatebsInitialRootDiskSize = 50
would override that and produce a 50gb volume, but that doesn't appear to be the case.Given only 3gb of disk space I am not surprised that this deploy would run out of disk space, but I am surprised that you were able to deploy this without seeing a similar error.
If I then use
nix-collect-garbage
on the destination machine:it does appear that the limited 3gb disk is the reason this is failing.