Stay organized with collections
Save and categorize content based on your preferences.
You can configure your custom training jobs to mount Network File System (NFS)
shares to the container where your code is running. This lets your jobs
access remote files as if they were local, enabling high throughput and
low latency.
This guide shows how to mount a Network File System share when running a
custom training job.
You can use a Filestore instance as your NFS share.
If you are using Filestore and plan to use VPC
peering for Vertex AI in the next step, select private service
access as the connect mode when you create an instance. For an example, see
Create instances
in the Filestore documentation.
Network File System information for custom training
When you create a custom training job that mounts an NFS share, you must
specify the following:
The name of the network for Vertex AI to access. The way that you
specify the network name differs depending on the type of custom training
job. For details, see Perform custom training.
Your NFS configuration in the WorkerPoolSpec field.
Include the following fields:
Field
Description
nfsMounts.server
The IP address of your NFS server. This must be a private address in your VPC.
nfsMounts.path
The NFS share path. This must be an absolute path that begins with /.
nfsMounts.mountPoint
The local mount point. This must be a valid UNIX directory name. For example, if the local mount point is sourceData, then specify the path /mnt/nfs/sourceData from your training VM instance.
Create a file named config.yaml that describes the PSA or Private Service Connect interface config
mount settings for your training job. Use one of the following formats:
NETWORK_ATTACHMENT_NAME: The name of your network attachment.
MACHINE_TYPE: The identifier of your virtual machine type.
PYTHON_PACKAGE_EXECUTOR_IMAGE_URI or PRE_BUILT_CONTAINER_IMAGE_URI:
The URI of a container image in Artifact Registry that will run the provided
Python package. Vertex AI provides a
wide range of executor images with pre-installed packages
to meet users' various use cases.
PYTHON_PACKAGE_URIS: A comma-separated list of
Cloud Storage URIs that specify the Python package files that
make up the training program and its dependent packages. The maximum
number of package URIs is 100.
PYTHON_MODULE: The Python module name to run after installing
the packages.
NFS_SERVER_IP: The IP address of your NFS server.
NFS_SHARE_NAME: The NFS share path, which is an
absolute path that begins with /.
LOCAL_FOLDER: The local mount point (UNIX directory name).
Make sure that your network name is formatted correctly and that your NFS
share exists in the specified network.
Create your custom job and pass your config.yaml file to the --config
parameter.
PROJECT_NUMBER: The project ID of your Google Cloud project.
NETWORK_NAME: The name of your private or Shared VPC.
MACHINE_TYPE: The identifier of your virtual machine type.
PYTHON_PACKAGE_EXECUTOR_IMAGE_URI or PRE_BUILT_CONTAINER_IMAGE_URI:
The URI of a container image in Artifact Registry that will run the provided
Python package. Vertex AI provides a
wide range of executor images with pre-installed packages
to meet users' various use cases.
PYTHON_PACKAGE_URIS: A comma-separated list of
Cloud Storage URIs that specify the Python package files that
make up the training program and its dependent packages. The maximum
number of package URIs is 100.
PYTHON_MODULE: The Python module name to run after installing
the packages.
NFS_SERVER_IP: The IP address of your NFS server.
NFS_SHARE_NAME: The NFS share path, which is an
absolute path that begins with /.
LOCAL_FOLDER: The local mount point (UNIX directory name).
Make sure that your network name is formatted correctly and that your NFS
share exists in the specified network.
Create your custom job and pass your config.yaml file to the --config
parameter.
[[["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-08-28 UTC."],[],[],null,["# Mount a Network File System share\n\nYou can configure your custom training jobs to mount Network File System (NFS)\nshares to the container where your code is running. This lets your jobs\naccess remote files as if they were local, enabling high throughput and\nlow latency.\n\nThis guide shows how to mount a Network File System share when running a\ncustom training job.\n\nBefore you begin\n----------------\n\n1. Create an NFS share in a\n [Virtual Private Cloud (VPC)](/vpc/docs/vpc-peering). Your share must be\n accessible without authentication.\n\n You can use a Filestore instance as your NFS share.\n If you are using [Filestore](/filestore) and plan to use VPC\n peering for Vertex AI in the next step, select **private service\n access** as the connect mode when you create an instance. For an example, see\n [Create instances](/filestore/docs/creating-instances)\n in the Filestore documentation.\n2. To connect Vertex AI with the VPC that hosts your NFS share,\n follow the instructions in [Use Private Service Connect interface for Vertex AI](/vertex-ai/docs/training/psc-i-egress) (recommended), or [Set up VPC Network Peering](/vertex-ai/docs/general/vpc-peering).\n\nNetwork File System information for custom training\n---------------------------------------------------\n\nWhen you create a custom training job that mounts an NFS share, you must\nspecify the following:\n\n- The name of the network for Vertex AI to access. The way that you\n specify the network name differs depending on the type of custom training\n job. For details, see [Perform custom training](/vertex-ai/docs/training/using-private-ip#perform-custom-training).\n\n- Your NFS configuration in the [WorkerPoolSpec field](/vertex-ai/docs/reference/rest/v1/CustomJobSpec#workerpoolspec).\n Include the following fields:\n\n For more information, see [Where to specify compute resources](/vertex-ai/docs/training/configure-compute#where_to_specify_compute_resources).\n\nExample: create a custom job using the gcloud CLI\n-------------------------------------------------\n\n1. Follow the steps in\n [Create a Python training application for a prebuilt container](/vertex-ai/docs/training/create-python-pre-built-container)\n to build a training application to run on Vertex AI.\n\n2. Create a file named `config.yaml` that describes the PSA or Private Service Connect interface config\n mount settings for your training job. Use one of the following formats:\n\n### Private Service Connect interface\n\n\n| **Preview\n| --- Private Service Connect interface**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\n\u003cbr /\u003e\n\n1. To use Private Service Connect interface:\n\n pscInterfaceConfig:\n network_attachment: \u003cvar translate=\"no\"\u003eNETWORK_ATTACHMENT_NAME\u003c/var\u003e\n workerPoolSpecs:\n - machineSpec:\n machineType: \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e\n replicaCount: 1\n pythonPackageSpec:\n executorImageUri: \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_EXECUTOR_IMAGE_URI\u003c/var\u003e or \u003cvar translate=\"no\"\u003ePRE_BUILT_CONTAINER_IMAGE_URI\u003c/var\u003e\n packageUris:\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_URIS\u003c/var\u003e\n pythonModule: PYTHON_MODULE\n nfsMounts:\n - server: \u003cvar translate=\"no\"\u003eNFS_SERVER_IP\u003c/var\u003e\n path: \u003cvar translate=\"no\"\u003eNFS_SHARE_NAME\u003c/var\u003e\n mountPoint: LOCAL_FOLDER\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNETWORK_ATTACHMENT_NAME\u003c/var\u003e: The name of your network attachment.\n\n - \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e: The identifier of your virtual machine type.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_EXECUTOR_IMAGE_URI\u003c/var\u003e or \u003cvar translate=\"no\"\u003ePRE_BUILT_CONTAINER_IMAGE_URI\u003c/var\u003e:\n The URI of a container image in Artifact Registry that will run the provided\n Python package. Vertex AI provides a\n [wide range of executor images with pre-installed packages](/vertex-ai/docs/training/pre-built-containers)\n to meet users' various use cases.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_URIS\u003c/var\u003e: A comma-separated list of\n Cloud Storage URIs that specify the Python package files that\n make up the training program and its dependent packages. The maximum\n number of package URIs is 100.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_MODULE\u003c/var\u003e: The Python module name to run after installing\n the packages.\n\n - \u003cvar translate=\"no\"\u003eNFS_SERVER_IP\u003c/var\u003e: The IP address of your NFS server.\n\n - \u003cvar translate=\"no\"\u003eNFS_SHARE_NAME\u003c/var\u003e: The NFS share path, which is an\n absolute path that begins with `/`.\n\n - \u003cvar translate=\"no\"\u003eLOCAL_FOLDER\u003c/var\u003e: The local mount point (UNIX directory name).\n\n Make sure that your network name is formatted correctly and that your NFS\n share exists in the specified network.\n2. Create your custom job and pass your `config.yaml` file to the `--config`\n parameter.\n\n gcloud ai custom-jobs create \\\n --region=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --display-name=\u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e \\\n --config=config.yaml\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Specify the region to create the job in.\n\n - \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: A name for the custom job.\n\n### VPC peering\n\n1. Use VPC Peering if you want the job to use VPC Peering/PSA on the job\n or not.\n\n network: projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e/global/networks/\u003cvar translate=\"no\"\u003eNETWORK_NAME\u003c/var\u003e\n workerPoolSpecs:\n - machineSpec:\n machineType: \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e\n replicaCount: 1\n pythonPackageSpec:\n executorImageUri: \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_EXECUTOR_IMAGE_URI\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003eor\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003e\n \u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003ePRE_BUILT_CONTAINER_IMAGE_URI\u003c/var\u003e\n packageUris:\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_URIS\u003c/var\u003e\n pythonModule: \u003cvar translate=\"no\"\u003ePYTHON_MODULE\u003c/var\u003e\n nfsMounts:\n - server: \u003cvar translate=\"no\"\u003eNFS_SERVER_IP\u003c/var\u003e\n path: \u003cvar translate=\"no\"\u003eNFS_SHARE_NAME\u003c/var\u003e\n mountPoint: \u003cvar translate=\"no\"\u003eLOCAL_FOLDER\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e: The project ID of your Google Cloud project.\n\n - \u003cvar translate=\"no\"\u003eNETWORK_NAME\u003c/var\u003e: The name of your private or Shared VPC.\n\n - \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e: The identifier of your virtual machine type.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_EXECUTOR_IMAGE_URI or PRE_BUILT_CONTAINER_IMAGE_URI\u003c/var\u003e:\n The URI of a container image in Artifact Registry that will run the provided\n Python package. Vertex AI provides a\n [wide range of executor images with pre-installed packages](/vertex-ai/docs/training/pre-built-containers)\n to meet users' various use cases.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_PACKAGE_URIS\u003c/var\u003e: A comma-separated list of\n Cloud Storage URIs that specify the Python package files that\n make up the training program and its dependent packages. The maximum\n number of package URIs is 100.\n\n - \u003cvar translate=\"no\"\u003ePYTHON_MODULE\u003c/var\u003e: The Python module name to run after installing\n the packages.\n\n - \u003cvar translate=\"no\"\u003eNFS_SERVER_IP\u003c/var\u003e: The IP address of your NFS server.\n\n - \u003cvar translate=\"no\"\u003eNFS_SHARE_NAME\u003c/var\u003e: The NFS share path, which is an\n absolute path that begins with `/`.\n\n - \u003cvar translate=\"no\"\u003eLOCAL_FOLDER\u003c/var\u003e: The local mount point (UNIX directory name).\n\n Make sure that your network name is formatted correctly and that your NFS\n share exists in the specified network.\n2. Create your custom job and pass your `config.yaml` file to the `--config`\n parameter.\n\n gcloud ai custom-jobs create \\\n --region=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --display-name=\u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e \\\n --config=config.yaml\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Specify the region to create the job in.\n\n- \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: A name for the custom job.\n\nLimitations\n-----------\n\n- You must mount your NFS share using an IP address that is internal to your\n VPC; using public URLs isn't allowed.\n\n- Training jobs mount NFS shares without authentication, and will fail\n if a username and password are required.\n\n To secure your data, set permissions\n on your NFS share. If you are using Filestore, see\n [access control](/filestore/docs/access-control) in the Filestore\n documentation.\n- You can't run two training jobs that mount NFS shares from different\n VPC networks at the same time. This is due to the\n [network peering restriction](/vertex-ai/docs/training/using-private-ip#run_jobs_on_different_networks)."]]