From 9a70adea0f0199292c3774f296d46c91001c7515 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Wed, 1 Oct 2014 10:09:38 -0400 Subject: [PATCH] Accept `:image_id` to create bootable volumes. --- lib/fog/rackspace/requests/block_storage/create_volume.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/fog/rackspace/requests/block_storage/create_volume.rb b/lib/fog/rackspace/requests/block_storage/create_volume.rb index 8d56c0eac..c76ee1345 100644 --- a/lib/fog/rackspace/requests/block_storage/create_volume.rb +++ b/lib/fog/rackspace/requests/block_storage/create_volume.rb @@ -10,6 +10,8 @@ module Fog # @option options [String] :display_description display description for volume # @option options [String] :volume_type type of volume # @option options [String] :snapshot_id The optional snapshot from which to create a volume. + # @option options [String] :image_id The ID of an image from the compute service. If provided, a bootable volume will be + # created. # @return [Excon::Response] response: # * body [Hash]: # * 'volume' [Hash]: @@ -41,6 +43,7 @@ module Fog data['volume']['volume_type'] = options[:volume_type] unless options[:volume_type].nil? data['volume']['availability_zone'] = options[:availability_zone] unless options[:availability_zone].nil? data['volume']['snapshot_id'] = options[:snapshot_id] unless options[:snapshot_id].nil? + data['volume']['imageRef'] = options[:image_id] unless options[:image_id].nil? request( :body => Fog::JSON.encode(data),