Mounting Options
This document provides information on how to mount volumes onto compute resources.
Mounting Volumes During Creation​
You can mount a volume during the creation of a compute resource using the -v flag. The volume will be mounted to a default path that is curated for each container individually.
Mounting a Volume to a Running Compute Resource​
To mount a volume onto a running compute resource, use the following command:
cgc volume mount <volume_name> -t <compute_resource>
The command takes the following flags:
-
--target
,-t
: The name of the targeted compute resource. If you need to mount the volume to a location other than the default, you can use additional flags: -
--start_mount_path
,-sp
: The mounting path relative to the default one. -
--full_mount_path
,-fp
: Specifies the full mount path. Use with caution as this may lead to errors.
Please note that both mounting and unmounting a volume requires restarting the target container.
Unmounting a volume​
To unmount a volume from a compute resource use
cgc volume umount <volume_name> -t <compute_resource>
As long as the volume can be mounted to multiple resources you should specify the compute resource that should be unmounted
--target
,-t
: The name of the targeted compute resource.