Windows VM live migration failed - is it TPM?

nmmn

Well-Known Member
Feb 10, 2015
22
3
68
We have a PVE cluster with three nodes and about 70 VMs, of which probably 50% are Windows guests. In normal operation, they're balanced across the three nodes.

We regularly patch the nodes, so we free one of the nodes, install updates, reboot, then free the next node etc., and this usually goes through without issues.

Today, I freed node 3, upgraded and rebooted it, then moved the VMs back. While moving them back, three Windows VMs had a migration error:
Code:
2026-11-11 16:54:07 ERROR: tunnel replied 'ERR: resume failed - VM 1110120 not running' to command 'resume 1110120'
2026-11-11 16:56:48 ERROR: tunnel replied 'ERR: resume failed - VM 1230720 qmp command 'query-status' failed - client closed connection' to command 'resume 1230720'
2026-11-11 17:00:36 ERROR: tunnel replied 'ERR: resume failed - VM 43149 qmp command 'query-status' failed - client closed connection' to command 'resume 43149'

The VMs were transferred but switched off and had to be turned on manually. I've grepped the syslog for the VM IDs and found this:

Code:
2026-11-11T16:54:07.684453+01:00 node3 QEMU[16937]: kvm: load of migration failed: Invalid argument: error while loading state for instance 0x0 of device 'tpm-emulator': post load hook failed for: tpm-emulator, version_id: 0, minimum_version: 0: tpm-emulator: Setting the stateblob (type 1) failed with a TPM error 0x3 a parameter is bad
2026-11-11T16:56:47.830592+01:00 node3 QEMU[32557]: kvm: load of migration failed: Invalid argument: error while loading state for instance 0x0 of device 'tpm-emulator': post load hook failed for: tpm-emulator, version_id: 0, minimum_version: 0: tpm-emulator: Setting the stateblob (type 1) failed with a TPM error 0x3 a parameter is bad
2026-11-11T17:00:36.415358+01:00 node3 QEMU[48693]: kvm: load of migration failed: Invalid argument: error while loading state for instance 0x0 of device 'tpm-emulator': post load hook failed for: tpm-emulator, version_id: 0, minimum_version: 0: tpm-emulator: Setting the stateblob (type 1) failed with a TPM error 0x95

The PIDs and timestamps match the three VMs with the migration problems, so I am somewhat confident that this is related.
The apt history log also confirms that TPM packages got updated today when I patched the server:
Code:
swtpm-libs:amd64 (0.8.0+pve3, 0.10.2+pve1)
swtpm-tools:amd64 (0.8.0+pve3, 0.10.2+pve1)
swtpm:amd64 (0.8.0+pve3, 0.10.2+pve1)
libtpms0:amd64 (0.9.7+pve2, 0.10.2+pve1)

Interestingly, two of the syslog errors end in TPM error 0x3 a parameter is bad and one ends in TPM error 0x95.

It sounds somewhat reasonable to me that a VM migration can fail with a TPM related error if the TPM packages differ in version, even though of course it shouldn't. I just don't understand why it only happened to a few of the Windows VMs, even though they apparently all use TPM.

I'd like to understand what caused this and if there's anything I can do to avoid this happening again in the future. Needless to say, the customer wasn't very happy about the unexpected outage and unclean shutdown...
 
I have run into this before and it was related to the TPM being on the same shared storage as the VM/vmdisk and failing from one of the various cluster storage locking mechanisms. I just moved the TPM to a local-lvm, named the same across the hosts, and live migration streams the tpm disk data normally to destination host's local disk. Ignore the local disk / long time warning, it's 4MB.

As always, make sure you have working backup in place as this adds a point of failure if you so happen to lose a host.. and make sure you document your VM UUIDs.

*this is my experience. I am not liable for any information used, use your best judgement.
 
I have run into this before and it was related to the TPM being on the same shared storage as the VM/vmdisk and failing from one of the various cluster storage locking mechanisms.
As in general or due such an update?
 
Would be also nice to get the pveversion -v from both source and target of a failed migration, the complete /run/qemu-server/<vmid>-swtpm.log from both nodes around the failure, the storage type of where the tpmstate0 volume is on, whether the VM later cold-started without TPM errors.
 
  • Like
