[Nix-dev] NixOps doesn't work with EC2 anymore?
Jonathan Glines
auntieneo at gmail.com
Sat Mar 21 22:32:09 CET 2015
2015-03-21 15:19 GMT-06:00 Jeffrey David Johnson <jefdaj at gmail.com>:
> I got to the `deploy` step but then Amazon gives me an this error:
>
> error: EC2ResponseError: 400 Bad Request
> <?xml version="1.0" encoding="UTF-8"?>
> <Response>
> <Errors>
> <Error>
> <Code>InvalidParameterCombination</Code>
> <Message>
> Virtualization type 'hvm' is required for instances of type 't2.micro'.
> </Message>
> </Error>
> </Errors>
> <RequestID>db2241eb-5cfe-4213-9d9c-b8b64a32fa7c</RequestID>
> </Response>
Uhh, there's a bug in the algorithm that NixOPs uses to determine what
kind of EC2 instance type it should use. See this table on Amazon (it
must have changed):
http://aws.amazon.com/amazon-linux-ami/instance-type-matrix/
The algorithm it uses is here:
https://github.com/NixOS/nixops/blob/2bc0ce31ec5a65c0a58af7939ba6a66f11c6cb89/nix/ec2.nix#L130-L141
Just looking at it, I think it's been fixed in the latest NixOps, but
it hasn't hit nixos-unstable yet. I have been using the following in
my nixrc to manually specify an image that uses hvm:
https://github.com/auntieNeo/nixrc/blob/33ed37b6741945e2b645406b5901140b508f92eb/nixops.nix#L65
You can find a list of images and their types in the ec2-amis.nix file:
https://github.com/NixOS/nixops/blob/51663b97b66de62443e43c662cc79ca3ab3268a0/nix/ec2-amis.nix
Regards,
Jonathan
More information about the nix-dev
mailing list