[SOLVED] Recover vm template from ceph block storage

rekahsoft

Member
Dec 28, 2019
10
3
8
35
I lost a node that contained all of my vm templates. Unfortunately, vm templates are tied to a node, so though the underlying images still exist in my ceph pool, I can no longer use them from the proxmox ui (they can be seen with rbd ls -p <pool>.

What is the recommended approach to resolving this issue and recreating the vm templates using the underlying image that still exists within ceph?

Code:
root@host:~# rbd ls -p <pool>
base-100-disk-0
base-101-disk-0
base-102-disk-0
base-103-disk-0
base-104-disk-0
base-105-disk-0
base-106-disk-0
base-107-disk-0
base-152-disk-0
vm-108-disk-0
vm-110-disk-0
vm-154-disk-0
 
I lost a node that contained all of my vm templates. Unfortunately, vm templates are tied to a node, so though the underlying images still exist in my ceph pool, I can no longer use them from the proxmox ui (they can be seen with rbd ls -p <pool>.

What is the recommended approach to resolving this issue and recreating the vm templates using the underlying image that still exists within ceph?

Code:
root@host:~# rbd ls -p <pool>
base-100-disk-0
base-101-disk-0
base-102-disk-0
base-103-disk-0
base-104-disk-0
base-105-disk-0
base-106-disk-0
base-107-disk-0
base-152-disk-0
vm-108-disk-0
vm-110-disk-0
vm-154-disk-0

I'm not sure what the exact syntax is for a template .conf file.

But if you create a new template, and then login to the node and view the text based conf file you can manually update the storage line to point to one of of your image files existing in rbd.

For example on a VM that uses CEPH I have my storage line showing as:

scsi1: data:vm-102-disk-0,cache=none,discard=on,size=8T

"data" being the pool name within Proxmox, "vm-102-disk-0" being the disk you see from your above output