[Nix-dev] NixOps doesn't work with EC2 anymore?
Jeffrey David Johnson
jefdaj at gmail.com
Sat Mar 21 22:19:31 CET 2015
I'm trying to set up a server for my lab to do bioinformatics. I'm following the manual here:
<http://hydra.nixos.org/build/20346360/download/1/manual/manual.html#sec-deploying-to-ec2>
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>
According to <http://aws.amazon.com/amazon-linux-ami/instance-type-matrix/>,
you now need to set up a block storage device and link it to your machine instance.
Is there a way to do that in nixops?
In case it helps, here are my nix expressions:
# test.nix
{
network.description = "Amazon EC2 Test 2015-03-21";
server = { config, pkgs, ... }:
{ environment.systemPackages =
with pkgs;
with rPackages;
with pythonPackages; [
R
edgeR
DESeq2
MLSeq
ncbi-blast
ipython
nix
nix-repl
gitFull
tree
vim
less
];
};
}
# test-ec2.nix:
let
region = "us-west-1";
accessKeyId = "test";
ec2 = { resources, ... }:
{
deployment = {
targetEnv = "ec2";
ec2 = {
inherit region accessKeyId;
instanceType = "t2.micro";
keyPair = resources.ec2KeyPairs.my-key-pair;
# securityGroups = [ "allow-ssh" "allow-http" ];
};
};
};
in {
server = ec2;
resources.ec2KeyPairs.my-key-pair = { inherit region accessKeyId; };
}
And I launch it with:
nixops create ./test.nix test-ec2.nix -d test
nixops deploy -d test
Also sorry if I missed some old posts on this. Embarassingly, I can't figure
out how to search the mailing list archives.
Jeff
More information about the nix-dev
mailing list