| 22 Jun 2024 |
| geekodour joined the room. | 16:21:37 |
geekodour | Redacted or Malformed Event | 16:22:32 |
| 28 Jun 2024 |
@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 | * 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 | It happened only for the first time among ~100 boots. | 11:46:10 |
| 1 Jul 2024 |
Arian | Do you have ipv6 enabled? | 08:46:30 |
@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 |
Arian | Yeh so there is a race condition in the ec2 metadata script | 21:33:42 |
Arian | Network-online.target is either reached when ipv6 or ipv4 is ready and our script only reaches out on the metadata server on ipv4 | 21:34:18 |
Arian | And then fails and crashes | 21:34:24 |
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 |