auser / poolparty

Run a self-healing, auto-scaled and monitored cloud simply, in the clouds, on nearly any hardware, such as EC2, eucalyptus and vmware
http://www.poolpartyrb.com
MIT License
371 stars 54 forks source link

amazon webservices EBS support missing #64

Open MauriceSchoenmakers opened 14 years ago

MauriceSchoenmakers commented 14 years ago

creating and mounting EBS volumes (via snapshots) is not yet supported but needed for real world applications like mysql server.

bradphelan commented 14 years ago

I did it with the aws chef cookbook

   aws_ebs_volume "mysql_data_volume" do
      provider              "aws_ebs_volume"
      aws_access_key        node[:awskeys][:access]
      aws_secret_access_key node[:awskeys][:secret]
      volume_id             node[:apricoserver][:db][:ebs_volume]
      availability_zone     "us-east-1b"
      device                "/dev/sdh"
      action                :attach
    end

You need to put your AWS keys into the cloud though and manually create the volume in the AWS web page. Then you can use the mount resource.

    # This works as long as you have previously formatted
    # the device as ext3 using 
    #
    #   mkfs.ext3 /dev/sdh
    # 
    # Need some magic to do this automatically. 
    #
    #
    mount "/var/local/ebs" do
      device "/dev/sdh"
      options "rw noatime"
      fstype "ext3"
      action [ :enable, :mount ]
      # Do not execute if its already mounted
      not_if "cat /proc/mounts | grep /var/local"
    end