Where does Proxmox store virtual machines?

mybne

New Member
Feb 13, 2022
8
1
1
48
I am trying to locate the virtual machine files. Where to look and what to look? (Sorry newbie on proxmox)


Code:
dir: local
        path /var/lib/vz
        content backup,vztmpl,iso

zfspool: local-zfs
        pool rpool/data
        content images,rootdir
        sparse 1

zfspool: SSD01
        pool SSD01
        content images,rootdir
        mountpoint /SSD01
        nodes ve

zfspool: SSD23
        pool SSD23
        content rootdir,images
        mountpoint /SSD23
        nodes ve

zfspool: HDD24TB
        pool HDD24TB
        content rootdir,images
        mountpoint /HDD24TB
        nodes ve
 
the config files for containers are here
Code:
/etc/pve/lxc
and for virtual machines, they are here
Code:
/etc/pve/qemu-server

The virtual disks will be where you choose at creation time - rpool/data, /SSD01, /SSD23 or /HDD24TB
 
I found and checked the given locations including all SSD and rpool but none of them returns any file when I use ls -l command.
 
I found and checked the given locations including all SSD and rpool but none of them returns any file when I use ls -l command.
you can run something like grep size /etc/pve/qemu-server/*.conf to get the disks and their corresponding storages.

as @Dunuin pointed out above, for ZFS there are no files but block devices. you could list them like: zfs list

I am trying to locate the virtual machine files.
the question is, what would you like to do with them?
 
Il
you can run something like grep size /etc/pve/qemu-server/*.conf to get the disks and their corresponding storages.

as @Dunuin pointed out above, for ZFS there are no files but block devices. you could list them like: zfs list


the question is, what would you like to do with them?
I will try first thing in the morning. My intention was getting those virtual machines out of the broken proxmox instance. While I was trying to configure https I deleted default certificates and now I cannot access the proxmox UI.
Very exciting start but so far not so good :)
 
Regarding the first question. Proxmox VE will not always store VM disk images in files. In the case of ZFS for example, it is using "volume" datasets.

They are providing block devices and are therefore not visible in the file system hierarchy. You can view them with zfs list and should see that they do not have a mount point. You can access them, like any physical disk, in the /dev/ path.

For example, /dev/zvol/<pool>/....
 
Regarding the first question. Proxmox VE will not always store VM disk images in files. In the case of ZFS for example, it is using "volume" datasets.

They are providing block devices and are therefore not visible in the file system hierarchy. You can view them with zfs list and should see that they do not have a mount point. You can access them, like any physical disk, in the /dev/ path.

For example, /dev/zvol/<pool>/....
In my case, since I can no longer fix this instance, what would be the right course of action to migrate the VMs to the new machine?
 
In my case, since I can no longer fix this instance, what would be the right course of action to migrate the VMs to the new machine?
When i moved my vms from my home server to a rented one, i created a backup of each vm and transfered the back up files, and then used restore on each backup
 
Thank you for the guidance, but I prefer to not continue working on a cripled system. After all, I noticed it is difficult to work with proxmox in case something goes wrong compared to VMware and Hyper-V.
 
I will try first thing in the morning. My intention was getting those virtual machines out of the broken proxmox instance. While I was trying to configure https I deleted default certificates and now I cannot access the proxmox UI.

also you shouldn't delete/modify the default certificates, this is well documented [0]:
Do not replace or manually modify the automatically generated node certificate files in /etc/pve/local/pve-ssl.pem and /etc/pve/local/pve-ssl.key or the cluster CA files in /etc/pve/pve-root-ca.pem and /etc/pve/priv/pve-root-ca.key.

though you can regenerate the certificates. just connect to your node via SSH (this should be possible even if the GUI is not working), and run this command: pvecm updatecerts. you should have new certificate files in /etc/pve/local/

Thank you for the guidance, but I prefer to not continue working on a cripled system.
since you want to export your VM disks, you can just make backups of your VMs and restore them elsewhere. take a look at this chapter [1]

After all, I noticed it is difficult to work with proxmox in case something goes wrong compared to VMware and Hyper-V.
hmm, i noticed it's difficult for something to go wrong if you're following our documentation and not ignoring the warnings ;)
could you elaborate and let us know what we could improve?

[0]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_certs_api_gui
[1]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_examples_11
 
also you shouldn't delete/modify the default certificates, this is well documented [0]:


though you can regenerate the certificates. just connect to your node via SSH (this should be possible even if the GUI is not working), and run this command: pvecm updatecerts. you should have new certificate files in /etc/pve/local/


since you want to export your VM disks, you can just make backups of your VMs and restore them elsewhere. take a look at this chapter [1]


hmm, i noticed it's difficult for something to go wrong if you're following our documentation and not ignoring the warnings ;)
could you elaborate and let us know what we could improve?

[0]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_certs_api_gui
[1]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_examples_11
Dear Oguz, The reason I am here as a newbie is ironically following the wrong proxmox documentation which was for an earlier version of proxmox.
Any system can have disaster but there must be restoration chance. I will check the documents and video tutorials to be fair towards this project because developers putting so much effort and sharing with us for free. I see here staff members also trying to help and I am really appreciated for this.
 
  • Like
Reactions: oguz
you can run something like grep size /etc/pve/qemu-server/*.conf to get the disks and their corresponding storages.

as @Dunuin pointed out above, for ZFS there are no files but block devices. you could list them like: zfs list


the question is, what would you like to do with them?

Mine shows "scsi0: local:1000/vm-1000-disk-0.qcow2,size=250G"
So where is the location? i can't find it with this info.
 
Mine shows "scsi0: local:1000/vm-1000-disk-0.qcow2,size=250G"
So where is the location? i can't find it with this info.

Full path for this vdisk should be: /var/lib/vz/images/1000/vm-1000-disk-0.qcow2
Check with: pvesm path local:1000/vm-1000-disk-0.qcow2
 
My proxmox is showing the same space being used even after i deleted 50GB of files from a VM and some LXC's:rolleyes:
88.91% (388.51 GB of 436.95 GB)

i already used "qm rescan" and even restarted the dedicated server, nothing changed.
Any possible solution?
 
You set up discard in your VM and regularily run pct fstrim?

Discard part yes, "run pct fstrim" not.

Anyway, pct fstrim is not only for LXC containers?
Cause i am talking about VM's.
btw, containers can not use "discard".
So what i need to do for VM's?
 
Last edited:
i deleted 50GB of files from a VM and some LXC's
Yes, "pct fstrim" is to trim LXCs on LVM-Thin.
LXCs on ZFS you trim by "zpool trim".

So what i need to do for VM's?
If it is a linux VM a fstrim -a inside the VM. On a Win VM something like a Optimize-Volume -DriveLetter YourDriveLetter -ReTrim -Verbose. And this of cause all only works when using proper settings like enabled "discard" checkbox and "virtio SCSI" with "SCSI" and not protocols like IDE that doesn't support TRIM commands.
 
  • Like
Reactions: lps90
Thanks for the help mate.
I worked well for my linux vm's, the problem is i have FreeBSD vm's too and i don't know how to do it to this systems.
 

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!