diff --git a/lib/fog/rackspace/examples/auto_scale/add_policy.rb b/lib/fog/rackspace/examples/auto_scale/add_policy.rb index 3876ab6b2..feafb8de4 100644 --- a/lib/fog/rackspace/examples/auto_scale/add_policy.rb +++ b/lib/fog/rackspace/examples/auto_scale/add_policy.rb @@ -65,4 +65,4 @@ change = get_user_input_as_int "Enter change increment" group.policies.create :name => policy_name, :cooldown => cooldown, :type => 'webhook', :change => change -puts "Policy #{policy_name} was successfully added to group" \ No newline at end of file +puts "\nPolicy #{policy_name} was successfully added to group" \ No newline at end of file diff --git a/lib/fog/rackspace/examples/auto_scale/add_webhook.rb b/lib/fog/rackspace/examples/auto_scale/add_webhook.rb index f5720e5dc..9f59f75ab 100644 --- a/lib/fog/rackspace/examples/auto_scale/add_webhook.rb +++ b/lib/fog/rackspace/examples/auto_scale/add_webhook.rb @@ -71,4 +71,4 @@ webhook_name = get_user_input "Enter name for webhook" # create webhook webhook = policy.webhooks.create :name => webhook_name -puts "Webhook #{webhook.name} was successfully added - #{webhook.execution_url}" +puts "\nWebhook #{webhook.name} was successfully added - #{webhook.execution_url}" diff --git a/lib/fog/rackspace/examples/auto_scale/create_scaling_group.rb b/lib/fog/rackspace/examples/auto_scale/create_scaling_group.rb index 12b36edde..78bfc76ce 100644 --- a/lib/fog/rackspace/examples/auto_scale/create_scaling_group.rb +++ b/lib/fog/rackspace/examples/auto_scale/create_scaling_group.rb @@ -78,7 +78,9 @@ max_entities = get_user_input_as_int "Enter maximum number of servers" server_name = get_user_input "Enter base name for servers in scaling group '#{scaling_group_name}'" # retrieve list of images from computer service -images = compute_service.images +print "Loading available server images...." +images = compute_service.images.all +puts "[DONE]" # prompt for server image image = select_image(images) @@ -86,18 +88,6 @@ image = select_image(images) # pick first server flavor flavor = compute_service.flavors.first -# create server template -# server_template = compute_service.servers.new :name => server_name, -# :flavor_id => flavor.id, -# :image_id => image.id, -# :disk_config => "MANUAL", -# :metadata => { "created_by" => "autoscale sample script" }, -# :networks => [INTERNET, SERVICE_NET], -# :personality => { -# "path" => "/root/.csivh", -# "contents" => "VGhpcyBpcyBhIHRlc3QgZmlsZS4=" -# } - server_template = { "name" => "autoscale_server", "imageRef" => image.id, @@ -125,7 +115,7 @@ server_template = { } # create launch configuration -launch_config = Fog::Rackspace::AutoScale::LaunchConfig.new :type => :launch_server, :args => {:server => s } +launch_config = Fog::Rackspace::AutoScale::LaunchConfig.new :type => :launch_server, :args => {:server => server_template } # create group configuration group_config = Fog::Rackspace::AutoScale::GroupConfig.new :max_entities => max_entities, @@ -138,5 +128,5 @@ group_config = Fog::Rackspace::AutoScale::GroupConfig.new :max_entities => max_e group = auto_scale_service.groups.create :group_config => group_config, :launch_config => launch_config -puts "Scaling Group #{scaling_group_name} (#{group.id}) was created!" +puts "\nScaling Group #{scaling_group_name} (#{group.id}) was created!" puts "State: #{group.state}"