Reactions: fiona
the pveversion -v from both source and target of a failed migration
I'm afraid that's not possible anymore, since all nodes have been upgraded now. I could only show you the output of the target node, as the source node has since also been upgraded:
Code:
# pveversion -vproxmox-ve: 9.2.0 (running kernel: 7.0.14-26-pve)
pve-manager: 9.2.26 (running version: 9.2.26/41a0e2e09b9e6f9d)
proxmox-kernel-helper: 9.2.0
proxmox-kernel-7.0: 7.0.14-26
proxmox-kernel-7.0.14-26-pve-signed: 7.0.14-26
proxmox-kernel-7.0.14-17-pve-signed: 7.0.14-17
proxmox-kernel-7.0.14-11-pve-signed: 7.0.14-11
proxmox-kernel-6.17: 6.17.13-21
proxmox-kernel-6.17.13-21-pve-signed: 6.17.13-21
proxmox-kernel-6.17.2-1-pve-signed: 6.17.2-1
amd64-microcode: 3.20251202.1~bpo13+1
ceph: 19.2.6-pve4
ceph-fuse: 19.2.6-pve4
corosync: 3.1.10-pve3
criu: 4.1.1-1
frr-pythontools: 10.6.1-1+pve3
ifupdown2: 3.3.0-1+pmx12
ksm-control-daemon: 1.5-1
libjs-extjs: 7.0.0-7
libproxmox-acme-perl: 1.7.2
libproxmox-backup-qemu0: 2.0.3
libproxmox-rs-perl: 0.4.2
libpve-access-control: 9.2.0
libpve-apiclient-perl: 3.4.3
libpve-cluster-api-perl: 9.1.9
libpve-cluster-perl: 9.1.9
libpve-common-perl: 9.2.8
libpve-guest-common-perl: 6.0.7
libpve-http-server-perl: 6.0.7
libpve-network-perl: 1.6.8
libpve-notify-perl: 9.1.9
libpve-rs-perl: 0.16.0
libpve-storage-perl: 9.1.15
libspice-server1: 0.15.2-1+b1
lvm2: 2.03.31-2+pmx1
lxc-pve: 7.0.0-2
lxcfs: 7.0.0-pve1
novnc-pve: 1.7.0-2
proxmox-backup-client: 4.2.8-1
proxmox-backup-file-restore: 4.2.8-1
proxmox-backup-restore-image: 1.0.0
proxmox-enterprise-support-keyring: 1.1
proxmox-firewall: 1.2.4
proxmox-kernel-helper: 9.2.0
proxmox-mail-forward: 1.1.0
proxmox-mini-journalreader: 1.7
proxmox-offline-mirror-helper: 0.8.0
proxmox-widget-toolkit: 5.2.12
pve-cluster: 9.1.9
pve-container: 6.1.18
pve-docs: 9.2.13
pve-edk2-firmware: 4.2026.08-1
pve-esxi-import-tools: 1.0.1
pve-firewall: 6.0.7
pve-firmware: 3.18-8
pve-ha-manager: 5.2.5
pve-i18n: 3.10.0
pve-qemu-kvm: 11.0.3-4
pve-xtermjs: 6.0.0-3
qemu-server: 9.2.15
smartmontools: 7.5-pve2
spiceterm: 3.4.2
swtpm: 0.10.2+pve1
vncterm: 1.9.2
zfsutils-linux: 2.4.4-pve1

