[SOLVED] guests swap partition completely rewritten every VM reboot

Dunuin

Distinguished Member
Jun 30, 2020
14,793
4,630
258
Germany
Hi,

I monitored my proxmox host with iostat found alot of "zd" devices writing once 8386556kb and then nothing changes. Most of my VMs got a vdev with thin provisioning and dicard of 8GB size for swapping (but rarely used because of swappiness of 1). Every time I reboot a VM it adds 8386556kb to one of the vdevs. So it looks like the guests completely write the full size of the swap partition again and again to the vdev on VM reboot.

Why is that the case? Is that normal behavior? I always thought the swap partition is only formated once and is then only writing data from RAM to the swap would cause writes.

I'm using debian 10.5 in all of the VMs.

I just want the swap to be there for the case somehow the provisioned RAM runs out so nothing crashes so I can provision some more RAM to the VM later. The way it works now it is just wearing down the SSDs and I would be better without it.
 
Problem was the "discard" option set in the fstab entry for the swap partition on the guests. I removed it and now it only writes 1MB and not 8GB on each reboot of the guest.
 

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!