summaryrefslogtreecommitdiffstats
path: root/nixos/maintainers
diff options
context:
space:
mode:
authorRob Vermaas <rob.vermaas@gmail.com>2013-11-08 11:37:38 +0000
committerRob Vermaas <rob.vermaas@gmail.com>2013-11-08 12:49:44 +0100
commite9921632efc6a81ff7b36fc93dc29da521324a33 (patch)
tree68abdbda98c472b9f24fd28babd791008992ad95 /nixos/maintainers
parentf3eccb26f7f11475400b5cc07425d87282a4ea18 (diff)
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
Diffstat (limited to 'nixos/maintainers')
-rwxr-xr-xnixos/maintainers/scripts/ec2/create-ebs-amis.py7
1 files changed, 4 insertions, 3 deletions
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