# How to Resize a Machine Machines are Linux and Windows virtual machines with persistent storage, GPU options, and free unlimited bandwidth. They’re designed for high-performance computing (HPC) workloads. You can resize your machine’s machine type and disk size depending on your needs. Resizing your machine incurs a prorated charge based on when you resized your machine. You can resize a machine using the [Paperspace console](https://console.paperspace.com), [Paperspace API](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md), or [Paperspace CLI](https://docs.digitalocean.com/reference/paperspace/pspace/index.html.md). There are two ways you can resize your machines: - **Change Machine Type**. This option increases or decreases the amount of CPU or GPU on your machine. Increasing the amount of CPU or GPU on your machine improves your machine’s performance. - **Increase Disk Size**. This option permanently increases the size of your machine’s disk. Increasing the size of your machine’s disk increases the amount of data you can store. You can resize one or both of these options based on what you need. ## Considerations Before Resizing - **The full disk size isn’t equal to the amount of storage available in your machine**. The amount of storage available in your machine is the disk size minus the overhead of the machine. For example, the [ML-in-a-Box](https://docs.digitalocean.com/products/paperspace/machines/getting-started/run-ml-in-a-box/index.html.md) template uses 28 GB of storage, which leaves 66 GB of available storage. To see an overview of the current storage usage on your machine, run a `df -h` command. The `/dev/mapper/ubuntu--vg-root` line shows you the size of your disk, the amount of disk used, and the amount of disk available. ```text Filesystem Size Used Avail Use% Mounted on tmpfs 25G 1.5M 25G 1% /run /dev/mapper/ubuntu--vg-root 97G 28G 65G 31% / ... ``` - **You may have ran out of disk space due to cached data**. Examples of cached data are Docker images or previous model versions you’ve trained. You can delete your cached data by going through your machine’s drive. - **You can only update a machine type within the same machine type group**. For example, if you’re using a CPU machine, then you can only resize your machine amongst the CPU machine types. Similarly, for GPU machines, if you’re using an A100 machine, for example, you can only resize the machine type amongst the other AX00 machine types. If you need a different machine type entirely, [create a new machine](https://docs.digitalocean.com/products/paperspace/machines/how-to/create/index.html.md). - **We strongly recommend [taking a snapshot](https://docs.digitalocean.com/products/paperspace/machines/how-to/manage-snapshots/index.html.md#manual) of the machine before resizing**. [Snapshots](https://docs.digitalocean.com/products/paperspace/machines/how-to/manage-snapshots/index.html.md) are reliable backups of your machine. If your machine malfunctions, disconnects from Paperspace, or experiences issues like data corruption or system failures during resizing, you can use a snapshot to restore your machine to a working state with your data still intact. - **You cannot decrease the size of a machine’s disk.** You can only increase your disk size since decreasing may cause your machine to lose or corrupt your data. When you increase your disk size, this permanently expands your storage and is irreversible. ## Resize a Machine ### Using the Paperspace Console Before resizing your machine, you need to [turn off your machine](https://docs.digitalocean.com/products/paperspace/machines/getting-started/quickstart/index.html.md#shutdown-or-restart-machines). Afterwards, go to the [Paperspace console](https://console.paperspace.com), in the top-right corner, click the drop-down menu, select **CORE**, then click the **Machines** tab. In the **Machines** section, find and select the machine you want to resize. On the machine’s overview page, in the top-right corner, click the **Settings** tab. In the **Settings** page, there are two sections that resize your machine: **Machine** section and **Disk size** section. To change your [machine type](https://docs.digitalocean.com/products/paperspace/machines/details/pricing/index.html.md), in the **Machine** section, click the drop-down menu, select the new machine type you want to use, then click **CHANGE TYPE**. In your machine’s overview page, click the **Details** tab, in the right side, you should see your machine’s updated machine type. To increase your [storage](https://docs.digitalocean.com/products/paperspace/machines/details/features/index.html.md#block-storage), in the **Disk size** section, click the drop-down menu, select the new disk size you want to use, then click **CHANGE SIZE**. In your machine’s overview page, click the **Details** tab, in the right side, you should see your machine’s updated disk size. ### Using the Paperspace API Before resizing your machine, you need to [turn off your machine](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md#operation/machines-stop). ## How to Resize a Machine Using the Paperspace API When resizing a machine using the Paperspace API, you need to provide the following values: - `id` (string): The ID of the machine you want to resize. - `machineType` (string): The new [hardware your machine](https://docs.digitalocean.com/products/paperspace/machines/details/pricing/index.html.md) is built on. This must correspond to a machine type label, indicated in [List OS templates](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md#tag/OS-Templates) or [List templates](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md#operation/customTemplates-list). - `diskSize` (number): The new [disk size](https://docs.digitalocean.com/products/paperspace/machines/details/features/index.html.md#block-storage) of your machine in GB. 1. [Create an API key to authenticate your requests to your Paperspace account](https://docs.digitalocean.com/reference/paperspace/api-keys/index.html.md) and save it for use. 2. Send a PUT request to `https://api.paperspace.com/v1/machines/{machine-id}`. ```bash curl -X PUT \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $PAPERSPACE_API_KEY" \ -d '{ "id": "psm9u09bwu5i", "machineType": "a100-80g", "diskSize": 50 }' \ "https://api.paperspace.com/v1/machines/psm9u09bwu5i" ``` After the resize is complete, [turn on your machine](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md#operation/machines-start). ### Using the Paperspace CLI Before resizing your machine, you need to [turn off your machine](https://docs.digitalocean.com/reference/paperspace/pspace/commands/machine/index.html.md#pspace-machine-stop). ## How to Resize a Machine Using the Paperspace CLI When resizing a machine using the Paperspace API, you need to provide the following values: - `machine-type` (string): The new [hardware your machine](https://docs.digitalocean.com/products/paperspace/machines/details/pricing/index.html.md) is built on. This must correspond to a machine type label, indicated in [List OS templates](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md#tag/OS-Templates) or [List templates](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md#operation/customTemplates-list). - `disk-size` (number): The new [disk size](https://docs.digitalocean.com/products/paperspace/machines/details/features/index.html.md#block-storage) of your machine in GB. 1. [Install `pspace`](https://docs.digitalocean.com/reference/paperspace/pspace/install/index.html.md), the Paperspace command-line tool. 2. [Create an API key to authenticate your requests to your Paperspace account](https://docs.digitalocean.com/reference/paperspace/api-keys/index.html.md) and save it for use with `pspace`. 3. Use the API key to grant `pspace` access to your Paperspace account. ```bash pspace login --api-key your-api-key ``` 4. Finally, run `pspace machine update -F [flags]`. ```bash pspace machine update psm9u09bwu5i -F --machine-type a100-80g --disk-size 50 ``` After the resize is complete, [turn on your machine](https://docs.digitalocean.com/reference/paperspace/pspace/commands/machine/index.html.md#pspace-machine-start). ## Verifying If Machine Resized You can verify if your machine is resized properly either by viewing the Paperspace console under the machine’s **Details** page, or by fetching the machine’s specifications via [Paperspace API](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md#operation/machines-get) or [Paperspace CLI](https://docs.digitalocean.com/reference/paperspace/core/commands/machines/index.html.md#pspace-machine-get).