Attach unused disk to different VM

ahovda

Active Member
Sep 2, 2019
24
11
43
47
Hi, don't know if this is already possible or if this is the right place to suggest it. While e.g. preparing VM templates is sometimes very helpful to be able to reattach a VM disk to another VM. I would like to be able to select an unused disk and "attach it" to a different VM, giving a VM id or through a dropdown. Today I have to detach, rename the disk name (either zvol, lv, rbd or similar) and then qm rescan to make it work, unless I go ahead and edit the VM config file directly.

Another way would be that - in the storage view - I can see the current VM of the disk (including if the disk is orphaned), and then be able to reattach the disk to a different VM, obviously only if the disk is unused at the moment.

I understand that this might be more complicated by the fact that the disks are bound to the VM simply by the disk name (the VM id is embedded in the name itself) and that reattaching them might include a rename, which then has to be supported by all storage backends.

Ådne
 
  • Like
Reactions: Tmanok
That's great! (I assumed someone had already thought of this, thanks for the confirmation). :)

Do you also plan to add some more generic disk-rename functionality? I noticed pve only cares about the first part of the disk name [vm|base]-100-* so it could be possible to give disks more descriptive names, e.g. vm-100-root, vm-100-data1 and so on, as long as they are unique of course.

--
Ådne
 
Custom names have been under discussion for a while, but AFAIK noone is actively working on it. It's on our to-do list, though not a high priority for now.

I believe you can manually rename disks in the way you mention if you adjust the configs in /etc/pve accordingly, though that is of course not quite a supported solution.
 
  • Like
Reactions: Tmanok and ahovda

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!