storage: upload disk

150d

New Member
Mar 23, 2022
25
2
3
Hi,

I had created a VM with a second virtual HDD. This virtual disk was located on an external drive on a plain ext4 partition.

Now I wanted to convert the external drive to a LVM Thinpool. I chose "detach" to separate the virtual disk from its VM (which was powered down, of course) and copied the disk image somewhere else. I then deleted the ext4 partition and created a LVM Thinpool in its place.

Now I need to get the disk image back to its VM. How do I do that?

I can see the new Thinpool in Proxmox GUI, and it is set to accept type "Disk Image", but nowhere is there an option to "upload disk image". I suppose I will need to use an "attach" command on the CLI, but how do I get the file there in the first place?

Regards
 
Last edited:
qm disk import {vmid} /path/to/image {target storage} is probably what you want to do.
 
qm disk import {vmid} /path/to/image {target storage} is probably what you want to do.
Exactly. Thanks a million!

One quirk:

The file I tried to import was named "vm-110-disk-0.qcow2".

I executed:

qm disk import 110 vm-110-disk-0.qcow2 mystorage

This finished with:

Successfully imported disk as 'unused1:mystorage:vm-110-disk-0'

After the process, in the GUI I could see one new disk named "vm-110-disk-0".

But in VM/Hardware, there were not one "unused disks", but two of them.

unused disk 0: mystorage: 110/vm-110-disk-0.qcow2 unused disk 1: mystorage: vm-110-disk-0

I tried to assign the first one, but got "error: name contains invalid character".
When I tried the same with the second one, it worked flawlessly. The disk is fully accessible by the VM and back in service.

What should I do with the other "unused disk", should I just "remove" it?

Is this maybe my very own backup file that I used for the re-import, which just happened to be included in a automatic rescan that was triggered by the import itself?

Regards
 
Last edited:
Mystorage is a thin LVM right? Try to remove the first one with qcow2 in the name. That should only look like that for file based storages.
 

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!