From e9921632efc6a81ff7b36fc93dc29da521324a33 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Fri, 8 Nov 2013 11:37:38 +0000 Subject: Updating EC2 EBS HVM creation script. * Use smaller instances to generate HVM images * Use HVM base image that has 4 ephemeral disks in device mapping * As grub is not on the base images anymore, install it first before copying parts of its contents --- nixos/maintainers/scripts/ec2/create-ebs-amis.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nixos/maintainers/scripts') diff --git a/nixos/maintainers/scripts/ec2/create-ebs-amis.py b/nixos/maintainers/scripts/ec2/create-ebs-amis.py index 213e59423ac6..2e7a3273118c 100755 --- a/nixos/maintainers/scripts/ec2/create-ebs-amis.py +++ b/nixos/maintainers/scripts/ec2/create-ebs-amis.py @@ -16,7 +16,7 @@ parser.add_argument('--hvm', dest='hvm', action='store_true', help='Create HVM i parser.add_argument('--key', dest='key_name', action='store_true', help='Keypair used for HVM instance creation', default="rob") args = parser.parse_args() -instance_type = "cc1.4xlarge" if args.hvm else "m1.small" +instance_type = "m3.xlarge" if args.hvm else "m1.small" ebs_size = 8 if args.hvm else 20 @@ -72,7 +72,8 @@ print >> sys.stderr, "NixOS version is {0}".format(version) m.upload_file("./amazon-base-config.nix", "/mnt/etc/nixos/configuration.nix") m.run_command("nixos-install") if args.hvm: - m.run_command('cp /mnt/nix/store/*-grub-0.97*/lib/grub/i386-pc/* /mnt/boot/grub') + m.run_command('nix-env -iA nixos.pkgs.grub') + m.run_command('cp /nix/store/*-grub-0.97*/lib/grub/i386-pc/* /mnt/boot/grub') m.run_command('sed -i "s|hd0|hd0,0|" /mnt/boot/grub/menu.lst') m.run_command('echo "(hd1) /dev/xvdg" > device.map') m.run_command('echo -e "root (hd1,0)\nsetup (hd1)" | grub --device-map=device.map --batch') @@ -98,7 +99,7 @@ def check(): m.connect() volume = m._conn.get_all_volumes([], filters={'attachment.instance-id': m.resource_id, 'attachment.device': "/dev/sdg"})[0] if args.hvm: - instance = m._conn.run_instances( image_id="ami-6a9e4503" + instance = m._conn.run_instances( image_id="ami-5f491f36" , instance_type=instance_type , key_name=args.key_name , placement=m.zone -- cgit 1.4.1