[SOLVED] Attach disk from another VM

80n59

New Member
Jan 24, 2021
4
1
3
30
Hi Proxmox Users,

First of all I would say you thanks to all of you for the support and the help you can provide to everybody :)

Today I work on Windows Server VM 904,
But I did mistake and my windows server restart in loop... because one script restart computer when it's starting... (local group strategy)
So I can not access anymore to this VM data for modify the script...

I would attach the hard drive disk of vm904 to vm903 because it's windows server too. But I didn't find the possibilities.
Can you say me how I can attach hard drive disk from another VM
1636389672413.png
Thank you by advance for your help.
If you need more information, do not hesitate to ask.
 
Detach disk from VM using webUI. Use CLI to rename that LV matching the naming scheme of PVE. Use CLI to rescan virtual disks for that VM. Use webUI to attach the virtual disk.

There are some threads in this forum where the staff explained in detail what commands to run to do this so you might want to use the search function.
 
Thank you Dunuin for your reply,
I searched but didn't find well information, but with your message I found how to do and I'll explain here for next peoples :
First I use the shell of the proxmox server and I modify the config file in /etc/pve/qemu-server/904.conf
1636394518465.png
I added the disk 903 in ide0 and create ide3 for disk 904
1636394595483.png
It's apply automaticaly
1636394626984.png
So after that I check the vm903 is off and I started vm904 on the ide0.
I log to windows server session (as vm903) and I start diskpart
1636394689128.png
I pass disk 1 online
1636394706495.png
So I go to new disk and modify my errors scripts
1636394729017.png
and I pass offline disk before to close server and delete change I did.
 
Thank you Dunuin for your reply,
I searched but didn't find well information, but with your message I found how to do and I'll explain here for next peoples :
First I use the shell of the proxmox server and I modify the config file in /etc/pve/qemu-server/904.conf
View attachment 31192
I added the disk 903 in ide0 and create ide3 for disk 904
View attachment 31194
It's apply automaticaly
View attachment 31195
So after that I check the vm903 is off and I started vm904 on the ide0.
I log to windows server session (as vm903) and I start diskpart
That can be problematic. You really should make sure that your virtual disks name will fit the VMID of your VM. If you for example got a VM with VMID 903 that got a disk "vm-904-disk-0" this disk will be destroyed when you restore a VM with the VMID 904 from backup. So the LV "vm-904-disk-0" should be renamed to "vm-903-disk-1". How to do this depends on the storage (for example using the lvrename or zfs rename commands).

And if I remember right you need to run qm rescan to see the renamed disk in webUI after the renamed virtual disk.
 
Last edited:
  • Like
Reactions: Zaman
Thank you Dunuin for your reply,
I searched but didn't find well information, but with your message I found how to do and I'll explain here for next peoples :
First I use the shell of the proxmox server and I modify the config file in /etc/pve/qemu-server/904.conf
View attachment 31192
I added the disk 903 in ide0 and create ide3 for disk 904
View attachment 31194
It's apply automaticaly
View attachment 31195
So after that I check the vm903 is off and I started vm904 on the ide0.
I log to windows server session (as vm903) and I start diskpart
View attachment 31196
I pass disk 1 online
View attachment 31197
So I go to new disk and modify my errors scripts
View attachment 31198
and I pass offline disk before to close server and delete change I did.

Hello Team,

After completing this step I am facing below error
qemu-img: Could not open (Disk Name): Permission denied

Please Support
 
  • Like
Reactions: Ayush

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!