Diff for /wikisrc/amazon_ec2.mdwn between versions 1.10 and 1.15

version 1.10, 2011/02/18 02:14:27 version 1.15, 2011/02/18 03:38:27
Line 210  rsync -aPv -e "ssh -i $EC2_SSH_KEY" NetB Line 210  rsync -aPv -e "ssh -i $EC2_SSH_KEY" NetB
         ec2-user@ec2-67-202-24-108.compute-1.amazonaws.com:          ec2-user@ec2-67-202-24-108.compute-1.amazonaws.com:
 """]]  """]]
   
 Connect to the instance, through its name. We will format and mount the Grub partition, create the *menu.lst* file, then copy files to their respective partitions.  Before connecting to the instance, we have to allow connection on SSH port (22) through firewall. Then, log in to the instance, through its name. We will format and mount the Grub partition, create the *menu.lst* file, then copy files to their respective partitions.
   
 [[!template id=programlisting text="""  [[!template id=programlisting text="""
 $ ec2-describe-instances i-5babe737  $ ec2-describe-instances i-5babe737
 INSTANCE        i-5babe737      ami-74f0061d    <strong>ec2-67-202-24-108.compute-1.amazonaws.com</strong>       ip-10-99-86-193.ec2.internal    running &lt;your_ssh_key_pair_name&gt;  0               t1.micro        2011-02-17T23:22:37+0000        us-east-1c      aki-427d952b                    monitoring-disabled     67.202.24.108   10.99.86.193                    ebs  INSTANCE        i-5babe737      ami-74f0061d    <strong>ec2-67-202-24-108.compute-1.amazonaws.com</strong>       ip-10-99-86-193.ec2.internal    running &lt;your_ssh_key_pair_name&gt;  0               t1.micro        2011-02-17T23:22:37+0000        us-east-1c      aki-427d952b                    monitoring-disabled     67.202.24.108   10.99.86.193                    ebs
   $ ec2-authorize default -p 22
   GROUP           default 
   PERMISSION              default ALLOWS  tcp     22      22      FROM    CIDR    0.0.0.0/0
 $ ssh -i "$EC2_SSH_KEY" ec2-user@ec2-67-202-24-108.compute-1.amazonaws.com  $ ssh -i "$EC2_SSH_KEY" ec2-user@ec2-67-202-24-108.compute-1.amazonaws.com
 [...]  [...]
 [ec2-user@ip-10-99-86-193 ~]$ sudo su  [ec2-user@ip-10-99-86-193 ~]$ sudo su
Line 224  $ ssh -i "$EC2_SSH_KEY" ec2-user@ec2-67- Line 227  $ ssh -i "$EC2_SSH_KEY" ec2-user@ec2-67-
 [root@ip-10-99-86-193 ec2-user]# mount /dev/sdg /mnt/grub/  [root@ip-10-99-86-193 ec2-user]# mount /dev/sdg /mnt/grub/
 [root@ip-10-99-86-193 ec2-user]# mkdir -p /mnt/grub/boot/grub/  [root@ip-10-99-86-193 ec2-user]# mkdir -p /mnt/grub/boot/grub/
 [root@ip-10-99-86-193 ec2-user]# cat > /mnt/grub/boot/grub/menu.lst << EOF  [root@ip-10-99-86-193 ec2-user]# cat > /mnt/grub/boot/grub/menu.lst << EOF
         default=0  default=0
         timeout=0  timeout=0
         hiddenmenu  hiddenmenu
   
         title NetBSD AMI  title NetBSD AMI
             root (hd0)  root (hd0)
             kernel /boot/netbsd root=xbd1  kernel /boot/netbsd root=xbd1
 EOF  EOF
 [root@ip-10-99-86-193 ec2-user]# mv netbsd /mnt/grub/boot/  [root@ip-10-99-86-193 ec2-user]# mv netbsd /mnt/grub/boot/
 [root@ip-10-99-86-193 ec2-user]# umount /dev/sdg  [root@ip-10-99-86-193 ec2-user]# umount /dev/sdg
Line 267  The list of AKIs that suits our situatio Line 270  The list of AKIs that suits our situatio
 # Obtain all kernel images (AKI) for region US East, for which manifest location contains pv-grub (for PyGrub)  # Obtain all kernel images (AKI) for region US East, for which manifest location contains pv-grub (for PyGrub)
 # ec2-describe-images -a --region=us-east-1 -F image-type=kernel -F manifest-location=*pv-grub*  # ec2-describe-images -a --region=us-east-1 -F image-type=kernel -F manifest-location=*pv-grub*
 IMAGE   aki-407d9529    ec2-public-images/pv-grub-hd0-V1.01-i386.gz.manifest.xml        amazon  available       public          i386    kernel                          instance-store  paravirtual     xen  IMAGE   aki-407d9529    ec2-public-images/pv-grub-hd0-V1.01-i386.gz.manifest.xml        amazon  available       public          i386    kernel                          instance-store  paravirtual     xen
 IMAGE   aki-427d952b    ec2-public-images/pv-grub-hd0-V1.01-x86_64.gz.manifest.xml      amazon  available       public          x86_64  kernel                          instance-store  paravirtual     xen  <strong>IMAGE   aki-427d952b    ec2-public-images/pv-grub-hd0-V1.01-x86_64.gz.manifest.xml      amazon  available       public          x86_64  kernel                          instance-store  paravirtual     xen</strong>
 IMAGE   aki-4c7d9525    ec2-public-images/pv-grub-hd00-V1.01-i386.gz.manifest.xml       amazon  available       public          i386    kernel                          instance-store  paravirtual     xen  IMAGE   aki-4c7d9525    ec2-public-images/pv-grub-hd00-V1.01-i386.gz.manifest.xml       amazon  available       public          i386    kernel                          instance-store  paravirtual     xen
 <strong>IMAGE   aki-4e7d9527    ec2-public-images/pv-grub-hd00-V1.01-x86_64.gz.manifest.xml     amazon  available       public          x86_64  kernel                          instance-store  paravirtual     xen</strong>  IMAGE   aki-4e7d9527    ec2-public-images/pv-grub-hd00-V1.01-x86_64.gz.manifest.xml     amazon  available       public          x86_64  kernel                          instance-store  paravirtual     xen
 """]]  """]]
   
 We pick the one with the correct architecture (x86_64). Its ID is **aki-4e7d9527**. Then we can proceed to the creation of our AMI, with:  Pick the one with the correct architecture (x86_64 here). **hd0** are for AMIs where the snapshot contains no partition (where the volume is itself the whole partition), while **hd00** are for snapshots partitioned in a classical way (via MBR). Choose **hd0** AKIs. In this case, that will be **aki-427d952b**.
   
 1. */dev/sda1* as Grub partition (*/dev/sdg*, snapshot *snap-8aef2be6* of volume *vol-24f88d4c*)  We can proceed to the creation of our AMI, with:
 1. */dev/sda2* as root file-system (*/dev/sdf*, snapshot *snap-deef2bb2* of volume *vol-36f88d5e*)  
   1. */dev/sda1* as Grub partition (*/dev/sdg*, snapshot **snap-8aef2be6** of volume **vol-24f88d4c**)
   1. */dev/sda2* as root file-system (*/dev/sdf*, snapshot **snap-deef2bb2** of volume **vol-36f88d5e**)
   
 [[!template id=programlisting text="""  [[!template id=programlisting text="""
 $ ec2-register -a x86_64 --kernel aki-4e7d9527 --region us-east-1 \  $ ec2-register -a x86_64 --kernel aki-4e7d9527 --region us-east-1 \
     -b "/dev/sda1=snap-8aef2be6" -b "/dev/sda2=snap-deef2bb2" -n "NetBSD-x86_64-current" \      -b "/dev/sda1=snap-8aef2be6" -b "/dev/sda2=snap-deef2bb2" -n "NetBSD-x86_64-current" \
     -d "&lt;add your own description here&gt;      -d "&lt;add your own description here&gt;
 IMAGE   ami-74d0231d  IMAGE   <strong>ami-74d0231d</strong>
 """]]  """]]
   
 # Play with your first NetBSD instance  # Play with your first NetBSD instance
