parent-drbd-setup.sh
/opt/anjuna/nitro/drbd/parent-drbd-setup.sh --start <path_to_disk.img>
Builds the tools required to support volume mounts.
The block option enables persistent storage
for AWS Nitro Enclaves based on block mount volumes.
By using parent-drbd-setup.sh,
the enclave can read and write to these mount points using normal filesystem operations.
block mounts
are more performant than basic mounts,
because block mounts transfer blocks instead of every single filesystem operation.
parent-drbd-setup.sh requires two setup steps,
which should be performed only once:
- 
Once per parent instance, you must run parent-drbd-setup.sh --buildto build the required tools.
- 
Data is persisted as a disk image file, which must be created before using it with an enclave. To create a disk image file, run parent-drbd-setup.sh --mem <memory_in_MiB> --disk-create <path_to_disk.img>.
Then, prior to each start of an enclave with block mounts,
you must run parent-drbd-setup.sh --start <path_to_disk.img>.
After each stop of the enclave,
in order to clean up resources, run parent-drbd-setup.sh --stop.
| By default, /opt/anjuna/nitro/drbd/is not added to thePATH.
Use the absolute path/opt/anjuna/nitro/drbd/parent-drbd-setup.shor add it to yourPATH. | 
| The enclave may fail to detect the parent-drbd-setup.shif you runrun-enclaveimmediately after runningparent-drbd-setup.shdue to a known race condition.
For now, you can add a three-second delay between the two commands usingsleep 3. | 
Options
Usage
# Build the tools (one-time setup for the parent instance) cd /opt/anjuna/nitro/drbd/ ./parent-drbd-setup.sh --build # Create a disk ./parent-drbd-setup.sh --mem <memory_in_MiB> --disk-create <path_to_disk.img> # Start the persistent storage proxy ./parent-drbd-setup.sh --start <path_to_disk.img> # Stop the persistent storage proxy ./parent-drbd-setup.sh --stop
--build
This command builds the tools,
which are based on DRBD.
It is required to run parent-drbd-setup.sh --build once to set up the tools on the parent instance.
--disk-create <path_to_disk.img>
This command creates a new disk.
It is required to provide --mem when creating a new disk.
--mem <memory_in_MiB>
When creating a disk with --disk-create,
it is required to pre-allocate the full disk size.
Use --mem to specify how large of a disk to create.
--start <path_to_disk.img>
This command starts the persistent storage proxy.
It is required to run this command before running an enclave that uses block mounts.
Examples
To use parent-drbd-setup.sh,
you also need to define the block-type mounts in the enclave configuration file.
For example,
if you want to persistent files at /data/db to the disk image file,
add the following to your enclave configuration file:
mounts:
  - type: block
    name: example-volume
    mountPath: /data/dbThe enclave directory /data/db will be persisted in the <path_to_disk.img>
that was specified when you ran parent-drbd-setup.sh --start <path_to_disk.img>.
For a full example with MongoDB, see Running an application with block mounts.