Twitter Updates

Saturday, October 18, 2008

Getting OpenSolaris with EBS on Amazon EC2

I have been using Linux on EC2 for quite sometime now, but recently with learning OpenSolaris and installing and using it in a VM on my system I thought I'll try it on EC2. The features that were attracting me the most to using Solaris were ZFS and containers. Though I haven't got the containers working yet I have the ZFS setup and running. So here are steps to get OpenSolaris with EBS and ZFS up on Amazon EC2.
  1. Register with Amazon and get a Amazon AWS account.

  2. I recomend you download and install ElasticFox plugin for Firefox useful for EC2 management and JetS3t for using uploading to managing S3.

  3. Go and register for an Solaris AMI with Sun from the Solaris EC2 Blog - http://blogs.sun.com/ec2/

  4. Once you get the permission to use Solaris AMIs, Start ElasticFox from Firefox Menu > Tools > ElasticFox

  5. Set your AWS credentails, i.e. AWS Access Key and AWS Secret Access Key, in the dialog that comes on clicking Credentials. Also add your Account ID.

  6. Go to the KeyPairs tab and create a new KeyPair. This will create a PEM file. Save it.

  7. Use PuttyGen and load the PEM file in it. Enter a Passphrase of your choice. (This will act as the root password) and save the PrivateKey as a ppk file.

  8. Choose the OpenSolaris AMI of your choice in the AMIs and Instances Tab, right click and click Launch Instances of this AMI

  9. Choose the Instance Type according to your needs and Budget

  10. Select the KeyPair we created and an availability zone.

  11. You may add custom information in User Data and then press Launch.

  12. Click on tools icon in ElasticFox and set the Path for Putty. Also Enter the path to the ppk key we saved. This is required to launch putty directly from ElasticFox.

  13. Go to the Security Groups tabs and add Group permissions to open port 22.

  14. Now in the Instances right click on our newly created instance and select SSH to Public DNS Name. This will Open Putty and connect to the Server Shell using SSH.

  15. Now we will assign an Elastic IP to this instance

  16. Right Click on the instance and Copy the Instance ID to ClipBoard

  17. Go to the Elastic IPs Tab and create new Elastic IP

  18. Right click on the IP Address and Select Associate this Address

  19. In the popup paste your Instance ID and Click OK

  20. Next we attach an EBS volume. I suggest that you use RaidZ configuration with the EBS Volumes

  21. For this Go to the Volumes and Snapshots Tab and create 3 volumes of the Same size.

  22. Right click on the volumes and attach them to our Instance. Here you need to enter a number between 2-23 in the device text box.

  23. Switch to the SSH console and Type the following commands

    1. cd /dev/dsk

    2. ls -l c4d*p0 [this will list all the disk devices including our EBS vol]

      • Check the number after c4d for the EBS devices

    3. zpool create ebsp02 raidz c4d6p0 c4d7p0 c4d8p0

      • and your EBS Devices under ZFS with RaidZ configuration are ready to use.

I have some doubts aout how to get the up and running wih Solaris containers. Will post about that when I am able to set it up.
Blogged with the Flock Browser

4 comments:

Jack's Jots said...

I've been fighting with recovering my zfs from ebs. I think my problem is that I don't have a way to sync the disks before detaching them.

Or, the problem could be how to properly reattach the zfs after a reboot. The file system appears to have (some of) the old data on it because the file system has less available space.

I thought I figured out what export and import did for zpools. However, it did not seem to help.

I am new to zfs, ebs and ec2. So, I am not surprised that I am having problems.

Please let me know if you have had any luck with your ebs experiments with zfs.

jack@flowertowntech.com

A Paton said...

Just reading up on Solaris on Amazon EC2 so thanks for blog entry. I'm trying to get my head around Elastic IP's and Solaris Zones. Any joy assigning an IP address to a zone?

Sean said...

I don't think you can assign an Elastic IP to a zone. What you can do is assign an Eleastic IP to the global zone, and then use ipfilter to route traffic to the non-global zones. For more informaton, see:

http://blogs.sun.com/seano/entry/opensolaris_ec2_and_zones_a

Xanadu2000 said...

Thanks, this was really helpful!

Post a Comment

What I read . . .

 
ss_blog_claim=47174056018c98861ec00051ef8442aa