AWS

From Bitpost wiki
Jump to navigation Jump to search
AWS clone
  1. create a snapshot of an instance
  2. create an instance of a snapshot

Example...

   instances -> pa-jenkins-win-test -> right-click, Create Image -> 
       { 
           name: pa-jenkins-win-test, 
           AMI ID: ami-57cadc3d
       }
   This creates a new "AMI Image"- WARNING: The source machine will be rebooted!
   monitoring it, waiting for it to be ready... ready.  man that took a while.  
   Select AMI -> rightclick -> Launch...
       instance type: t2.medium (same as original; 2 vCPUs, 4GB mem)
       config: SELECT THE SAME SUBNET (us-east-1d) so on the same LAN and can ping each other; (all other defaults)
       storage: (default)
       tag instance: { name: "pa-jenkins-win-test-older" }
       security: select existing { "pa-shared immed_inno_group raleigh-windows-dev" } (as per Brad, previously - note that "raleigh" is no longer available) 
       LAUNCH
       ---
       select an existing key pair or create a new pair
           let's use the existing ones since this is a shared resource
           2014Dec25_air.pem (it's in my docs repo)
       ----
       monitor it, wait for it to be created...
       because it was cloned from a machine that had the password changed, you can't use the existing key to regenerate
       i didn't realize it was changed??
       anyway, it should be the exact same way to connect to test, but with a diff ip/hostname (*-older)
       yep.  switched IP to 172.30.3.208 and it's good to go!
Expand AWS storage
   stop instance
   in instance details, right-click the block device link (typically /dev/sd1)
   click the EBS ID
   snapshot the volume, wait for it to get to "complete"
   right-click snapshot, create volume
       use the same availability zone: us-east-1d
   on the volume created screen, click to show the volume
       vol-b88c3c45
   get the orig volume:
       vol-5af8f0a0
       https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Volumes:search=vol-5af8f0a0;sort=size
   type this into volume filter to see them both:
       vol-b88c3c45|vol-5af8f0a0
   make note of the attachment info for the old 30GB drive:
       Attachment information
       i-ad45941d (pa-jenkins-win-test):/dev/sda1 (attached)
   detach the volume!  holy cow.  
       i thought about restarting the instance and shutting it down first...
       but i think stopping it already did that!  MOVE ON    
   right click new volume, "attach volume"
       start typing instance name (pa-jenkins-win-test worked)
       CHANGE TEH SELECTED DRIVE NAME (xsdf or something) to the original!  /dev/sda1
       geez that's scary, wonder if it will work...
       YEP!!!  AW#ESOMENWESSSS##$$
   type "disk management", right-click the 30gb image, select Extend
   DONE!!!