- From: Todd Nine <
>
- To:
- Subject: [[chef-dev]] Help with EC2 EBS issues
- Date: Wed, 24 Nov 2010 12:11:25 +1300
- Organization: Spidertracks
Hi guys,
I'm having 2 major issues getting our recipes working with EC2. The first is it appears the AWS issue works only with the east region, which we are not using. I've create a patch and outlined the issue here.
http://help.opscode.com/discussions/problems/255-invalid-zone-on-aws-recipe-latest-git-origin
Second, I'm not a Ruby dev, and I'm having some issues with creating a RAID 0 EBS system. I'm using 10 drives for my system. I have a simple loop that iterates from 1 to 10 and attempts to create the ebs for given devices. The loop executes without actually creating anything, and I receive no errors. Here is the method within my recipe
def createRaid(mnt_point, raid_dev, disk_dev, raid_size)
aws = data_bag_item("deployment", "aws")
ami = node[:ec2][:ami_id]
#the data bag
bag_id = "#{node[:cassandra][:cluster_name]}_#{ami}"
item = {
"id" => bag_id,
"cass_cluster" => node[:cassandra][:cluster_name]
}
mount_meta = {"raid_dev" => raid_dev}
#Create the mount point data bag
devices = {}
#For each volume add information to the mount metadata
for i in 1..10 do
Chef::Log.info("Logging index #{i}")
disk_dev_path = "#{disk_dev}#{i}"
Chef::Log.info("creating ebs volume for device #{disk_dev_path}")
aws_ebs_volume "#{disk_dev_path}" do
aws_access_key aws['accesskey']
aws_secret_access_key aws['secretkey']
size raid_size/10
#name disk_dev
device disk_dev_path
action [:create]
provider "aws_ebs_volume"
end
#Get the ebs information and put it in a data bag
end
#Sleep until all disks are created
Chef::Log.info("create complete")
#Assemble all the data bag meta data
mount_meta["devices"] = devices
item[mnt_point] = mount_meta
databag_item = Chef::DataBagItem.new
databag_item.data_bag("cassandra")
databag_item.raw_data = item
Chef::Log.info("Updated data bag")
Any help would be greatly appreciated. I've been spinning my wheels for 2 days, and I'm not getting any responses on IRC.
Thanks,
Todd
- [[chef-dev]] Help with EC2 EBS issues, Todd Nine, 11/23/2010
Archive powered by MHonArc 2.6.16.