To supplement the boot disk, you can attach
[local Solid State Drives (local SSDs)](https://docs.cloud.google.com/compute/docs/disks/local-ssd.md.txt)
to master, primary worker, and secondary worker nodes in your cluster.
When local SSDs are provided to the cluster, both HDFS and scratch data,
such as shuffle outputs, use the local SSDs instead of the boot
persistent disk.

- Local SSDs can provide faster read and write times than persistent disk (see [Local SSD Performance](https://docs.cloud.google.com/compute/docs/disks/local-ssd.md.txt#performance)).
- The 375GB size of each local SSD is fixed, but you can attach multiple local SSDs to increase SSD storage (see [About Local SSDs](https://docs.cloud.google.com/compute/docs/disks/local-ssd.md.txt)).
- Each local SSD is mounted to `/mnt/<id>` in Managed Service for Apache Spark cluster nodes.
- Local SSDs use [`ext4`](https://en.wikipedia.org/wiki/Ext4) as the default filesystem.

## Use local SSDs

### Google Cloud console

Create a cluster and attach local SSDs to the nodes:

1. Open the Managed Service for Apache Spark [Create cluster](https://console.cloud.google.com/dataproc/clusters/create) page.
2. Click **Additional configuration** to expand that section.
3. Edit **Primary workers** and **Secondary workers** to configure local SSD settings.
4. By default, driver (master) node settings are the same as primary worker settings. Under **Additional configuration** , you can click **Driver node** to clear the **Default driver node to the same as primary worker** checkbox, then specify driver node settings.

### gcloud CLI command

Use the
[`gcloud dataproc clusters create`](https://docs.cloud.google.com/sdk/gcloud/reference/dataproc/clusters/create.md.txt)
command with the `--num-master-local-ssds`,
`--num-workers-local-ssds`, and
`--num-secondary-worker-local-ssds` flags to attach local
SSDs to the cluster's master, primary, and secondary worker
nodes.

Local SSDs can be attached to Managed Service for Apache Spark VMs using a SCSI
(Small Computer System Interface) or NVME (Non-Volatile Memory Express) interface (see
[local SSD performance](https://docs.cloud.google.com/compute/docs/disks/local-ssd.md.txt#performance)).
The default Managed Service for Apache Spark cluster VM local SSD interface is the SCSI interface. Use the
[gcloud dataproc clusters create](https://docs.cloud.google.com/sdk/gcloud/reference/dataproc/clusters/create.md.txt)
command with the `--master-local-ssd-interface`,
`--worker-local-ssd-interface`, and
`--secondary-worker-local-ssd-interface` flags
to specify the local SSD interface for master, primary, and secondary
worker nodes.

**Example:**

```
gcloud dataproc clusters create cluster-name \
    --region=region \
    --num-master-local-ssds=1 \
    --num-worker-local-ssds=1 \
    --num-secondary-worker-local-ssds=1 \
    --master-local-ssd-interface=NVME \
    --worker-local-ssd-interface=NVME \
    --secondary-worker-local-ssd-interface=NVME \
    ... other args ...
```

### REST API

Set the
[numLocalSsds](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/ClusterConfig.md.txt#diskconfig)
field in the `masterConfig`, `workerConfig`, and
`secondaryWorkerConfig`
[InstanceGroupConfig](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/ClusterConfig.md.txt#InstanceGroupConfig)
in a
[cluster.create](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/create.md.txt)
API request to attach local SSDs to the cluster's master, primary worker, and
secondary worker nodes.

Local SSDs can be attached to Managed Service for Apache Spark VMs using a SCSI
(Small Computer System Interface) or NVME (Non-Volatile Memory Express) interface (see
[local SSD performance](https://docs.cloud.google.com/compute/docs/disks/local-ssd.md.txt#performance)).
The default Managed Service for Apache Spark cluster VM local SSD interface is the SCSI interface. Set the
[localSsdInterface](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/ClusterConfig.md.txt#diskconfig)
field in the `masterConfig`, `workerConfig`, and
`secondaryWorkerConfig`
[InstanceGroupConfig](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/ClusterConfig.md.txt#InstanceGroupConfig)
in a
[cluster.create](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/create.md.txt)
API request to specify the "SCSI" or "NVME" interface to attach local SSDs to the cluster's master,
primary worker, and secondary worker nodes.