How to integrate vm *.raw from my lvm-thin after a new installation

speedozrx

Member
Apr 18, 2021
8
1
8
32
Hello guys,
what is the process for integrate my vm disks in .raw format located on a physical disk (lvm-thin), i know that i need to use the command "qm importedisk" but i don't know how and where exactly
Thanks for your help:)
screen.jpg
 
Dude, the command even tells you what to do:

Code:
qm importdisk <vmid> <source> <storage>

Import an external disk image as an unused disk in a VM. The image format has to be supported by qemu-img(1).

<vmid>: <integer> (1 - N)
The (unique) ID of the VM.

<source>: <string>
Path to the disk image to import

<storage>: <string>
Target storage ID

--format <qcow2 | raw | vmdk>
Target format
 
thanks for your reply, so when i started :
qm importdisk vm-100-disk-0 DATA -format qcow2
it doesn't work, do you know why ? in fact i don't know why i don't see this the file raw in this path : /dev/sauv_data01/
 
Last edited:
One second, it's already in a thin lvm inside Proxmox?
Then you can click on "move disk" in the VMs hardware tab and just move it to another storage.
qm importdisk is used when you have the disk as a file.
 
thanks Phox everything is ok, because i created my vm in another volume disk "DATA" it just need to see the list of all my vm under "pve" and in fact, i was not sure for using qm importdisk...
I can't do what you say, from my "thin-pool" i just have the option delete or since a new vm and material i can't choose the disk inside the DATA
 
Ah, so the disks are already there but the VMs not. Then you can create a VM and in the hardware tab you can assign existing disks as new scsi devices.
 
Yes, of course i can create a new vm but i can't select the disk of my old vm inside the "Thin-pool DATA" , that's the problem

screen3.jpg
 
Last edited:
I'm very sorry, I think I had a misconception of your situation. Indeed you can only attach new disks and since you already have thin disks and not files, neither qm importdisk nor attaching another disk will solve your problem.
I don't have much experience with those disks on a thin lvm, but you should probably be able to add another hard disk to the VM and then copy the content of the old thin disk over to the newly created, via dd.
 
Yes thanks for your help and by my side i continue for searching the solution.........
Have a nice day
 
Hey,

I think there is an easier way than dd: The command qm rescan checks if there are VM disks on the storages that fit the naming schema of the virtual machines and add them to the config if they are missing

man page: https://pve.proxmox.com/pve-docs/qm.1.html

So if we create an empty virtual machine then qm rescan should find the respective disk images on the LVM storage.

Code:
➜  ~ qm list # Shows which VMs are on your Proxmox VE host
      VMID NAME                 STATUS     MEM(MB)    BOOTDISK(GB) PID       
       100 pve                  stopped    4096              16.00 0         
       101 Windows10            stopped    4096               0.00 0         
       102 Windows10            stopped    4096               0.00 0         
➜  ~ lvs # List content of your LVM storages
  LV            VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data          pve twi-aotz-- <64.75g             7.64   1.81                            
  root          pve -wi-ao---- 150.00g                                                    
  swap          pve -wi-ao----   8.00g                                                    
  vm-105-disk-0 pve Vwi-a-tz-- 500.00g data        0.99                                   
➜  ~ qm create 105 # Create a new VM with ID 105
➜  ~ qm rescan --vmid 105 # Add missing volumes to the VM
rescan volumes...
VM 105 add unreferenced volume 'local-lvm:vm-105-disk-0' as 'unused0' to config
➜  ~ qm config 105 # Show configuration of the VM
boot:  
smbios1: uuid=a548df63-660a-42ff-83ab-5dae7b9794bf
unused0: local-lvm:vm-105-disk-0
vmgenid: 31854cdd-5196-4f7e-8ebf-aae324ae0b41

You can then go to the Hardware overview of your virtual machine in the GUI and double click the unused disk to attach it as SCSI or whatever.
 
Thanks for this solution, i hope to resolve this problem since 2 days, i will be back to give some news, have a nice my friend ;):)
 
  • Like
Reactions: Dominic
Unfortunately, maybe all vm are broken, (test on 2 vm) BSOD always in the boot, after checking with diskpart : no disk system in fact, i have choose disk ide or scsi, the problem is the same...
 

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!