NixOS AWS | 65 Members | |
| 17 Servers |
| Sender | Message | Time |
|---|---|---|
| 20 Jul 2024 | ||
| 10:39:23 | ||
| 22 Jul 2024 | ||
| 22:24:00 | ||
| 23 Jul 2024 | ||
| 08:21:01 | ||
| 29 Jul 2024 | ||
| 19:09:41 | ||
| Hello all! I've set up NixOS on AWS by booting into a NixOS AMI, then doing Now I have the AMI-created EBS volume still, although it's not attached to anything. I'd like to get rid of it. I think the cleanest way would be to detach the NixOS AMI from the EC2 instance. AFAIK I don't need the AMI anymore, since I have the OS installed to EBS. But I don't find a way to have an EC2 instance without an AMI! Any advice on how to get rid of the AMI or its EBS volume? | 19:14:07 | |
| There is no need to do this. The AMI is a proper NixOS installation | 19:43:21 | |
| you can just do nixos-rebuild switch on the existing EBS volume | 19:43:27 | |
| Note that the AMI is and EBS volume already | 19:44:04 | |
| it’s a pointer to an EBS snapshot; that then gets mounted as an EBS volume | 19:44:17 | |
| What exactly are you trying ot do? | 19:45:04 | |
| if you want to change the EBS volume type; you can do that already without nixos-installing to a different EBS volume. You can select the EBS volume type in the DeviceMapping | 19:45:40 | |
| e.g. if you’re using Terraform:
Will boot the NixOS AMI on an io2 EBS volume of 500GB size. NixOS will resize the partition and file system automatically on first boot | 19:48:04 | |
| EC2 instance must have an associated AMI and Root Block Device. You cant detach it | 19:49:00 | |
| 30 Jul 2024 | ||
I want to install NixOS on an EBS volume that's decoupled from the instance. For example, if I delete the EC2 instance with the NixOS AMI, then the default 4 GB EBS volume gets deleted. I want to be able to replace the instance with something larger or smaller without losing my OS install. | 16:03:41 | |
| You can set this as an option on the instance | 16:09:45 | |
| https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#delete_on_termination | 16:10:02 | |
| set | 16:10:23 | |
| Note that you can resize instances without destroying the instance | 16:10:33 | |
| resize just causes the machine to reboot. | 16:10:43 | |
| You can also take a snapshot of your volume and then turn that into an AMI again if you want | 16:11:10 | |
| the problem is that even if you have the OS on separate instance; it’s not gonna help you. Pretty sure AWS’s EFI Firmware will boot from the root block device first. And creating an instance without an associated AMI is not possible | 16:15:17 | |
| so I’d advice taking a snapshot of your root volume and registering it as a new AMI if you really need to destroy an instance | 16:15:36 | |
| but for most operations the instance doesn’t need to be destroyed. Resizing the volume, resizing the instance etc can all happen without destroying the instance | 16:15:56 | |
| 31 Jul 2024 | ||
| Thanks. This is interesting. I guess I see EC2 and AMIs as the relationship between PCs and CD drives. I insert a CD with the OS installation data. I boot up the PC, then install the OS onto the hard drive. Then I can unplug the CD drive and boot with just the hard drive. | 07:08:43 | |
| So for me, the NixOS AMI is the installation media only, removable. Whereas the attached EBS volume is what boots. Now that I have NixOS installed on my EBS volume and attached, I don't know anymore what value the AMI brings. | 07:09:35 | |
| AMIs are not installation media. They’re fully working operating system snapshots. I would not suggest installing the OS on a secondary EBS volume. If you want to boot a new instance with the old volume you can take a snapshot of the volume and use that as the AMI for the new instance | 17:20:19 | |
| 9 Aug 2024 | ||
| Has anybody used NixOS AMI as part of a CloudFormation product in Marketplace? So, not as SAS, but a consumer gets deployment (including NixOS AMI) in its own AWS Cloud? Are there any special requirements for AMIs which NixOS AMI does not meet in case of Marketplace? | 09:17:16 | |
| I think it should just work? The AMI is public | 10:20:33 | |
| I’m not a 100% sure | 10:24:01 | |
| You might need to clone the AMI into your own account first (e.g. using | 10:24:13 | |