Subnet reservation
Problem statement
Available subnets
Each site of Grid'5000 is allocated a /14 ip block giving thus a total of 262142 different IPs. Therefore, the maximum range of IPs has to be in this /14 subnet.
The /14 address block available on each site is divided in four /16 blocks as described here. The last two /16 blocks are used for IP reservation through OAR. Because they are contiguous, we can see them as a single /15 block where the last 2 IPs are reserved for Grid'5000 infrastructure. Therefore, the reservable range of IPs is composed of a total of 131070 - 2 = 131068 IPs.
Concerning the smallest subnet size, it is a /22, which is equivalent to 1022 hosts per subnet. We do not allow smaller subnets to avoid a scheduling overhead in OAR. The /15 block contains 128 reservable /22 subnets.
Requesting subnets
Subnet reservation through OAR is similar to normal resource reservation.
To reserve 4 /21 subnets and 2 nodes, just type:
You can of-course have more complex request. To obtain 4 /21 on different /20 subnets, you can type:
Getting your networks
From inside Grid'5000
The simplest way to get the list of your allocated subnets is to use the get_subnets
script provided on the head node of the submission. OAR provides a property file ($OAR_RESOURCE_PROPERTIES_FILE) where the resources are described. By default, the script uses this file if no other is specified with the -f option.
# get_subnets 10.8.0.0 10.8.8.0
The "-p" options prints the CIDR format
# get_subnets -p 10.8.0.0/21 10.8.8.0/21
Different other printing options are available (-b to display broadcast address, -n to see the netmask, and -a is equivalent to -bnp):
# get_subnets -a 10.8.0.0/21 10.8.7.255 255.255.248.0 10.8.8.0/21 10.8.15.255 255.255.248.0
You can also compress the subnets into a larger one if they are contiguous:
# get_subnets -cp 10.8.0.0/22
However, when not contiguous, the networks are not merged.
# get_subnets -p 10.8.0.0/21 10.8.16.0/21 # get_subnets -pc 10.8.0.0/21 10.8.16.0/21
Another option available is to get the subnets of any job (running or terminated) using the -j option. This can only be used from a computer where oarstat
is usable. Because it uses oarstat
that will query the OAR database, it is slower than just reading a property file
# get_subnets -j 123456 -p 10.8.0.0/21 10.8.16.0/21
Using the Grid'5000 API
TODO