[SOLVED] VM Disk location (Can't find the VM disk)

YaseenKamala

Member
Feb 2, 2021
158
4
23
Paris
Good morning all,

I am trying to covert some VM disks, when I go to → /var/lib/vz/images as we can see in the below screenshot it shows empty!
1639046788972.png

the only place that I can see my disks is under this path → /dev/zvol/hddpool

1639046653308.png

could please tell me where can I find the VM disks? because I am not sure if there are the real VM Disks!

Thanks in advance for your help.

Thanks
Yaseen
 

Attachments

  • 1639041508090.png
    1639041508090.png
    2.2 KB · Views: 26
Last edited:
VM disks aren't files ontop of a filesystem but are blockdevices (zvols or LVs) if you are using ZFS or LVM/LVM-thin as the storage. So there are no files you can see or copy. Blockdevices you can only work with when using the CLI commands (for example lvs or zfs list) or when working with them using the "/dev/..." paths (like working with real physical disks).
 
Last edited:
  • Like
Reactions: YaseenKamala
@Dunuin thank you very for you reply and help

I am using the zfs and here is the out put of zfs list

1639047967207.png

that is true the VM is using hddpool. my question is about where is the disk is located to for this vm?

Second Question:

BUT I just realized I am only able to create a VM with QEMU! when I use a NFS storage.

1639048999401.png


here I am not able to select "QEMU" disk format when hddpool or nvmepool is selecte

1639049258800.png
1639049355597.png

Thanks for your help again I really appreciated.
 
hi,

that is true the VM is using hddpool. my question is about where is the disk is located to for this vm?
try find /dev | grep VMID (where VMID belongs to your VM)

I am trying to covert some VM disks
for that you could just try moving the disk to another storage. select the disk in the Hardware view of your VM and choose "Move Disk" from above. select another storage, then you should be able to convert the disk to a different format (if that storage supports it). for an overview you can take a look here [0]

[0]: https://pve.proxmox.com/wiki/Storage
 
@Dunuin thank you very for you reply and help

I am using the zfs and here is the out put of zfs list

View attachment 32247

that is true the VM is using hddpool. my question is about where is the disk is located to for this vm?
I guess you should read a bit how ZFS works, especially the difference between a "dataset" and a "zvol". Your VMs virtual disks are zvols, so they are not part of a filesystem so you can't see them when browsing a filesystem like the filesystem that is mounted at "/hddpool". Think of them like plain harddisks (just virtual). You can't see a harddisk in a folder because it is a device and not a file ontop of filesystem. You can partition a harddisk and format that partition and then mount thtat partition somewhere (just like with a zvol) but you still can't see the disk, just the mounted content of that filesystem, that is stored on that partition that is ontop of that harddisk.
You could manually mount the contents of that zvol (just like mounting a harddisk) but never do this when that VM is running and never forget to unmount it before starting that VM or you will corrupt your data.
Second Question:

BUT I just realized I am only able to create a VM with QEMU! when I use a NFS storage.

View attachment 32248


here I am not able to select "QEMU" disk format when hddpool or nvmepool is selecte

View attachment 32249
View attachment 32250

Thanks for your help again I really appreciated.
ZFS only supports RAW and not qcow2 as format. You could force ZFS to use qcow2 (which is not recommended because it will add alot of unneccessary overhead) by creating a PVE "Directory" storage ontop of your ZFS pool.
 
hi,


try find /dev | grep VMID (where VMID belongs to your VM)
Yes, this what I wanted here.
1639056732737.png

for that you could just try moving the disk to another storage. select the disk in the Hardware view of your VM and choose "Move Disk" from above. select another storage, then you should be able to convert the disk to a different format (if that storage supports it). for an overview you can take a look here [0]

[0]: https://pve.proxmox.com/wiki/Storage

I did that as well this what happened it removes the file format to raw directly.
1639056702670.png
 
I guess you should read a bit how ZFS works, especially the difference between a "dataset" and a "zvol". Your VMs virtual disks are zvols, so they are not part of a filesystem so you can't see them when browsing a filesystem like the filesystem that is mounted at "/hddpool"
Thanks a lost for your help @Dunuin I am going to read about.
ZFS only supports RAW and not qcow2 as format. You could force ZFS to use qcow2 (which is not recommended because it will add alot of unneccessary overhead) by creating a PVE "Directory" storage ontop of your ZFS pool.
I don't to force but there is article https://pve.proxmox.com/wiki/Storage
1639058145069.png

Because I have enough space I moved my VMs to another storage. do you think I can recreate the storage with File level storage - First storage options?
 
Because I have enough space I moved my VMs to another storage. do you think I can recreate the storage with File level storage - First storage options?
The question is why do you prefer a file level storage? Block level storage is faster and SSDs will last longer because you skip that additional file system and that additional CoW of qcow2 that adds additional overhead.

With ZFS as block level storage it looks like this:
Physical Disks -> ZFS pool -> Zvol -> Virtio separating host and guest -> guests filesystem

With ZFS as file level storage it looks like this:
Physical Disks -> ZFS pool -> Dataset (with Filesystem) -> Image File -> Qcow2 (doing CoW again) -> Virtio separating host and guest -> guests filesystem

The less you put file systems ontop of other filesystems and the less you put complex storage management ontop of each other (like qcow2 with CoW ontop of ZFS with CoW) the less the overhead and the better the performance.

Thats also why PVE uses Zvols for ZFS and LVs for LVM/LVM-thin by default, because unlike NFS, SMB, ext4 and so on these storages support block devices so it would be a waste of performance and efficiency not to make use of that.
Using file level on a storage that supports block level makes only sense if you really need some features of qcow2 that the block level storage with raw format isn't supporting (like jumping back and forth between snapshots that only works with qcow2 snapshots but not zfs snapshots).
 
Last edited:
  • Like
Reactions: Neobin
@Dunuin to answer your question why I want to change it to file level storage?
I am trying to move my vms from hyper-v to proxmox so I need to convert example.vhdx to example.qcow2.
and since the pool is not accepting .qcow2 that is why I want to change it to "file level storage".

I don't know if there is another way of moving my vms from hyper-v to proxmox?

thanks
 
You can create a "Directoy" storage somewhere (local disk, NFS, SMB, external disk, dataset ontop of your already existing ZFS pool, ...) and move the qcow2 there. Then move that virtual disk from the directory storage to your ZFS storage and PVE will convert the file level qcow2 to block level raw.
 
You can create a "Directoy" storage somewhere (local disk, NFS, SMB, external disk, dataset ontop of your already existing ZFS pool, ...) and move the qcow2 there. Then move that virtual disk from the directory storage to your ZFS storage and PVE will convert the file level qcow2 to block level raw.
:rolleyes: I don't know how this can be done but Ill look for it, anyway I trust of what you said but I don't know how it's done exactly. a bit lost
 
Last edited:
:rolleyes: I don't know how this can be done but Ill look for it, anyway I trust of what you said but I don't know how it's done exactly. a bit lost
If you for example want to use your existing ZFS pool as a directory storage you can create a dataset optop of it:
zfs create YourPool/NewDatasetName
Then you can go to the WebUI and add this dataset as a Directory storage:
Datacenter -> Storage -> Add -> Directory: tell it to use the mountpoint of that dataset as the path (should be /YourPool/NewDatasetName)

You can then use that directory storage for your VMs with qcow2. And the VMs are working with that qcow2 files you can easily use the WebUI to move the VM from that new Directory Storage to your ZFS storage, which will automatically convert them from qcow2 to raw.
 
  • Like
Reactions: YaseenKamala

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!