However, I can show you what has been upgraded including old and new version numbers from apt's history log:
Code:
apt-transport-https:amd64 (3.0.3, 3.0.4)
apt-utils:amd64 (3.0.3, 3.0.4)
apt:amd64 (3.0.3, 3.0.4)
ca-certificates:amd64 (20250419, 20250419+deb13u1)
cifs-utils:amd64 (2:7.4-1, 2:7.4-1+deb13u2)
curl:amd64 (8.14.1-2+deb13u5, 8.14.1-2+deb13u7)
grub-common:amd64 (2.12-9+pmx2, 2.12-9+pmx4)
grub-efi-amd64-bin:amd64 (2.12-9+pmx2, 2.12-9+pmx4)
grub-efi-amd64-signed:amd64 (1+2.12+9+pmx2, 1+2.12+9+pmx4)
grub-efi-amd64-unsigned:amd64 (2.12-9+pmx2, 2.12-9+pmx4)
grub-efi-amd64:amd64 (2.12-9+pmx2, 2.12-9+pmx4)
grub2-common:amd64 (2.12-9+pmx2, 2.12-9+pmx4)
libapt-pkg7.0:amd64 (3.0.3, 3.0.4)
libcurl3t64-gnutls:amd64 (8.14.1-2+deb13u5, 8.14.1-2+deb13u7)
libcurl4t64:amd64 (8.14.1-2+deb13u5, 8.14.1-2+deb13u7)
libexpat1:amd64 (2.8.3-1~deb13u1, 2.9.0-1~deb13u1)
liblzma5:amd64 (5.8.1-1+deb13u1, 5.8.1-1+deb13u2)
libnss3:amd64 (2:3.110-1+deb13u4, 2:3.110-1+deb13u5)
libpcre2-8-0:amd64 (10.46-1~deb13u2, 10.46-1~deb13u3)
libpcre2-16-0:amd64 (10.46-1~deb13u2, 10.46-1~deb13u3)
libpng16-16t64:amd64 (1.6.48-1+deb13u5, 1.6.48-1+deb13u6)
libproxmox-rs-perl:amd64 (0.4.1, 0.4.2)
libpve-access-control:amd64 (9.1.2, 9.2.0)
libpve-cluster-api-perl:amd64 (9.1.6, 9.1.9)
libpve-cluster-perl:amd64 (9.1.6, 9.1.9)
libpve-common-perl:amd64 (9.2.2, 9.2.8)
libpve-guest-common-perl:amd64 (6.0.5, 6.0.7)
libpve-http-server-perl:amd64 (6.0.5, 6.0.7)
libpve-network-api-perl:amd64 (1.6.7, 1.6.8)
libpve-network-perl:amd64 (1.6.7, 1.6.8)
libpve-notify-perl:amd64 (9.1.6, 9.1.9)
libpve-rs-perl:amd64 (0.15.3, 0.16.0)
libpve-storage-perl:amd64 (9.1.10, 9.1.15)
libruby3.3:amd64 (3.3.8-2, 3.3.13-0+deb13u1)
libssl3t64:amd64 (3.5.7-1~deb13u2, 3.5.7-1~deb13u3)
libtpms0:amd64 (0.9.7+pve2, 0.10.2+pve1)
libunbound8:amd64 (1.26.1-0+deb13u1, 1.26.2-0+deb13u1)
linux-image-amd64:amd64 (6.12.107-1, 6.12.116-1)
openssl-provider-legacy:amd64 (3.5.7-1~deb13u2, 3.5.7-1~deb13u3)
openssl:amd64 (3.5.7-1~deb13u2, 3.5.7-1~deb13u3)
proxmox-backup-client:amd64 (4.2.6-1, 4.2.8-1)
proxmox-backup-file-restore:amd64 (4.2.6-1, 4.2.8-1)
proxmox-headers-7.0:amd64 (7.0.14-17, 7.0.14-26)
proxmox-kernel-7.0:amd64 (7.0.14-17, 7.0.14-26)
proxmox-mail-forward:amd64 (1.0.3, 1.1.0)
proxmox-widget-toolkit:amd64 (5.2.10, 5.2.12)
pve-cluster:amd64 (9.1.6, 9.1.9)
pve-container:amd64 (6.1.14, 6.1.18)
pve-docs:amd64 (9.2.12, 9.2.13)
pve-firewall:amd64 (6.0.6, 6.0.7)
pve-firmware:amd64 (3.18-6, 3.18-8)
pve-manager:amd64 (9.2.20, 9.2.26)
pve-qemu-kvm:amd64 (11.0.3-3, 11.0.3-4)
pve-xtermjs:amd64 (6.0.0-2, 6.0.0-3)
qemu-server:amd64 (9.2.8, 9.2.15)
rsync:amd64 (3.4.1+ds1-5+deb13u4, 3.5.0+ds1-0+deb13u1)
ruby3.3:amd64 (3.3.8-2, 3.3.13-0+deb13u1)
swtpm-libs:amd64 (0.8.0+pve3, 0.10.2+pve1)
swtpm-tools:amd64 (0.8.0+pve3, 0.10.2+pve1)
swtpm:amd64 (0.8.0+pve3, 0.10.2+pve1)
tzdata:amd64 (2026c-0+deb13u1, 2026f-0+deb13u1)
vim-common:amd64 (2:9.1.1230-2, 2:9.1.1230-2+deb13u2)
vim-runtime:amd64 (2:9.1.1230-2, 2:9.1.1230-2+deb13u2)
vim-tiny:amd64 (2:9.1.1230-2, 2:9.1.1230-2+deb13u2)
vim:amd64 (2:9.1.1230-2, 2:9.1.1230-2+deb13u2)
xxd:amd64 (2:9.1.1230-2, 2:9.1.1230-2+deb13u2)
xz-utils:amd64 (5.8.1-1+deb13u1, 5.8.1-1+deb13u2)
zlib1g:amd64 (1:1.3.dfsg+really1.3.1-1+b1, 1:1.3.dfsg+really1.3.1-1+deb13u1)


the complete /run/qemu-server/<vmid>-swtpm.log from both nodes around the failure
These logs are only available on the target node, where the VMs are currently running, so I'll give you those:

1110120:
Code:
libtpms/tpm2: PCR_SAVE: Unsupported algid 20862.[id=1794412342] Data client disconnected

1230720:
Code:
libtpms/tpm2: OBJECT needs missing version 3 or later
libtpms/tpm2: USER_NVRAM: Failed to unmarshal ANY_OBJECT: 0x00000003
[id=1794412593] Data client disconnected

43149:
Code:
libtpms/tpm2: USER_NVRAM: Failed to unmarshal ANY_OBJECT: 0x00000095
[id=1794412735] Data client disconnected


the storage type of where the tpmstate0 volume is on
Built-in Ceph on the three nodes, so RBD (PVE).


whether the VM later cold-started without TPM errors.
The VMs booted successfully as far as I know, yes.

Thank you, I appreciate your help!
 
Last edited: