Showing posts with label Compute. Show all posts
Showing posts with label Compute. Show all posts

Thursday 31 May 2012

AWS - Migrate Linux AMI (EBS) using CloudyScripts


In a typical Amazon Web Services(AWS) Environment, Amazon Machine Images (AMIs) are strictly available in a certain region only. These AMIs cannot be moved from one region to another. Though the AMIs are shared within different Availability Zones of the same region.

For this purpose, you can use a third party tool called as CloudyScripts.

CloudyScripts is a collection of tools to help you programming Infrastructure Clouds.

The web-based tool is self explanatory and regularly updated. In case you find any bug, do not hesitate to email the owners right away.


Goto the CloudyScripts Copy AMI to different region tool
































Wednesday 30 May 2012

AWS EBS-Backed Instance Backup &Restore

Starting with the 2009-10-31 API, Amazon Web Services (AWS) has a new type of Amazon Machine Image(AMI) that stores its root device as an Amazon Elastic Block Store(EBS) volume. They refer to these AMIs as Amazon EBS-backed. When an instance of this type of AMI launches, an Amazon EBS volume is created from the associated snapshot, and that volume becomes the root device. You can create an AMI that uses an Amazon EBS volume as its root device with Windows or Linux/UNIX operating systems.

These instances can be easily backed-up. You can modify the original instance to suit your particular needs and then save it as an EBS-backed AMI. Hence, if in future you need the the modified version of instance, you can simply launch multiple new instances from the backed-up AMI and are ready to-go.

Following are the steps to be performed for backup/restoring of AWS EBS instance into/from an AWS AMI. Also brief steps for deletion of AMI backup are noted for reference


EBS-instance to EBS-backed AMI

  • Go to AWS Management Console and in the My Instances Pane, select the instance which has to be backed up.
  • Right click the instance and select option Create Image (EBS AMI).

  • In the Create Image dialog box, give proper AMI Name and Description. Click on Create This Image button.
 

  • The image creation will be in progress. This will take sometime depending upon the number & size of volumes attached to the instance. Click on View pending image link. It will take you to the AMIs pane.

  • The AMI will be in pending state. It is important to note that this AMI is private to the account and not available for AWS public use.
 
  • If you select Snapshots from the Navigation Pane, then you can see that EBS volumes attached to the instance will be backed up as too.

  • Once the backup is done, the AMI will be in available state.
 


Restore from backup AMI into instance


In case, the running instance needs to be restored, use the latest backup AMI. To launch an instance from this AMI, right-click the AMI and select Launch Instance option. The Launch Instance Wizard will be displayed, perform the usual configurations and a new instance will be created containing all the data & configurations done before backup.


Delete AMI & Snapshots:

  • To delete any AMI, Right-click it and select De-register AMI.

  • Remember, deleting AMI doesn’t delete the EBS volume snapshots. Click on Snapshots from Navigation pane, search & select the snapshot(s) to be deleted. Right-click on the snapshot(s) and select delete snapshot option.
 


References:


 

Friday 18 May 2012

Install JAVA on Linux using rpm files

Steps for installing JAVA (JDK 6) on linux using rpm files:

1. Log into the linux shell and become root user by running the command

su –i

2. Change directory.

cd /opt

3. Please search at http://www.oracle.com/technetwork/java/javase/downloads/index.html for newer versions to download.

You can download to any directory you choose; it does not have to be the directory where you want to install the JDK. Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.

To download use one of the below commands, depending on the server's architecture (32/64 bit) :
64 bit:
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64-rpm.bin

32 bit:
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-i586-rpm.bin



4. Make sure that execute permissions are set in the self-extracting binary.
Enter ls –la to see the permissions for the file.


5. Run below command to grant execute permission to the file:

chmod a+x <<name-of-rpm-file-downloaded-earlier>>
 
For e.g.:
chmod +x jdk-6u25-linux-x64-rpm.bin\?e\=1306317438\&h\=294de0d36f54e28dd65fc8370e3c406d

6. Change directory to the location where you would like the files to be installed. The next step installs the JDK into the current directory.

7. Execute the downloaded file, prepended by the path to it.
For example, if the file is in the current directory, prepend it with "./"  :
./<<name-of-rpm-file-downloaded-earlier>>
For e.g.:

./jdk-6u25-linux-x64-rpm.bin\?e\=1306317438\&h\=294de0d36f54e28dd65fc8370e3c406d



8. The binary code license is displayed, and you are prompted to agree to its terms.



9. Check if java is installed using command

java -version



The java version must be displayed correctly. You may also want to run commands like java or javac to check if installation is proper.

10. Execute below command to test if the JAVA_HOME environment variable is set.

echo $JAVA_HOME

It must display the location where java is installed.

11.  Delete the bin and rpm files if you want to save disk space.

rm -rf sun*