# File lib/fog/libvirt/models/compute/server.rb, line 86
        def create_or_clone_volume

          volume_options = Hash.new

          volume_options[:name] = volume_name || default_volume_name

          # Check if a disk template was specified
          unless self.volume_template_name.nil?

            template_volumes = connection.volumes.all(:name => self.volume_template_name)

            raise Fog::Errors::Error.new("Template #{self.volume_template_name} not found") unless template_volumes.empty?

            orig_volume = template_volumes.first
            volume      = orig_volume.clone("#{volume_options[:name]}")

            # if we cloned it, it has the original volume type.
            self.volume_format_type = orig_volume.format_type
            # This gets passed to the domain to know the path of the disk
            self.volume_path        = volume.path

          else
            # If no template volume was given, let's create our own volume

            volume_options[:format_type] = self.volume_format_type if volume_format_type
            volume_options[:capacity]    = self.volume_capacity    if volume_capacity
            volume_options[:allocation]  = self.volume_allocation  if volume_allocation

            begin
              volume                    = connection.volumes.create(volume_options)
              self.volume_path          = volume.path
              self.volume_format_type ||= volume.format_type
            rescue
              raise Fog::Errors::Error.new("Error creating the volume : #{$!}")
            end

          end
        end