PROXMOX - disc one VM connect to second VM

hiper

New Member
Dec 5, 2022
4
0
1
Hello, I have Proxmox with several virtual machines. In one of the machines, windows has been damaged and will not start. I need to connect the disk of the first virtual machine to the next one (working windows) and recover the database files. Both machines are under the same Proxmox. A request for instructions on how to connect the hard disk of one non-working machine to another working machine.
 
Use the "Move Disk" Button on PVE 7.X. Or rename that virtual disk matching the naming convention of the working VM, run a qm rescan --vmid VMIDofYourWorkingVM and then edit that disk newly found unattached disk to attach it.
 
Last edited:
1. Proxmox is 6.4.13 not 7.X
2. Rename disc - please help... give an example, problem is on the WINDOWS virtual machine.I attach list Virtual disc. I think the change is to be: vm-104-disc-1- therese is no files ?? I must convert ?
3. Maybe I add second disk to working windows...
 

Attachments

  • proxmox_aa.jpg
    proxmox_aa.jpg
    160 KB · Views: 3
  • disc_VM.jpg
    disc_VM.jpg
    130.5 KB · Views: 3
  • disc_104.jpg
    disc_104.jpg
    199.4 KB · Views: 3
1. Proxmox is 6.4.13 not 7.X
Then you should consider upgrading it. PVE 6.4 is end of life since summer and doesn't receive any updates or security patches anymore. So your server is vulnerable. See: https://pve.proxmox.com/wiki/Upgrade_from_6.x_to_7.0
. Rename disc - please help... give an example, problem is on the WINDOWS virtual machine.I attach list Virtual disc. I think the change is to be: vm-104-disc-1- therese is no files ?? I must convert ?
You use a ZFS pool, so renaming of the zvols has to be done with the "zfs rename" command. If VMID 104 is the broken VM and VMID 100 the one you want to add the disk to, then you would need to do something like this:
Rich (BB code):
zfs rename rpool/data/vm-104-disk-0 rpool/data/vm-100-disk-1
qm rescan --vmid 100
qm rescan --vmid 104
And then add that unattached disk to the VM using the webUI.
 
Last edited:
Then you should consider upgrading it. PVE 6.4 is end of life since summer and doesn't receive any updates or security patches anymore. So your server is vulnerable. See: https://pve.proxmox.com/wiki/Upgrade_from_6.x_to_7.0

ok, but now I must repair database, so I must download database files.
You use a ZFS pool, so renaming of the zvols has to be done with the "zfs rename" command. If VMID 104 is the broken VM and VMID 100 the one you want to add the disk to, then you would need to do something like this:
Rich (BB code):
zfs rename rpool/data/vm-104-disk-0 rpool/data/vm-100-disk-1
qm rescan --vmid 100
qm rescan --vmid 104
And then add that unattached disk to the VM using the webUI.
104 - new OK Windows
100 - not working Windows
so:
Rich (BB code):
zfs rename rpool/data/vm-100-disk-0 rpool/data/vm-104-disk-1
qm rescan --vmid 104
qm rescan --vmid 100
 
command

zfs rename rpool/data/vm-100-disk-0 rpool/data/vm-104-disk-1

will I make some changes that cannot be undone, e.g. will I lose a disk from machine number 100? will it be possible to restore the disk to machine 100 with the command:

zfs rename rpool/data/vm-104-disk-1 rpool/data/vm-100-disk-0 ?
 
will I lose a disk from machine number 100?
Jup, you basically "move" the disk, so VM 100 won't be able to use it anymore.
will it be possible to restore the disk to machine 100 with the command:

zfs rename rpool/data/vm-104-disk-1 rpool/data/vm-100-disk-0 ?
Jup. Its like renaming a file...just that it is a block device and not a file.

If you want to create a temporary copy instead of renaming (so "moving") it, I would use the clone command:
Code:
zfs snapshot rpool/data/vm-100-disk-0@clone
zfs clone rpool/data/vm-100-disk-0@clone rpool/data/vm-104-disk-1
And when you have finished rescuing data you can destroy that clone and the snapshot with:
Code:
zfs destroy rpool/data/vm-104-disk-1
zfs destroy rpool/data/vm-100-disk-0@clone
 
Last edited:
  • Like
Reactions: guletz and bobmc

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!