Bobcares

Proxmox Attach Existing Disk to VM

by | Jul 3, 2023

Attaching an existing disk to a VM in Proxmox has several benefits, including space optimization or Simplified Data Management. Learn how to attach an existing disk to VM in Proxmox. Our Proxmox Support team is here to help you with your questions and concerns.

Overview
  1. Proxmox Attach Existing Disk to VM
  2. How to attach an existing disk to a VM in Proxmox?
  3. How to attach an existing disk to a VM in Proxmox CLI?
  4. Troubleshooting Tips
  5. Conclusion

Proxmox Attach Existing Disk to VM

If you are looking for a way to add an existing disk to a new VM, you are in the right place.

It involves placing the disk image in the directory that belongs to the VM. Furthermore, the disk image has to be in a format supported by Proxmox, like raw or qcow2. In case the disk image is a different format we can use qemu-img convert to convert between formats.

Proxmox Attach Existing Disk to VM

After that, we have to head to Proxmox and verify if the disk can be seen under “Hardware” as an unused disk.
However, if the Proxmox does not detect the new disk automatically, we have to update our virtual machine configuration file manually. Then, we have to add a new line as seen below at the end of the file:

unused0: local:/

For instance, if the virtual machine’s ID is 102 and the filename of the new disk image is “virtual-machine.raw”:

unused0: local:102/virtual-machine.raw

Then, we have to save the file and reopen the Hardware tab in Proxmox.

Now the new disk image will show up as an unused disk. Then, we can double-click it and configure it for use with the virtual machine.

How to attach an existing disk to a VM in Proxmox?

  1. First, we have to log in to the Proxmox web interface.
  2. Then, head to Virtual Machines or the specific node where our target VM is located.
  3. Once we locate the VM we want to attach the existing disk to, we have to select it.
  4. Now, head to the VM details view and click the Hardware tab to access the VM’s hardware configuration.
  5. Next, click the Add button to add a new device to the VM and choose Hard Disk from the list of available hardware devices.
  6. At this point, we have to choose “Use an existing disk image file” and click Next in the disk configuration dialog.
  7. Furthermore, we have to mention the path to the existing disk image file on the Proxmox storage or the storage location accessible to Proxmox.
  8. We also have to select the corresponding disk format for the existing disk image.
  9. Now it is time to configure the additional disk options.
  10. Finally, click “Finish” to save the changes.
  11. Now it is time to start the VM to access the attached disk within the guest operating system.

How to attach an existing disk to a VM in Proxmox CLI?

We must run the following steps in order to attach an existing disk to a VM in Proxmox CLI:

  1. Identify Disk Location: Find the exact path of the disk image on the Proxmox server.
  2. Create Disk Configuration: To create a new disk configuration for the VM, run the following command:
    qm config -add disk:virtio=local-lvm:/,size=,format=qcow2

    Replace with the virtual machine’s ID, with the storage name, with the path to the disk image, and with the required disk size.

  3. Start or Restart VM: To apply the changes, restart the VM.

Troubleshooting Tips

1. Check that the disk was correctly mounted and recognized by both the Proxmox VE and the VM’s operating system.

2. Verify the permissions and ownership of the disk file on the Proxmox storage.

3. Check the VM’s settings to confirm it corresponds to the intended disk arrangement.

[Need assistance with a different issue? Our team is available 24/7.] x

Conclusion

Attaching an existing disk to a VM in Proxmox has various advantages, including enhanced resource usage, simplified data management, higher performance, and increased flexibility. By maximizing the use of current hardware, you may optimize storage, cut expenses, and improve data security. In summary, our Support Techs demonstrated how to attach existing disks to VM in Proxmox.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.