# CommunityToolkit_Aspire_Hosting_OllamaOllamaResource.WithDataVolume

- Module: [CommunityToolkit.Aspire.Hosting.Ollama](/reference/api/go/communitytoolkit.aspire.hosting.ollama.md)
- Defined on: [CommunityToolkit_Aspire_Hosting_OllamaOllamaResource](/reference/api/go/communitytoolkit.aspire.hosting.ollama/communitytoolkit-aspire-hosting-ollamaollamaresource.md)
- Version: `13.6.1`
- Kind: `method`

Adds a data volume to the Ollama container.

## Definition

```go
type CommunityToolkit_Aspire_Hosting_OllamaOllamaResource interface {
    // ... omitted for brevity
    WithDataVolume(options ...*WithDataVolumeOptions) CommunityToolkit_Aspire_Hosting_OllamaOllamaResource
}
```

## Signature

```go
WithDataVolume(options ...*WithDataVolumeOptions) CommunityToolkit_Aspire_Hosting_OllamaOllamaResource
```

## Parameters

- `options` (`...*WithDataVolumeOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithDataVolumeOptions` argument.

- `Name` (`*string`) -- The name of the volume. Defaults to an auto-generated name based on the application and resource names.
- `IsReadOnly` (`*bool`) -- A flag that indicates if this is a read-only volume.

## Returns

[`CommunityToolkit_Aspire_Hosting_OllamaOllamaResource`](/reference/api/go/communitytoolkit.aspire.hosting.ollama/communitytoolkit-aspire-hosting-ollamaollamaresource.md) -- A reference to the `IResourceBuilder`.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [CommunityToolkit_Aspire_Hosting_OllamaOllamaResource](/reference/api/go/communitytoolkit.aspire.hosting.ollama/communitytoolkit-aspire-hosting-ollamaollamaresource.md) -- `handle`
