!atvIbxHoEqNcAIxYpN:nixos.org

NixOS AWS

64 Members
14 Servers

Load older messages


SenderMessageTime
1 Jul 2024
@AleXoundOS:matrix.org@AleXoundOS:matrix.org

Yes, I have IPv6 enabled:

# ifconfig
enX0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.117.211  netmask 255.255.128.0  broadcast 10.0.127.255
        inet6 fe80::7b:b7ff:fe6c:ef85  prefixlen 64  scopeid 0x20<link>
        ether 02:7b:b7:6c:ef:85  txqueuelen 1000  (Ethernet)
        RX packets 15051562  bytes 2684395427 (2.5 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9503900  bytes 7788542100 (7.2 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
08:49:07
@arianvp:matrix.orgArianYeh so there is a race condition in the ec2 metadata script21:33:42
@arianvp:matrix.orgArianNetwork-online.target is either reached when ipv6 or ipv4 is ready and our script only reaches out on the metadata server on ipv421:34:18
@arianvp:matrix.orgArianAnd then fails and crashes21:34:24
@arianvp:matrix.orgArian

That ifconfig suggests ipv6 is disabled

21:34:57
@arianvp:matrix.orgArianYou don't have an ipv6 address assigned21:35:09
@arianvp:matrix.orgArianSo you must have run into something else21:35:22
@AleXoundOS:matrix.org@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
@arianvp:matrix.orgArianI'm talking about enabling it in AWS. As it's a known bug. 22:52:43
5 Jul 2024
@miangraham:matrix.org@miangraham:matrix.org joined the room.03:12:04
9 Jul 2024
@sbc64:matrix.org@sbc64:matrix.org joined the room.16:49:46
10 Jul 2024
@miangraham:matrix.org@miangraham:matrix.org left the room.00:36:08
20 Jul 2024
@joerg:thalheim.ioMic92 joined the room.10:39:23
22 Jul 2024
@luke:vuksta.comLuke joined the room.22:24:00
23 Jul 2024
@ezzobirbezziou:matrix.orgEzzobir Bezziou joined the room.08:21:01
29 Jul 2024
@philip4g:matrix.orgPhilip joined the room.19:09:41
@philip4g:matrix.orgPhilip

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
@arianvp:matrix.orgArianThere is no need to do this. The AMI is a proper NixOS installation19:43:21
@arianvp:matrix.orgArianyou can just do nixos-rebuild switch on the existing EBS volume19:43:27
@arianvp:matrix.orgArian

Note that the AMI is and EBS volume already

19:44:04
@arianvp:matrix.orgArianit’s a pointer to an EBS snapshot; that then gets mounted as an EBS volume19:44:17
@arianvp:matrix.orgArianWhat exactly are you trying ot do?19:45:04
@arianvp:matrix.orgArianif 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 DeviceMapping19:45:40
@arianvp:matrix.orgArian

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
@arianvp:matrix.orgArian

EC2 instance must have an associated AMI and Root Block Device. You cant detach it

19:49:00
30 Jul 2024
@philip4g:matrix.orgPhilip

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
@arianvp:matrix.orgArianYou can set this as an option on the instance16:09:45
@arianvp:matrix.orgArianhttps://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#delete_on_termination16:10:02
@arianvp:matrix.orgArian

set delete_on_termination to false. it will keep the volume around

16:10:23
@arianvp:matrix.orgArianNote that you can resize instances without destroying the instance16:10:33

Show newer messages


Back to Room ListRoom Version: 10