all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH qemu-server 0/3] drive: account for differing TPM sizes
@ 2026-10-27 10:17 Thomas Ellmenreich
  2026-10-27 10:17 ` [PATCH qemu-server 1/3] drive: update TPM size as max of current and minimum size Thomas Ellmenreich
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thomas Ellmenreich @ 2026-10-27 10:17 UTC (permalink / raw)
  To: pve-devel; +Cc: Thomas Ellmenreich

Our current systems to handle TPM drives always assume that the disks have a
fixed 4MiB size that cannot be changed even if that may not be the case. In
situations where the granularity of the backing storage exceeds the 4MiB, an
allocation of a TPM drive will be at least as big as the granularity of said
backing storage.

To solve this mismatch in a very simple way, the default size is retained for
allocation. Only after the allocation do we check the actual size of the
created TPM disk and update the configuration accordingly. A minimum size of
4MiB is always applied to situations where that may not be the case.

In the case of movement and cloning of disks, we just refer to the
actual disk size instead of the TPM size constant. Doing so also makes it now
possible to move a larger (than 4MiB) TPM disk to a different storage.

Future work
-----------

The last two patches in the RFC performed a rescan of a VM's disks after a
migration. By doing so, any inaccuracies in the size of TPM disks would be
fixed, but also so much more. Since this solution was a bit too "brute", we
decided to drop it in favour of a future, cleaner, implementation.

After migration, TPM disks retain their previous size, even if the granularity
might have forced the size to increase. A future patch series should address
this by going through the disks of the migrated VM and adjusting the sizes
accordingly. The previous implementation is inadequate because it also reveals
orphaned volumes and does so without using the migration tunnel.

Changelog
---------

* RFC -> v1
    - Reworded commit messages and subroutine descriptions.

    - Subroutines now fail if the passed arguments are undefined.

    - Move TPM size utilities to QemuServer::Drive.

    - Utilities print a warning if getting the real size fails.

    - Removed the last 2 patches that rescanned all drives after a migration
      as that warrants more discussion.


qemu-server:

Thomas Ellmenreich (3):
  drive: update TPM size as max of current and minimum size
  api: create disks: update TPM size on creation
  clone disk: read actual size when cloning TPM drive

 src/PVE/API2/Qemu.pm        | 19 +++++++++++-----
 src/PVE/QemuMigrate.pm      |  9 ++++----
 src/PVE/QemuServer.pm       | 11 ++--------
 src/PVE/QemuServer/Drive.pm | 44 +++++++++++++++++++++++++++++++++++++
 4 files changed, 65 insertions(+), 18 deletions(-)


Summary over all repositories:
  4 files changed, 65 insertions(+), 18 deletions(-)

-- 
Generated by murpp 0.12.0




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-28 10:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-27 10:17 [PATCH qemu-server 0/3] drive: account for differing TPM sizes Thomas Ellmenreich
2026-10-27 10:17 ` [PATCH qemu-server 1/3] drive: update TPM size as max of current and minimum size Thomas Ellmenreich
2026-10-28 10:32   ` Fiona Ebner
2026-10-27 10:17 ` [PATCH qemu-server 2/3] api: create disks: update TPM size on creation Thomas Ellmenreich
2026-10-27 10:17 ` [PATCH qemu-server 3/3] clone disk: read actual size when cloning TPM drive Thomas Ellmenreich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal