I have been using Proxmox for a couple months now. Currently, I am hosting multiple Proxmox containers and virtual machines in my Proxmox server. As the number of containers and VMs is growing gradually, I needed an additional storage. So I bought a new 1 TB SSD and migrated a few containers and VMs to the new storage disk. If you ever been in a situation like this, just follow the steps given below to move Proxmox Containers and VMs to a different disk.
Add New Storage In Proxmox
Before migrating the Proxmox Containers and VMs, make sure you created and configured a new external storage.
Adding a new, additional storage disk to Proxmox is not a big deal. We can do it via Proxmox web dashboard in a couple minutes.
If you want to add a new storage to Proxmox, please refer the following guide.
Move Proxmox Containers And VMs To Different Storage Disk
Login to the Proxmox Web dashboard. Navigate to the VM or Container that you want to move to different disk.
Changing the storage disk path for container is slightly different than changing storage disk for VM. First, we will see how to do it for Proxmox containers.
Migrate Proxmox Container To Different Disk
If you try to move Proxmox Container to different storage, select Proxmox container -> Resources -> Root Disk. And then click "Volume Action" drop down box and click "Move Storage" from the drop-down menu.
In the next window, select the newly added storage box for the container from "Target Storage" drop-down box and click "Move Volume" option.
You can also check the "Delete Source" box to remove the virtual disk completely from the source location. Please careful while selecting this option. It will completely remove the virtual disk from your source after cloning the virtual disk disk to new external disk.
Now the container storage will be cloned and moved from your local disk to the newly added external disk.
Migrate Proxmox VM To Different Disk
Select Proxmox VM -> Hardware -> Hard Disk (scsi0). Click the "Disk Action" drop down box and choose "Move Storage" from the drop down box.
In the next window, select the newly added storage box for the VM from "Target Storage" drop-down box and click "Move Disk" option.
You ca also check the box that says "Delete Source" if you want to completely delete the source disk from the source storage (i.e. local) to the destination (i.e. new disk).
This will create a full clone of the current virtual disk and it will be moved to the new storage disk.
The source disk will be automatically deleted once the migration is completed.
You can verify if the VM is really moved to the new disk by looking at the "Hard Disk" parameter from the Proxmox web dashboard.
That's it. The virtual disk path of the Proxmox VM is changed now. The selected storage is assigned to the Proxmox VM. From now on, the virtual disk for the VM will be kept in the new external disk instead of the local disk.
Migrating the containers and VMs to different storage disk is inevitable when there is low disk space in your local storage. Sooner or later you may run of disk space. In such situations, you can safely and quickly move the Proxmox containers and VMs to different disk without any data loss as described above. Good luck!