diff --git a/lib/fog/rackspace/docs/compute_v2.md b/lib/fog/rackspace/docs/compute_v2.md index 8b0251810..5f61c0638 100644 --- a/lib/fog/rackspace/docs/compute_v2.md +++ b/lib/fog/rackspace/docs/compute_v2.md @@ -480,6 +480,11 @@ The `create` method also supports the following key values: :personality Array of files to be injected onto the server. Please refer to the Fog personality API documentation for further information. + + :config_drive + Whether a read-only configuration drive is attached. Refer to Next Gen Server API documentation - Config Drive Extension. + ## Bootstrap diff --git a/lib/fog/rackspace/models/compute_v2/server.rb b/lib/fog/rackspace/models/compute_v2/server.rb index 8d32c0975..1e5ee0b8d 100644 --- a/lib/fog/rackspace/models/compute_v2/server.rb +++ b/lib/fog/rackspace/models/compute_v2/server.rb @@ -110,6 +110,12 @@ module Fog # the remaining disk space is left unpartitioned. This enables images to have non-EXT3 file systems, multiple partitions, # and so on, and enables you to manage the disk configuration. attribute :disk_config, :aliases => 'OS-DCF:diskConfig' + + + # @!attribute [rw] config_drive_ext + # @return [Boolean] whether a read-only configuration drive is attached + # @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/config_drive_ext.html + attibute :config_drive # @!attribute [r] bandwidth # @return [Array] The amount of bandwidth used for the specified audit period. @@ -211,7 +217,7 @@ module Fog # Creates server # * requires attributes: service:, :name, :image_id, and :flavor_id - # * optional attributes :disk_config, :metadata, :personality + # * optional attributes :disk_config, :metadata, :personality, :config_drive # @return [Boolean] returns true if server is being created # @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404 # @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400 @@ -237,6 +243,7 @@ module Fog modified_options[:disk_config] = disk_config unless disk_config.nil? modified_options[:metadata] = metadata.to_hash unless @metadata.nil? modified_options[:personality] = personality unless personality.nil? + modified_options[:config_drive] = config_drive unless config_drive.nil? modified_options[:key_name] ||= attributes[:key_name] if modified_options[:networks] diff --git a/lib/fog/rackspace/requests/compute_v2/create_server.rb b/lib/fog/rackspace/requests/compute_v2/create_server.rb index a1b9fbcf2..ab4bfd300 100644 --- a/lib/fog/rackspace/requests/compute_v2/create_server.rb +++ b/lib/fog/rackspace/requests/compute_v2/create_server.rb @@ -12,6 +12,7 @@ module Fog # @option options [Hash] metadata key value pairs of server metadata # @option options [String] OS-DCF:diskConfig The disk configuration value. (AUTO or MANUAL) # @option options [Hash] personality Hash containing data to inject into the file system of the cloud server instance during server creation. + # @option options [Boolean] config_drive whether to attach a read-only configuration drive # @option options [String] keypair Name of the kay-pair to associate with this server. # @return [Excon::Response] response: # * body [Hash]: @@ -55,6 +56,8 @@ module Fog data['server']['OS-DCF:diskConfig'] = options[:disk_config] unless options[:disk_config].nil? data['server']['metadata'] = options[:metadata] unless options[:metadata].nil? data['server']['personality'] = options[:personality] unless options[:personality].nil? + data['server']['config_drive'] = options[:config_drive] unless +options[:config_drive].nil? data['server']['networks'] = options[:networks] || [ { :uuid => '00000000-0000-0000-0000-000000000000' }, { :uuid => '11111111-1111-1111-1111-111111111111' }