good question- I dont know.
you COULD just edit the vmid.conf directly (eg, /etc/pve/qemu-server/100.conf) and add the disk directly- find the line that starts with unused0: and change it to efidisk0:
might need other variables for pre-enrolled-keys, etc.
Sorry -- it's been busy trying to get all the VMs offloaded and backed up.
So I ended up googling it and google AI was able to help guide me.
I'm going to add this here, in case someone needs this, in the future:
1) Assuming that you have the disks in a pool and that you've added that pool as a storage that PVE can use (e.g. I have a pair of 12 TB SAS HDDs that I put in a ZFS mirror called
bigpool and six 1 TB SATA HDDs that I put into a raidz pool, called
smallpool), and then added both to PVE storage (Datacenter -> Storage).
So given this assumption, I also copied the qcow2 exports (from my borked system's LVM) to
/bigpool/disks.
I also restored the last backup from PBS (e.g. VMID 11000 is my Win11 "template" of sorts), so that will pull down the configuration, etc.
So with Win11, there's a EFI disk and a TPM state as well as the OS disk itself.
2) If you then put/copy the disks in question to your storage's
./images directory (e.g.
/bigpool/images), then you can run:
pvesm list bigpool and it will find the path for the storage. You'll need this path for the next step.
3) To replace the TPM state with an
existing TPM state, use this command:
qm set <<VMID>> -tpmstate0 <storage_name>:vm-<old_vmid>-tpm.raw,version=v2.0
So in my case, I used:
qm set 11000 -tpmstate0 bigpool:11000/vm-11000-disk-0.qcow2.
I don't know if the
version=v2.0 is super important or not.
I also don't know if the
qcow2 (vs.
raw) format makes a difference or not. If it doesn't work, you can always use this command to convert the
qcow2 disk back to
raw:
qemu-img convert -f qcow2 -O raw /path/to/source.qcow2 /path/to/destination.raw
4) To attach an
existing EFI disk, use this command:
qm set <VMID> -efidisk0 <STORAGE_ID>:<SIZE_OR_VOLUME_NAME>
So in my case, I used:
qm set 11000 -efidisk0 bigpool:11000/vm-11000-disk-2.qcow2.
Again, I don't know if the
qcow2 vs.
raw format makes a difference. If it doesn't work/doesn't boot back up, you can always try converting it, re-attaching it, and then try to start the VM again, to see if it will work for you.
That's basically the jist of it.
It's been taking me a little while as I am pulling down backups, re-attaching the disks with the newer copies from the LVM-to-qcow2 exports, firing up the VM/LXC to make sure that it is back to operational order, and then creating a new backup with this, and once that is done, delete the VM/LXC and move on to the next one.
Working with HDDs takes a while.
I am also, at the same time, pulling down all of the disks from the
non-LVM storage from my now borked server, recreating those as well, making sure that they're working, and then creating an updated backup copy of those VMs/LXCs (because as I said, if I had just waited like half an hour more or so, my monthly backup job would've ran. So, this, in effect, is the very, very, very manual version of that before I re-install PVE on my borked server.
It's going to take a while for me to get through it all because HDDs just don't run that fast, especially I am doing multiple things with/to it simultaneously.
(Thank you, Google AI, for helping me with the syntax for these commands.)