Reference documentation and code samples for the Batch V1 API class Google::Cloud::Batch::V1::Volume.
Volume describes a volume and parameters for it to be mounted to a VM.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#device_name
defdevice_name()->::String
Returns
(::String) — Device name of an attached disk volume, which should align with a
device_name specified by
job.allocation_policy.instances[0].policy.disks[i].device_name or
defined by the given instance template in
job.allocation_policy.instances[0].instance_template.
Note: The following fields are mutually exclusive: device_name, nfs, gcs. If a field in that set is populated, all other fields in the set will automatically be cleared.
#device_name=
defdevice_name=(value)->::String
Parameter
value (::String) — Device name of an attached disk volume, which should align with a
device_name specified by
job.allocation_policy.instances[0].policy.disks[i].device_name or
defined by the given instance template in
job.allocation_policy.instances[0].instance_template.
Note: The following fields are mutually exclusive: device_name, nfs, gcs. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — Device name of an attached disk volume, which should align with a
device_name specified by
job.allocation_policy.instances[0].policy.disks[i].device_name or
defined by the given instance template in
job.allocation_policy.instances[0].instance_template.
Note: The following fields are mutually exclusive: device_name, nfs, gcs. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: gcs, nfs, device_name. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: gcs, nfs, device_name. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: gcs, nfs, device_name. If a field in that set is populated, all other fields in the set will automatically be cleared.
#mount_options
defmount_options()->::Array<::String>
Returns
(::Array<::String>) —
Mount options vary based on the type of storage volume:
For a Cloud Storage bucket, all the mount options provided
by
the gcsfuse tool
are supported.
For an existing persistent disk, all mount options provided by the
mount command
except writing are supported. This is due to restrictions of
multi-writer
mode.
For any other disk or a Network File System (NFS), all the
mount options provided by the mount command are supported.
#mount_options=
defmount_options=(value)->::Array<::String>
Parameter
value (::Array<::String>) —
Mount options vary based on the type of storage volume:
For a Cloud Storage bucket, all the mount options provided
by
the gcsfuse tool
are supported.
For an existing persistent disk, all mount options provided by the
mount command
except writing are supported. This is due to restrictions of
multi-writer
mode.
For any other disk or a Network File System (NFS), all the
mount options provided by the mount command are supported.
Returns
(::Array<::String>) —
Mount options vary based on the type of storage volume:
For a Cloud Storage bucket, all the mount options provided
by
the gcsfuse tool
are supported.
For an existing persistent disk, all mount options provided by the
mount command
except writing are supported. This is due to restrictions of
multi-writer
mode.
For any other disk or a Network File System (NFS), all the
mount options provided by the mount command are supported.
#mount_path
defmount_path()->::String
Returns
(::String) — The mount path for the volume, e.g. /mnt/disks/share.
#mount_path=
defmount_path=(value)->::String
Parameter
value (::String) — The mount path for the volume, e.g. /mnt/disks/share.
Returns
(::String) — The mount path for the volume, e.g. /mnt/disks/share.
Note: The following fields are mutually exclusive: nfs, gcs, device_name. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: nfs, gcs, device_name. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: nfs, gcs, device_name. If a field in that set is populated, all other fields in the set will automatically be cleared.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Batch V1 API - Class Google::Cloud::Batch::V1::Volume (v1.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.0 (latest)](/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Volume)\n- [1.1.1](/ruby/docs/reference/google-cloud-batch-v1/1.1.1/Google-Cloud-Batch-V1-Volume)\n- [1.0.0](/ruby/docs/reference/google-cloud-batch-v1/1.0.0/Google-Cloud-Batch-V1-Volume)\n- [0.21.0](/ruby/docs/reference/google-cloud-batch-v1/0.21.0/Google-Cloud-Batch-V1-Volume)\n- [0.20.1](/ruby/docs/reference/google-cloud-batch-v1/0.20.1/Google-Cloud-Batch-V1-Volume)\n- [0.19.2](/ruby/docs/reference/google-cloud-batch-v1/0.19.2/Google-Cloud-Batch-V1-Volume)\n- [0.18.3](/ruby/docs/reference/google-cloud-batch-v1/0.18.3/Google-Cloud-Batch-V1-Volume)\n- [0.17.4](/ruby/docs/reference/google-cloud-batch-v1/0.17.4/Google-Cloud-Batch-V1-Volume)\n- [0.16.2](/ruby/docs/reference/google-cloud-batch-v1/0.16.2/Google-Cloud-Batch-V1-Volume)\n- [0.15.1](/ruby/docs/reference/google-cloud-batch-v1/0.15.1/Google-Cloud-Batch-V1-Volume)\n- [0.14.0](/ruby/docs/reference/google-cloud-batch-v1/0.14.0/Google-Cloud-Batch-V1-Volume)\n- [0.13.1](/ruby/docs/reference/google-cloud-batch-v1/0.13.1/Google-Cloud-Batch-V1-Volume)\n- [0.12.0](/ruby/docs/reference/google-cloud-batch-v1/0.12.0/Google-Cloud-Batch-V1-Volume)\n- [0.11.1](/ruby/docs/reference/google-cloud-batch-v1/0.11.1/Google-Cloud-Batch-V1-Volume)\n- [0.10.5](/ruby/docs/reference/google-cloud-batch-v1/0.10.5/Google-Cloud-Batch-V1-Volume)\n- [0.9.0](/ruby/docs/reference/google-cloud-batch-v1/0.9.0/Google-Cloud-Batch-V1-Volume)\n- [0.8.0](/ruby/docs/reference/google-cloud-batch-v1/0.8.0/Google-Cloud-Batch-V1-Volume)\n- [0.7.0](/ruby/docs/reference/google-cloud-batch-v1/0.7.0/Google-Cloud-Batch-V1-Volume)\n- [0.6.0](/ruby/docs/reference/google-cloud-batch-v1/0.6.0/Google-Cloud-Batch-V1-Volume)\n- [0.5.0](/ruby/docs/reference/google-cloud-batch-v1/0.5.0/Google-Cloud-Batch-V1-Volume)\n- [0.4.3](/ruby/docs/reference/google-cloud-batch-v1/0.4.3/Google-Cloud-Batch-V1-Volume)\n- [0.3.0](/ruby/docs/reference/google-cloud-batch-v1/0.3.0/Google-Cloud-Batch-V1-Volume)\n- [0.2.0](/ruby/docs/reference/google-cloud-batch-v1/0.2.0/Google-Cloud-Batch-V1-Volume)\n- [0.1.0](/ruby/docs/reference/google-cloud-batch-v1/0.1.0/Google-Cloud-Batch-V1-Volume) \nReference documentation and code samples for the Batch V1 API class Google::Cloud::Batch::V1::Volume.\n\nVolume describes a volume and parameters for it to be mounted to a VM. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #device_name\n\n def device_name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Device name of an attached disk volume, which should align with a device_name specified by job.allocation_policy.instances\\[0\\].policy.disks\\[i\\].device_name or defined by the given instance template in job.allocation_policy.instances\\[0\\].instance_template.\n\n Note: The following fields are mutually exclusive: `device_name`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #device_name=\n\n def device_name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Device name of an attached disk volume, which should align with a device_name specified by job.allocation_policy.instances\\[0\\].policy.disks\\[i\\].device_name or defined by the given instance template in job.allocation_policy.instances\\[0\\].instance_template.\n\n\nNote: The following fields are mutually exclusive: `device_name`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- Device name of an attached disk volume, which should align with a device_name specified by job.allocation_policy.instances\\[0\\].policy.disks\\[i\\].device_name or defined by the given instance template in job.allocation_policy.instances\\[0\\].instance_template.\n\n Note: The following fields are mutually exclusive: `device_name`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #gcs\n\n def gcs() -\u003e ::Google::Cloud::Batch::V1::GCS\n\n**Returns**\n\n- ([::Google::Cloud::Batch::V1::GCS](./Google-Cloud-Batch-V1-GCS)) --- A Google Cloud Storage (GCS) volume.\n\n\n Note: The following fields are mutually exclusive: `gcs`, `nfs`, `device_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #gcs=\n\n def gcs=(value) -\u003e ::Google::Cloud::Batch::V1::GCS\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Batch::V1::GCS](./Google-Cloud-Batch-V1-GCS)) --- A Google Cloud Storage (GCS) volume.\n\n\nNote: The following fields are mutually exclusive: `gcs`, `nfs`, `device_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- ([::Google::Cloud::Batch::V1::GCS](./Google-Cloud-Batch-V1-GCS)) --- A Google Cloud Storage (GCS) volume.\n\n\n Note: The following fields are mutually exclusive: `gcs`, `nfs`, `device_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #mount_options\n\n def mount_options() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- Mount options vary based on the type of storage volume:\n\n - For a Cloud Storage bucket, all the mount options provided by the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) are supported.\n - For an existing persistent disk, all mount options provided by the [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) except writing are supported. This is due to restrictions of [multi-writer\n mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).\n - For any other disk or a Network File System (NFS), all the mount options provided by the `mount` command are supported.\n\n### #mount_options=\n\n def mount_options=(value) -\u003e ::Array\u003c::String\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c::String\\\u003e) ---\n\n Mount options vary based on the type of storage volume:\n - For a Cloud Storage bucket, all the mount options provided by the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) are supported.\n - For an existing persistent disk, all mount options provided by the [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) except writing are supported. This is due to restrictions of [multi-writer\n mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).\n- For any other disk or a Network File System (NFS), all the mount options provided by the `mount` command are supported. \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- Mount options vary based on the type of storage volume:\n\n - For a Cloud Storage bucket, all the mount options provided by the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) are supported.\n - For an existing persistent disk, all mount options provided by the [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) except writing are supported. This is due to restrictions of [multi-writer\n mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms).\n - For any other disk or a Network File System (NFS), all the mount options provided by the `mount` command are supported.\n\n### #mount_path\n\n def mount_path() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The mount path for the volume, e.g. /mnt/disks/share.\n\n### #mount_path=\n\n def mount_path=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The mount path for the volume, e.g. /mnt/disks/share. \n**Returns**\n\n- (::String) --- The mount path for the volume, e.g. /mnt/disks/share.\n\n### #nfs\n\n def nfs() -\u003e ::Google::Cloud::Batch::V1::NFS\n\n**Returns**\n\n- ([::Google::Cloud::Batch::V1::NFS](./Google-Cloud-Batch-V1-NFS)) --- A Network File System (NFS) volume. For example, a Filestore file share.\n\n\n Note: The following fields are mutually exclusive: `nfs`, `gcs`, `device_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #nfs=\n\n def nfs=(value) -\u003e ::Google::Cloud::Batch::V1::NFS\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Batch::V1::NFS](./Google-Cloud-Batch-V1-NFS)) --- A Network File System (NFS) volume. For example, a Filestore file share.\n\n\nNote: The following fields are mutually exclusive: `nfs`, `gcs`, `device_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- ([::Google::Cloud::Batch::V1::NFS](./Google-Cloud-Batch-V1-NFS)) --- A Network File System (NFS) volume. For example, a Filestore file share.\n\n\n Note: The following fields are mutually exclusive: `nfs`, `gcs`, `device_name`. If a field in that set is populated, all other fields in the set will automatically be cleared."]]