Storage Manager: Difference between revisions
(change API url from stable to 3.0) |
|||
Line 13: | Line 13: | ||
'''Each time you start a job, an access to your local home directory is automatically created for all the assigned nodes. You may want to use this page if you want to allow additional addresses to access your home (like when you are using VLAN) or if you want to access your home over-site.''' | '''Each time you start a job, an access to your local home directory is automatically created for all the assigned nodes. You may want to use this page if you want to allow additional addresses to access your home (like when you are using VLAN) or if you want to access your home over-site.''' | ||
You will need to use the [[API|Grid'5000 API]], the entry-point for the home of a '''user''' on a specific '''site''' is: | You will need to use the [[API|Grid'5000 API]], the entry-point for the home of a '''user''' on a specific '''site''' is: | ||
<nowiki>https://api.grid5000.fr/ | <nowiki>https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">site</code>/storage/home/<code class="replace">username</code>/access | ||
For [[Group Storage]], the entry-point of a '''storage''' on a server '''server''' of a '''site''' is: | For [[Group Storage]], the entry-point of a '''storage''' on a server '''server''' of a '''site''' is: | ||
<nowiki>https://api.grid5000.fr/ | <nowiki>https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">site</code>/storage/<code class="replace">server</code>/<code class="replace">storage</code>/access | ||
For example, <code><nowiki>https://api.grid5000.fr/ | For example, <code><nowiki>https://api.grid5000.fr/3.0/sites/lille/storage/storage1/my-team-storage/access</nowiki></code> | ||
{{Note|text=Only the home owner can interact with his or her accesses, so you need to be authenticated. It's done automatically on the frontend. With curl, you can also use the <code>-u </code><code class="replace">username</code> option and you will be prompted for your password before the request is sent.}} | {{Note|text=Only the home owner can interact with his or her accesses, so you need to be authenticated. It's done automatically on the frontend. With curl, you can also use the <code>-u </code><code class="replace">username</code> option and you will be prompted for your password before the request is sent.}} | ||
== Usage == | == Usage == | ||
We assume that we want to manage the home of user <code class="replace">jpicard</code> on <code class="replace">nancy</code>, so the storage API entry-point will be: | We assume that we want to manage the home of user <code class="replace">jpicard</code> on <code class="replace">nancy</code>, so the storage API entry-point will be: | ||
<nowiki> https://api.grid5000.fr/ | <nowiki> https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">nancy</code>/storage/home/<code class="replace">jpicard</code>/access | ||
=== Create access === | === Create access === | ||
Accesses creation is done by sending a POST request to the API with a JSON payload. | Accesses creation is done by sending a POST request to the API with a JSON payload. | ||
Line 28: | Line 28: | ||
==== Until termination ==== | ==== Until termination ==== | ||
If we want to use a specific time (for example <code class="replace">2018-12-25 19:38</code>), we send the following request to the Storage API: | If we want to use a specific time (for example <code class="replace">2018-12-25 19:38</code>), we send the following request to the Storage API: | ||
curl -X POST <nowiki>'https://api.grid5000.fr/ | curl -X POST <nowiki>'https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">nancy</code>/storage/home/<code class="replace">jpicard</code>/access' | ||
-H "Content-Type: application/json" | -H "Content-Type: application/json" | ||
-d '{"hosts": [<code class="replace">"dahu-1.grenoble.grid5000.fr", "dahu-2.grenoble.grid5000.fr"</code>], | -d '{"hosts": [<code class="replace">"dahu-1.grenoble.grid5000.fr", "dahu-2.grenoble.grid5000.fr"</code>], | ||
Line 35: | Line 35: | ||
==== Job termination ==== | ==== Job termination ==== | ||
If we want our access to be valid until the end of a Grid'5000 job, for example the job <code class="replace">4548</code> of <code class="replace">grenoble</code>, we do: | If we want our access to be valid until the end of a Grid'5000 job, for example the job <code class="replace">4548</code> of <code class="replace">grenoble</code>, we do: | ||
curl -X POST <nowiki>'https://api.grid5000.fr/ | curl -X POST <nowiki>'https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">nancy</code>/storage/home/<code class="replace">jpicard</code>/access' | ||
-H "Content-Type: application/json" | -H "Content-Type: application/json" | ||
-d '{"hosts": [<code class="replace">"dahu-1.grenoble.grid5000.fr", "dahu-2.grenoble.grid5000.fr"</code>], | -d '{"hosts": [<code class="replace">"dahu-1.grenoble.grid5000.fr", "dahu-2.grenoble.grid5000.fr"</code>], | ||
"termination" : {"job": <code class="replace">4548</code>, "site": <code class="replace">"grenoble"</code>}}' | "termination" : {"job": <code class="replace">4548</code>, "site": <code class="replace">"grenoble"</code>}}' | ||
If we want to give access to all the assigned nodes of a job, we don't need to give any hosts, the API will fill them for us: | If we want to give access to all the assigned nodes of a job, we don't need to give any hosts, the API will fill them for us: | ||
curl -X POST <nowiki>'https://api.grid5000.fr/ | curl -X POST <nowiki>'https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">nancy</code>/storage/home/<code class="replace">jpicard</code>/access' | ||
-H "Content-Type: application/json" | -H "Content-Type: application/json" | ||
-d '{"termination" : {"job": <code class="replace">4548</code>, "site": <code class="replace">"grenoble"</code>}}' | -d '{"termination" : {"job": <code class="replace">4548</code>, "site": <code class="replace">"grenoble"</code>}}' | ||
Line 56: | Line 56: | ||
=== List access === | === List access === | ||
To list all accesses, you should do: | To list all accesses, you should do: | ||
curl <nowiki>https://api.grid5000.fr/ | curl <nowiki>https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">nancy</code>/storage/home/<code class="replace">jpicard</code>/access | ||
You get a list of accesses: | You get a list of accesses: | ||
{ | { | ||
Line 80: | Line 80: | ||
} | } | ||
You can also ask for a specific access by providing its identifier, for instance: | You can also ask for a specific access by providing its identifier, for instance: | ||
curl <nowiki>https://api.grid5000.fr/ | curl <nowiki>https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">nancy</code>/storage/home/<code class="replace">jpicard</code>/access/<code class="replace">G5k-home_jpicard_u_1535456240_1</code> | ||
=== Delete an access === | === Delete an access === | ||
Access deletion is done by sending a DELETE request to the API with the access identifier. | Access deletion is done by sending a DELETE request to the API with the access identifier. | ||
curl -X DELETE <nowiki>https://api.grid5000.fr/ | curl -X DELETE <nowiki>https://api.grid5000.fr/3.0/sites/</nowiki><code class="replace">nancy</code>/storage/home/<code class="replace">jpicard</code>/access/<code class="replace">G5k-home_jpicard_u_1535456240_1</code> | ||
== API Specification == | == API Specification == | ||
[https://api.grid5000.fr/doc/3.0/#tag/storage See here] for the storage manager API specification. | [https://api.grid5000.fr/doc/3.0/#tag/storage See here] for the storage manager API specification. |
Revision as of 15:33, 20 September 2021
Note | |
---|---|
This page is actively maintained by the Grid'5000 team. If you encounter problems, please report them (see the Support page). Additionally, as it is a wiki page, you are free to make minor corrections yourself if needed. If you would like to suggest a more fundamental change, please contact the Grid'5000 team. |
The Storage Manager manages access to NFS shares (in particular, users' home directories) on Grid'5000.
This page describes its API, and focuses on accessing user's home directories.
How it works
The storage API works with access object. An access is defined by a list of addresses and a termination condition for a specific location on an NFS Server. Each user's home directory is located on /export/home/
username
on the NFS server of each site: nfs.
site
.grid5000.fr
Each time you start a job, an access to your local home directory is automatically created for all the assigned nodes. You may want to use this page if you want to allow additional addresses to access your home (like when you are using VLAN) or if you want to access your home over-site. You will need to use the Grid'5000 API, the entry-point for the home of a user on a specific site is:
https://api.grid5000.fr/3.0/sites/site
/storage/home/username
/access
For Group Storage, the entry-point of a storage on a server server of a site is:
https://api.grid5000.fr/3.0/sites/site
/storage/server
/storage
/access
For example, https://api.grid5000.fr/3.0/sites/lille/storage/storage1/my-team-storage/access
Usage
We assume that we want to manage the home of user jpicard
on nancy
, so the storage API entry-point will be:
https://api.grid5000.fr/3.0/sites/nancy
/storage/home/jpicard
/access
Create access
Accesses creation is done by sending a POST request to the API with a JSON payload.
We must provide a list of hosts to whom we want to give access to, for instance dahu-1.grenoble.grid5000.fr
and dahu-2.grenoble.grid5000.fr
. We also need a termination condition, it can be a specific date or a job termination.
Note | |
---|---|
To give access to a home from a specific VLAN, you can use its domain name, for example for dahu-1 on VLAN 2, you can add |
Until termination
If we want to use a specific time (for example 2018-12-25 19:38
), we send the following request to the Storage API:
curl -X POST 'https://api.grid5000.fr/3.0/sites/nancy
/storage/home/jpicard
/access' -H "Content-Type: application/json" -d '{"hosts": ["dahu-1.grenoble.grid5000.fr", "dahu-2.grenoble.grid5000.fr"
], "termination" : {"until":"2018-12-25 19:38"
}}'
Job termination
If we want our access to be valid until the end of a Grid'5000 job, for example the job 4548
of grenoble
, we do:
curl -X POST 'https://api.grid5000.fr/3.0/sites/nancy
/storage/home/jpicard
/access' -H "Content-Type: application/json" -d '{"hosts": ["dahu-1.grenoble.grid5000.fr", "dahu-2.grenoble.grid5000.fr"
], "termination" : {"job":4548
, "site":"grenoble"
}}'
If we want to give access to all the assigned nodes of a job, we don't need to give any hosts, the API will fill them for us:
curl -X POST 'https://api.grid5000.fr/3.0/sites/nancy
/storage/home/jpicard
/access' -H "Content-Type: application/json" -d '{"termination" : {"job":4548
, "site":"grenoble"
}}'
Warning | |
---|---|
The access is created immediately and is valid until the termination of the job, even if the job has not started yet. |
The nfs_address field will contain the address used to manually mount the home:
List access
To list all accesses, you should do:
curl https://api.grid5000.fr/3.0/sites/nancy
/storage/home/jpicard
/access
You get a list of accesses:
{ "G5k-home_jpicard_j_1666466-nancy_1": { "ipv4": [ "172.16.64.97" ], "termination": { "job": 1666466, "site": "nancy" }, "nfs_address": "srv-data.nancy.grid5000.fr:/export/home/jpicard" }, "G5k-home_jpicard_u_1535456240_1": { "ipv4": [ "172.16.64.16" ], "termination": { "until": 1535456240, }, "nfs_address": "srv-data.nancy.grid5000.fr:/export/home/jpicard" } }
You can also ask for a specific access by providing its identifier, for instance:
curl https://api.grid5000.fr/3.0/sites/nancy
/storage/home/jpicard
/access/G5k-home_jpicard_u_1535456240_1
Delete an access
Access deletion is done by sending a DELETE request to the API with the access identifier.
curl -X DELETE https://api.grid5000.fr/3.0/sites/nancy
/storage/home/jpicard
/access/G5k-home_jpicard_u_1535456240_1
API Specification
See here for the storage manager API specification.