OK, it’s working again.
Here’s what I did (based on the help in this forum post).
- Run the original virt-install command, but as a dry-run, this shows the original xml that was used to create the vm guest, and can be compared with the xml that will be created when resurrecting the vm guest.
virt-install --dry-run --print-xml --name vmg01 --memory 2048 --vcpus 2 --disk pool=vmg_pool,size=10 --disk pool=vmg_pool,size=10 --os-variant rocky8.5 --boot uefi --cdrom /vms/iso/Rocky-8.5-x86_64-dvd1.iso
- Resurrect the vm guest that currently only exists in qcow2. In this case, I have re-created the original storage pool exactly as before, so I’m using the ‘vol’ option instead of the ‘path’ option.
virt-install --name vmg01 --memory 2048 --vcpus 2 --import --disk vol=vmg_pool/vmg01.qcow2,bus=virtio --disk vol=vmg_pool/vmg01-1.qcow2,bus=virtio --os-variant rocky8.5 --boot uefi
Note the use of --import and the args passed to --disk
Running the virt-install command suddenly started the virt-viewer and booted the machine, I didn’t expect that, I thought it would just create the vm guest definition. I didn’t know how to shut it down using virt-viewer, so I used systemd.
At this point, I can start and stop the vm guest, and use it.
virsh start vmg01
virsh shutdown vmg01
But, ssh and ping by host wasn’t working, so I had to set up ‘libvirt-nss.x86_64’, but there was an UNEXPECTED issue here when I ran ‘authselect’, the whole screen went black, all my open windows were lost and I had to log in again. This didn’t happen on Rocky 8.6.
After logging back in, the vm guests are working again.
I can make a backup of the xml, but I’m not sure the correct procedure, or where to restore it to, just copy back into ‘libvirt’ and hope it works, or some special command?