[SOLVED] Adding existing disk from storage to vm

maturos

Member
Apr 26, 2022
34
3
13
I've a VM with two disks. The first disk is small and contains the configuration of my cloud service. The second is about 2,5 TB large contains the data and is therfore excluded from backup (What Could Possibly Go Wrong?). Now i needed to restore the backup and my second disk is detached and no longer in my VM config. It's still in my storage list:
1650997507550.png
1650997563192.png
How can I get my data disk reattached to the VM?
 
Click on the unattached disk, then edit to add it to the VM again.

If it isn't listed in the VMs hardware tab you can run qm rescan
 
Last edited:
  • Like
Reactions: carles89 and cbugk
Thank you for your fast help. This confirms me that the disk must be appear as unattached in the hardware section. Unfortunally `qm rescan` resulted in an error I can't interpret:
1650998333365.png
 
You probably have a stanza in your /etc/pve/storage.cfg that points to pve/data , but it does not exist any more.
What does "pvesm status" show", you may need to clean up your config.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
MY storage.cfg is following:
Code:
dir: local
        path /var/lib/vz
        content backup,vztmpl
        shared 0

lvmthin: local-lvm
        thinpool data
        vgname pve
        content images,rootdir

dir: ISO
        path /media/ISO
        content iso,vztmpl
        shared 0

dir: Disks
        path /media/disks
        content rootdir,images
        nodes pve
        shared 0

dir: Backups
        path /media/backups
        content backup
        nodes pve
        shared 0
could it be the local-lvm?
I'm just using "Disks", "ISOs" and "Backup". Didn't wanted to touch something. Local-lvm seems to make problems.
1650998942413.png

Code:
root@pve:~# pvesm status
no such logical volume pve/data
Name             Type     Status           Total            Used       Available        %
Backups           dir     active       923729268       104330752       772405940   11.29%
Disks             dir     active      5766353400       988196564      4485171704   17.14%
ISO               dir     active        61665068        17264260        41238696   28.00%
local             dir     active        27682916         9556604        16934240   34.52%
local-lvm     lvmthin   inactive               0               0               0    0.00%
Is it safe to remove it from the config if it's broken since i can think?
 

Attachments

  • 1650998649342.png
    1650998649342.png
    24.4 KB · Views: 73
With eyes squinted and fingers crossed, I removed local-lvm with the GUI. It worked:
Bash:
root@pve:~# pvesm status
Name           Type     Status           Total            Used       Available        %
Backups         dir     active       923729268       104330752       772405940   11.29%
Disks           dir     active      5766353400       988196576      4485171692   17.14%
ISO             dir     active        61665068        17264260        41238696   28.00%
local           dir     active        27682916         9556740        16934104   34.52%
root@pve:~# qm rescan --vmid 102
rescan volumes...
VM 102 add unreferenced volume 'Disks:102/vm-102-disk-1.qcow2' as 'unused0' to config

1650999474238.png
Thank you and a big hug for you all, you saved my evening!
 
  • Like
Reactions: roxy

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!