[SOLVED] Restoring a single disk over a different VM

bly

New Member
Mar 15, 2024
20
4
3
Hello,
I have the VM ID 123 with two disks and backed up, and VM 456 with one disk, and I'd like restore one disk of VM 123 (in effect, I want a copy of that disk) as the second disk of VM 456.
How I can do this using the existing backup?
 
One option would be to restore that VM 123 using another VMID like 1000. Then, depending on the storage that is used, rename the virtual disk according to naming scheme. So for example from vm-1000-disk-1 to vm-456-disk-1. Then do a qm rescan and destroy VM 1000. The disk should now appear as an unattached disk in the VM 456 hardware tab where you could edit it to attach it.
 
  • Like
Reactions: bly and Kingneutron
It can be done, I just guess that restoring 2TB of VM to get 200GB disk is a bit overkill.
If I create a new disk on 123, clone (cp) the disk from inside 123, then detach and rename it, this can do the trick?
 
Last edited:
  • Like
Reactions: Kingneutron
then detach and rename it
You can just use Reassign Owner to do that.
If I create a new disk on 123, clone (cp) the disk from inside 123, then detach and rename it, this can do the trick?
Probably. Maybe boot the VM with GParted Live ISO to make an exact copy of the virtual disk? And then use Reassign Owner to move it to 456.
 
  • Like
Reactions: bly and Kingneutron
Done!
The target machine was in another node so the procedure to add to 456 (in node X) a clone of disk A of 123 (in node Y) have some extra steps:

1) add a new disk B in 123 and clone A to B inside the vm (with any tool/means you prefer)
2) create a dummy VM 789 in same node of 123
3) change owner of B to 789
4) start 789 and do live migration of 789 to node X (if datastores are different, or else you can migrate with 789 powered off)
5) power off 789
6) change owner of B to 456
7) remove 789
 

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!