Detach/Attach VM Disks

ravet_

New Member
Sep 23, 2021
1
0
1
21
Hello,
I have a Proxmox-Server with a much VMs.

Now I wanted to switch the VM disk from one VM to antoher VM.

I have detached the VM disk.
So now I cant attach this disk to any VM.

I dont have access to this VM disk but I can see this disk at my Storage.

How can I attach this disk again to my VM?
Please I need your help!
 
Last edited:
The feature you need, that would have made this process as easy as anything else in UI, is not yet available.

In the meantime you have to manually resolve the naming. The process depends on your backend.
For example, at high level, for LVM - you would unlink/detach the disk from VM1, rename the slice from vm-100-disk-0 to vm-101-disk-0 using LVM tools. Rescan the storage "qm rescan", attach the "unused0" disk that hopefully appeared in VM1 config.

I would advise that you create a dummy VM/disk and test the process there.

https://pve.proxmox.com/wiki/Moving_disk_image_from_one_KVM_machine_to_another


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Create same size disk in VM2 and stop VM2
Detach disk from VM1
From shell, move the disk from mouted directory of VM1 to VM2 image
Rename the other disk of VM2 to something else and rename the disk from VM2 to the VM2 disk.
Restart VM2... Voila !!! you have your VM2 with the disk of VM1
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!