| 1 Jul 2024 |
Arian | That ifconfig suggests ipv6 is disabled
| 21:34:57 |
Arian | You don't have an ipv6 address assigned | 21:35:09 |
Arian | So you must have run into something else | 21:35:22 |
@AleXoundOS:matrix.org | In reply to @arianvp:matrix.org
That ifconfig suggests ipv6 is disabled
(I meant it's enabled in Linux kernel.) | 21:37:21 |
Arian | I'm talking about enabling it in AWS. As it's a known bug. | 22:52:43 |
| 5 Jul 2024 |
| @miangraham:matrix.org joined the room. | 03:12:04 |
| 9 Jul 2024 |
| @sbc64:matrix.org joined the room. | 16:49:46 |
| 10 Jul 2024 |
| @miangraham:matrix.org left the room. | 00:36:08 |
| 20 Jul 2024 |
| Mic92 joined the room. | 10:39:23 |
| 22 Jul 2024 |
| Luke joined the room. | 22:24:00 |
| 23 Jul 2024 |
| Ezzobir Bezziou joined the room. | 08:21:01 |
| 29 Jul 2024 |
| Philip joined the room. | 19:09:41 |
Philip | Hello all! I've set up NixOS on AWS by booting into a NixOS AMI, then doing nixos-install onto a custom EBS volume. After that, I switched the boot device of my EC2 instance from the AMI-created temporary EBS volume to my new custom volume and booting the instance from it.
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 |
Arian | There is no need to do this. The AMI is a proper NixOS installation | 19:43:21 |
Arian | you can just do nixos-rebuild switch on the existing EBS volume | 19:43:27 |
Arian | Note that the AMI is and EBS volume already
| 19:44:04 |
Arian | it’s a pointer to an EBS snapshot; that then gets mounted as an EBS volume | 19:44:17 |
Arian | What exactly are you trying ot do? | 19:45:04 |
Arian | 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 |
Arian | e.g. if you’re using Terraform:
data "aws_ami" "nixos_arm64" {
owners = ["427812963091"]
most_recent = true
filter {
name = "name"
values = ["nixos/24.05*"]
}
filter {
name = "architecture"
values = ["arm64"] # or "x86_64"
}
}
resource “aws_instance” “my_instance” {
ami = data.aws_ami.nixos_arm64.id
instance_type = "t4g.nano"
root_block_device {
volume_size = 500
volume_type = “io2”
}
}
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 |
Arian | EC2 instance must have an associated AMI and Root Block Device. You cant detach it
| 19:49:00 |
| 30 Jul 2024 |
Philip |
What exactly are you trying ot do?
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 |
Arian | You can set this as an option on the instance | 16:09:45 |
Arian | https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#delete_on_termination | 16:10:02 |
Arian | set delete_on_termination to false. it will keep the volume around
| 16:10:23 |
Arian | Note that you can resize instances without destroying the instance | 16:10:33 |
Arian | resize just causes the machine to reboot. | 16:10:43 |
Arian | You can also take a snapshot of your volume and then turn that into an AMI again if you want | 16:11:10 |
Arian | 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 |
Arian | 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 |