Diff for /wikisrc/amazon_ec2.mdwn between versions 1.17 and 1.20

version 1.17, 2011/02/18 03:52:23 version 1.20, 2011/02/19 01:13:56
Line 140  $ gzip -9n NetBSD-AMI.img Line 140  $ gzip -9n NetBSD-AMI.img
   
 We must now upload our NetBSD system to EC2. For that, we will have to create a minimalist EC2 instance, to which we will copy our files to construct our snapshots. For that, we will use an Amazon Linux AMI instance.  We must now upload our NetBSD system to EC2. For that, we will have to create a minimalist EC2 instance, to which we will copy our files to construct our snapshots. For that, we will use an Amazon Linux AMI instance.
   
 EC2 being localized in geographical regions, you have to carefully choose the AMI identifier you want to use there. This depends on where you want to execute your instance. Amazon Linux AMI IDs are listed on [the main page](http://aws.amazon.com/amazon-linux-ami/) of the project, by regions. Chose ones backed by EBS.  EC2 being localized in geographical regions, you have to carefully choose the AMI identifier you want to use there. This depends on where you want to execute your instance. Amazon Linux AMI IDs are listed on [the main page](http://aws.amazon.com/amazon-linux-ami/) of the project, by regions. Choose ones backed by EBS.
   
 The examples listed here assume that the instances run in **US East**, within the **c** zone (e.g. **us-east-1c**). To have a list of EC2 regions, you can use the command **ec2-describe-regions**, and **ec2-describe-availability-zones** for availability zones.  The examples listed here assume that the instances run in **US East**, within the **c** zone (e.g. **us-east-1c**). To have a list of EC2 regions, you can use the command **ec2-describe-regions**, and **ec2-describe-availability-zones** for availability zones.
   
Line 193  ATTACHMENT      vol-24f88d4c    i-5babe7 Line 193  ATTACHMENT      vol-24f88d4c    i-5babe7
   
 ## Snapshots!  ## Snapshots!
   
   Before we can connect to our brand new instance, we have to allow connections on SSH port (22) through the AWS EC2 firewall:
   
   [[!template id=programlisting text="""
   $ ec2-authorize default -p 22
   GROUP           default 
   PERMISSION              default ALLOWS  tcp     22      22      FROM    CIDR    0.0.0.0/0
   """]]
   
 We can now upload the kernel and the NetBSD disk image created earlier, *NetBSD-AMI.img*, to our instance host:  We can now upload the kernel and the NetBSD disk image created earlier, *NetBSD-AMI.img*, to our instance host:
   
 [[!template id=programlisting text="""  [[!template id=programlisting text="""
Line 204  rsync -aPv -e "ssh -i $EC2_SSH_KEY" NetB Line 212  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:
 """]]  """]]
   
 Before we can connect to our brand new instance, we have to allow connections on SSH port (22) through the AWS EC2 firewall:  
   
 [[!template id=programlisting text="""  
 $ ec2-authorize default -p 22  
 GROUP           default   
 PERMISSION              default ALLOWS  tcp     22      22      FROM    CIDR    0.0.0.0/0  
 """]]  
   
 Then, log in to the instance, via its name. We will format and mount the Grub partition, create the *menu.lst* file, then copy files to their respective partitions.  Then, log in to the instance, via 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="""
Line 263  INSTANCE        i-5babe737      running  Line 263  INSTANCE        i-5babe737      running 
   
 An AMI requires multiples components to be registered: the snapshots IDs we made in the previous chapter, as well as a specific AKI: the one that can chain-load Xenified kernels through PyGrub.  An AMI requires multiples components to be registered: the snapshots IDs we made in the previous chapter, as well as a specific AKI: the one that can chain-load Xenified kernels through PyGrub.
   
 /!\ AKIs are entitled to the same conditions as AMIs: their IDs are region-specific. So chose one carefully, or you will not be able to launch a NetBSD instance later!  /!\ AKIs are entitled to the same conditions as AMIs: their IDs are region-specific. So choose one carefully, or you will not be able to launch your NetBSD instance later!
   
 The list of AKIs that suits our situation can be obtained with the following command:  The list of AKIs that suits our situation can be obtained with the following command:
   
Line 284  We can proceed to the creation of our AM Line 284  We can proceed to the creation of our AM
 1. */dev/sda2* as root file-system (*/dev/sdf*, snapshot **snap-deef2bb2** of volume **vol-36f88d5e**)  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-427d952b --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 "<add your own description here>      -d "<add your own description here>
 IMAGE   <strong>ami-74d0231d</strong>  IMAGE   <strong>ami-74d0231d</strong>

Removed from v.1.17  
changed lines
  Added in v.1.20


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