You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/file-storage/how-to/attach-file-system.mdx
+40-2Lines changed: 40 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ categories:
6
6
- storage
7
7
- file-storage
8
8
dates:
9
-
validation: 2025-07-23
9
+
validation: 2025-10-30
10
10
posted: 2025-07-23
11
11
---
12
12
@@ -21,7 +21,7 @@ import Requirements from '@macros/iam/requirements.mdx'
21
21
-[Created a file system](/file-storage/how-to/create-file-system/)
22
22
-[Created at least one POP2 Instance](/instances/how-to/create-an-instance/)
23
23
24
-
## How to attach a file system to an Instance
24
+
## How to attach a file system using the Scaleway console
25
25
26
26
1. Click **File Storage** in the **Storage** section of the side menu. A list of your file systems displays.
27
27
@@ -39,3 +39,41 @@ import Requirements from '@macros/iam/requirements.mdx'
39
39
40
40
Your file system is now attached to the selected Instance(s) and can now be [mounted](/file-storage/how-to/mount-file-system/) to a Scaleway Instance.
41
41
42
+
## How to attach a file system using the API
43
+
44
+
The Scaleway API allows you to create and manage all your resources programmatically.
45
+
46
+
<Messagetype="note">
47
+
To attach a file system to an Instance, you must use the [Instance API](https://www.scaleway.com/en/developers/api/instances/#path-instances-attach-a-filesystem-volume-to-an-instance).
48
+
</Message>
49
+
50
+
1. Make sure you have [authenticated and performed your first request](https://www.scaleway.com/en/developers/api/#quickstart-first-request) with the Scaleway API.
51
+
52
+
2. Run the cURL request below to attach your file system to the desired Instance. Do not forget to replace the placeholders with the appropriate values.
53
+
54
+
```bash
55
+
curl -X POST 'https://api.scaleway.com/instance/v1/zones/<region>/servers/<instance-id>/attach-filesystem' \
56
+
-H "X-Auth-Token: $SCW_SECRET_KEY" \
57
+
-H "Content-Type: application/json" \
58
+
-d '{"filesystem_id": "<my-fs-id>"}'
59
+
```
60
+
61
+
Refer to the [Scaleway API documentation](https://www.scaleway.com/en/developers/api/instances/#path-instances-attach-a-filesystem-volume-to-an-instance) for more information on the different parameters.
62
+
63
+
## How to attach a file system using the CLI
64
+
65
+
Scaleway CLI is a tool to help you pilot your Scaleway infrastructure directly from your terminal.
66
+
67
+
<Messagetype="note">
68
+
To attach a file system to an Instance, you must use the [Instance CLI](https://cli.scaleway.com/instance/#attach-a-filesystem-volume-to-an-instance).
69
+
</Message>
70
+
71
+
1. Make sure you have [installed and configured the Scaleway CLI](/scaleway-cli/quickstart/).
72
+
73
+
2. Run the command below to attach your file system to the desired Instance. Do not forget to replace the placeholders with the appropriate values.
74
+
75
+
```bash
76
+
scw instance server attach-filesystem server-id=<instance_id> filesystem-id=<filesystem_id> zone=<availability_zone>
77
+
```
78
+
79
+
Refer to the [Scaleway CLI documentation](https://cli.scaleway.com/instance/#attach-a-filesystem-volume-to-an-instance) for more information on the different parameters.
0 commit comments