This tutorial 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.

Disk reservation consists in reserving on nodes hard disks, in order to locally store large datasets between your reservations, and avoid needing moving data to nodes at the beginning of each host reservation. Typically, you can reserve disks for several days, store your data on those disks during your first host reservation, and then access the data during the subsequent reservations.

The table below shows the cluster compatibility with disk reservation.

How it works

Two use cases of the disk reservsation are possible:

long run reservations of disks only (job reserving no host, i.e. no processing power): disk-only reservations do not have to fit in the day vs. night&week-end host reservation policy, and can last up to many days (see Grid5000:UsagePolicy). The reserved disks can then be used by regular host jobs during the period of time of the disk reservation. In this use case, the goal is to get more persistence for the local storage of nodes, e.g. avoid the need to reformat disks and reimport dataset in each regular host job. Those long run jobs must use the noop OAR job type.

regular jobs reserving both host and disks. In this use case, the goal is to get access to the reservable disks within the experiment, just as if the disk were not to reserve separately.

In both cases, making use of the reserved disks requires to gain the root privileges, since disks are provided as bare metal hardware to be partitioned, formated, mounted, filled with no restriction but by the experimenter. As a result, the experimenter can use the reserved disk:

either in a deploy job, in a kadeployed environment (use the deploy OAR job type, then kadeploy)

or in a non-deploy job, in the standard environment but after enabling sudo with the sudo-g5k command.

Technically speaking, when a deploy job starts, or whenever sudo-g5k is called in a non-deploy job, the reserved disks stay available while the other disks are disabled. Reserved disks can only be accessed by the user who reserved them.

Please note that reserved disks are not cleaned-up at the end of reservation. As a result:

Data let on the disks can be accessed by user in later reservations.

Reserved disk may first need to get cleaned-up before use (remove previous formating and partitioning)

Usage

The main commands to reserve disks are given below.

Note

Note that accessing the data stored on reserved disks on nodes is only possible with reservation of type deploy (oarsub-t deploy ...). Non-deploy jobs do not give access to disks (only the system disk).

The maximum duration of a disk reservation is defined in the Usage Policy.

Reserve disks and nodes at the same time

Note

In the 3 following examples, remove the -t deploy if you plan to use the standard environment and sudo-g5k in order to get the root privileges, instead of kadeploy and be root in you own deployed environment.

How to reserve a node with only the main disk (none of the additional disks), on the grimoire cluster

fnancy:

oarsub-I -t deploy -p "cluster='grimoire'" -l /host=1

(no change to the way a node was to be reserved in the past, before the disk reservation mechanism existed.)

Yes, the syntax of the last oarsub command is a bit awkward, so please be careful and mind having:

the -p option explicitly set the hosts you want (using "cluster='grimoire'" instead could not insure that you get the disks on the same nodes you will reserve) ;

both host= values in the -l option (2 in the example) exactly match the count of hosts in the list you provide in the -p option (grimoire-1.nancy.grid5000.fr and grimoire-2.nancy.grid5000.fr in the example).

we do not need to explicitly write "{type='default'}" in the -l option (before the /host=2+, because default is implicit is the type is not set.

Reserve disks and nodes separately

You may, for example, decide to reserve some disks for one week, but the nodes where your disks are located only when you want to carry out an experiment.

First: reserve the disks

Since we want to reserve disks only in a first time, we use the noop job type: with this noop job type, OAR will not try to execute anything on the job resources (which is what we want since disk resources are not capable of executing programs).

Second: reserve the nodes

Note

In the following example, remove the -t deploy if you plan to use the standard environment and sudo-g5k in order to get the root privileges, instead of kadeploy and be root in you own deployed environment.

You can then reserve nodes grimoire-1 and grimoire-2 for 3 hours, in the usual way:

Show disks once connected on the machines

Once connected to a node where you reserved one or more disks, several tools can be used to manage the disk(s):

lsblk will show you the block devices of your disks: sdb, sdc, ... (be careful: sda is the system disk);

Commands like fdisk or parted can be used to partition the disk, if needed;

mkfs can be used to format the disk.

Mind that the platform provides access to the block devices. It does not manage partitioning nor formatting nor mounting.

Security issues

The mechanism used to enable/disable disks is designed to avoid mistakes from other users. However, a malicious user could take control of the RAID card, enable any disk, and access or erase your data. Please notify the Grid'5000 tech-team in case of such event, but first of all mind securing your data:

Keep a copy (backup) in a safe place if relevant for your data ;

If your data is sensitive, mind using cryptographic mechanisms to secure it.

Also, the data on reserved disks is not automatically erased at the end of your job. If you don't want the next user to access it, you have to erase it yourself.