Line 292  You can now start your own NetBSD instan Line 297  You can now start your own NetBSD instan
 $ ec2-run-instances ami-74d0231d -t t1.micro -z us-east-1c       $ ec2-run-instances ami-74d0231d -t t1.micro -z us-east-1c     
 RESERVATION     r-08218465      983624114127    default  RESERVATION     r-08218465      983624114127    default
 INSTANCE        <strong>i-953d72f9</strong>      ami-74d0231d                    pending         0               t1.micro        2011-02-18T02:05:46+0000        us-east-1c      aki-4e7d9527                    monitoring-disabled  INSTANCE        <strong>i-953d72f9</strong>      ami-74d0231d                    pending         0               t1.micro        2011-02-18T02:05:46+0000        us-east-1c      aki-4e7d9527                    monitoring-disabled
   *** Wait a few minutes, micro instances take time to start ***
   # Query console output for your new instance
 $ ec2-get-console-output i-953d72f9  $ ec2-get-console-output i-953d72f9
 [...]  Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
       2006, 2007, 2008, 2009, 2010, 2011
       The NetBSD Foundation, Inc.  All rights reserved.
   Copyright (c) 1982, 1986, 1989, 1991, 1993
       The Regents of the University of California.  All rights reserved.
   
   NetBSD 5.99.45 (XEN3_DOMU) #9: Wed Feb 16 21:14:49 CET 2011
           jym@paris:/home/jym/cvs/obj/sys/arch/amd64/compile/XEN3_DOMU
   [...]
 """]]  """]]
   
 ## Create the instance  ## Connect to your NetBSD instance
   
 ## Connect to it  
   
 ## And now?  ## And now?

Removed from v.1.10  
changed lines
  Added in v.1.15


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb