!atvIbxHoEqNcAIxYpN:nixos.org

NixOS AWS

64 Members
16 Servers

Load older messages


SenderMessageTime
22 Jun 2024
@geekodour:matrix.orggeekodour joined the room.16:21:37
@geekodour:matrix.orggeekodourRedacted or Malformed Event16:22:32
28 Jun 2024
@AleXoundOS:matrix.org@AleXoundOS:matrix.org

Encountered a situation, when userdata script did not start:

Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Reached target Multi-User System.
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Starting Reconfigure the system from EC2 userdata on startup...
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[978]: attempting to fetch configuration from EC2 user data...
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[978]: /nix/store/gzx4ihb8hdxl1yj18kfhm5an6vvz59mn-unit-script-amazon-init-start/bin/amazon-init-start: line 16: /etc/ec2-metadata/user-data: No such file or directory
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[978]: no user data is available
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Finished Reconfigure the system from EC2 userdata on startup.

But with manualy reboot it worked:

Jun 28 11:40:34 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Reached target Multi-User System.
Jun 28 11:40:34 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Starting Reconfigure the system from EC2 userdata on startup...
Jun 28 11:40:34 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[934]: attempting to fetch configuration from EC2 user data...
Jun 28 11:40:34 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[934]: running EC2 User Data bootstrap
11:44:48
@AleXoundOS:matrix.org@AleXoundOS:matrix.org *

Encountered a situation, when userdata script did not start:

Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Reached target Multi-User System.
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Starting Reconfigure the system from EC2 userdata on startup...
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[978]: attempting to fetch configuration from EC2 user data...
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[978]: /nix/store/gzx4ihb8hdxl1yj18kfhm5an6vvz59mn-unit-script-amazon-init-start/bin/amazon-init-start: line 16: /etc/ec2-metadata/user-data: No such file or directory
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[978]: no user data is available
Jun 28 11:34:56 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Finished Reconfigure the system from EC2 userdata on startup.

But with manual reboot it worked:

Jun 28 11:40:34 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Reached target Multi-User System.
Jun 28 11:40:34 ip-10-0-96-47.eu-central-1.compute.internal systemd[1]: Starting Reconfigure the system from EC2 userdata on startup...
Jun 28 11:40:34 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[934]: attempting to fetch configuration from EC2 user data...
Jun 28 11:40:34 ip-10-0-96-47.eu-central-1.compute.internal amazon-init-start[934]: running EC2 User Data bootstrap
11:45:15
@AleXoundOS:matrix.org@AleXoundOS:matrix.orgIt happened only for the first time among ~100 boots.11:46:10
1 Jul 2024
@arianvp:matrix.orgArianDo you have ipv6 enabled?08:46:30
@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

Show newer messages


Back to Room ListRoom Version: 10