# OVH Object Storage

### Requirements <a href="#id-1-requirements" id="id-1-requirements"></a>

1. An OVH Cloud project that you can administer.
2. A Valohai project or organization to link OVH object Storage to.

### Create OVH Object Storage <a href="#id-2-create-ovh-object-storage" id="id-2-create-ovh-object-storage"></a>

To set up new object storage within the OVH console, follow these steps:

1. Navigate to your OVH project and select **Object storage** under the **Storage** section.

   <figure><img src="https://docs.valohai.com/hc/article_attachments/27329738949777" alt=""><figcaption></figcaption></figure>
2. Click on **Create an object container**.
3. Choose **S3 API** as the solution.
4. Select any preferred region.

   <figure><img src="https://docs.valohai.com/hc/article_attachments/27329756259217" alt=""><figcaption></figcaption></figure>
5. At the **Link User** step, click **Create User**. Be sure to save the credentials generated during this step.
6. Enter a name for your container and then create it.

   <figure><img src="https://docs.valohai.com/hc/article_attachments/27329713518481" alt=""><figcaption></figcaption></figure>

### Permissions <a href="#id-3-permissions" id="id-3-permissions"></a>

Now, let’s grant the new S3 user access to the files in the bucket:

1. Create a JSON file with the necessary policy using your terminal:

```sh
echo '{"Statement":[{"Action":["s3:*"],"Effect":"Allow","Resource":["*"],"Sid":"FullAccess"}]}' > my_policy.json
```

1. Navigate to the **S3 Users** tab under **Object Storage**, select your user, and choose **Import S3 Policy**.

   <figure><img src="https://docs.valohai.com/hc/article_attachments/27329741467025" alt=""><figcaption></figcaption></figure>
2. Select the newly created `my_policy.json` file to import the policy.

Once the policy is imported we are ready to link this bucket to Valohai.

### Link the Store to Valohai <a href="#id-4-link-the-store-to-valohai" id="id-4-link-the-store-to-valohai"></a>

You can connect this data store either to a single project or create it on the organization level.

#### Link to a Valohai Organization <a href="#id-5-link-to-a-valohai-organization" id="id-5-link-to-a-valohai-organization"></a>

* Navigate to `Hi, <username>` (the top-right menu) -> `Manage <organization>`
* Open the “Data Stores” tab and add your store’s details. The data store can be shared with everyone in the organization, or you can expose the data store only to certain teams.

#### Link the Store to a Valohai Project <a href="#id-6-link-the-store-to-a-valohai-project" id="id-6-link-the-store-to-a-valohai-project"></a>

1. Navigate to **Project** -> **Settings** -> **Data Stores** -> **Add Amazon S3**.
2. Name: usually makes sense to use the same name as the bucket name.
3. **Bucket**: the bucket name; “ovh-bucket-test” in this example; use the name that you set when creating the object storage in OVH.
4. **Access Keys**: provide the `Access Key` and `Secret Access Key` associated with your S3 user.
5. Set the **region**: check the region in OVH Object Storage, use lowercase, for example if ‘DE’ type ‘de’.
6. Check the box labeled `Use put_object for uploads`.
7. When you create the store, the credentials provided will be checked by creating a small test file in the bucket. If the creation succeeds, you are good to go.
8. Once the data store is linked, you can set it as your project’s default upload store under **Settings** -> **General** -> **Default upload store**. This ensures that uploaded outputs will be stored in this particular OVH storage by default.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.valohai.com/data/configure-data-stores/ovh-object-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
