eWaterCycle / infra

Instructions for system administrators to deploy the eWaterCycle platform
Apache License 2.0
0 stars 0 forks source link

Use external_volumes resource parameter to map storage items to right home and cache #127

Open sverhoeven opened 2 years ago

sverhoeven commented 2 years ago

Define a plugin parameter like

portal live surfresearchcloud nl_ (1)

In Ansible a external_volumes variable will be available which is a string. This contains the storage items in the order the user selected it. The external_volumes var will be populated by the SRC system.

To get /home and /dcache-cache mounted from the right storage items we need to map the volume_id to a disk id. For example first volume_id is ddc30b53-105e-4113-9379-c7d3ec9d90e5 then /dev/sdb1 is the first storage item selected.

ls -l /dev/disk/by-id/
lrwxrwxrwx 1 root root  9 Jan  6 15:09 scsi-SQEMU_QEMU_HARDDISK_ddc30b53-105e-4113-9379-c7d3ec9d90e5 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jan  6 15:09 scsi-SQEMU_QEMU_HARDDISK_ddc30b53-105e-4113-9379-c7d3ec9d90e5-part1 -> ../../sdb1
sverhoeven commented 2 years ago

Ansible tasks could be something like

shell: echo {{ external_volumes }} | jq [0].volume_id | <grep in /dev/disk/by-id/ for right sdXX>
  register: home_device
mount:
  src: home_device
  target: home_dir
sverhoeven commented 2 years ago

We should keep the vagrant build working with 2 extra disks. We probably need a vagrant and src ansible blocks to treat them accordingly.