[SOLVED] Create a "blank" VM or CT

Helio Mendonça

Active Member
Apr 10, 2019
73
6
28
Hi

This is probably a basic (or maybe dumb) question but... how can I create a "blank" VM or CT?

Why do I need this?
Imagine that I have the backups of my VMs (vzdump-qemu-1xx-....vma.lzo) or CTs (vzdump-lxc-1xx-....tar.lzo), and I want to restore them in a clean Proxmox installation.
I can upload them to folder /var/lib/vz/dump but to restore them in the Proxmox webgui I need to have a VM or CT with that number.

Until now I am creating a temporary VM or CT using an ISO or CT template to do the restore after that.
But for that I need to upload that ISO or template, when I really do not need them since I will restore immediately after their creation with my backups.

When I already have a VM or CT I can clone them, but this takes a lot of time when I really do not need them but just something that allow me to do a restore after.

So... it is not possible to create a "fake" (or blank) VM or CT that allow me to make the restore after that?
Or there is another way of restoring a VM or CT on a clean Proxmox?

Regards
 
Hi

This is probably a basic (or maybe dumb) question but... how can I create a "blank" VM or CT?

Why do I need this?
Imagine that I have the backups of my VMs (vzdump-qemu-1xx-....vma.lzo) or CTs (vzdump-lxc-1xx-....tar.lzo), and I want to restore them in a clean Proxmox installation.
I can upload them to folder /var/lib/vz/dump but to restore them in the Proxmox webgui I need to have a VM or CT with that number.
If you restore a VM/LXC from a vzdump a new VM/LXC will be created (you can even freely choose a new ID) with all the data of your old VM. So you really don't need blank VMs.
 
  • Like
Reactions: Helio Mendonça
Thanks @Dunuin but can you be more precise?
Where do you do that restore? In the webgui or in the cli?
Because the only place I know to restore a VM or CT is by first selecting it in the webgui and only then go to the Backup > (select the backup file) > Restore. But since after a clean install of Proxmox I do not have any VM or CT yet, how can I restore my backup?
Regards

PS - Meanwhile I found that I can create my intended "blank" VM (number 105 for instance) by executing the following command in the cli: qm create 105. So now I just have to find the equivalent command for a CT.

PPS - In fact in the cli I can do the restore right away by executing: qmrestore /var/lib/vz/dump/vzdump-qemu-105-2021_02_08-12_12_07.vma.lzo 105
But when I try do do something equivalent for a container I get an error:
Code:
root@altpve:~# pct restore 121 /var/lib/vz/dump/vzdump-lxc-121-2021_02_08-12_17_12.tar.lzo
400 Parameter verification failed.
storage: storage 'local' does not support container directories
pct restore <vmid> <ostemplate> [OPTIONS]
Any help on this?

PPPS - Well... I believe the proper command is:
Code:
root@altpve:~# pct restore 121 /var/lib/vz/dump/vzdump-lxc-121-2021_02_08-12_17_12.tar.lzo --rootfs local-lvm:8
 
Last edited:
Thanks @Dunuin but can you be more precise?
Where do you do that restore? In the webgui or in the cli?
Because the only place I know to restore a VM or CT is by first selecting it in the webgui and only then go to the Backup > (select the backup file) > Restore. But since after a clean install of Proxmox I do not have any VM or CT yet, how can I restore my backup?
Regards

PS - Meanwhile I found that I can create my intended "blank" VM (number 105 for instance) by executing the following command in the cli: qm create 105. So now I just have to find the equivalent command for a CT.

PPS - In fact in the cli I can do the restore right away by executing: qmrestore /var/lib/vz/dump/vzdump-qemu-105-2021_02_08-12_12_07.vma.lzo 105
But when I try do do something equivalent for a container I get an error:
Code:
root@altpve:~# pct restore 121 /var/lib/vz/dump/vzdump-lxc-121-2021_02_08-12_17_12.tar.lzo
400 Parameter verification failed.
storage: storage 'local' does not support container directories
pct restore <vmid> <ostemplate> [OPTIONS]
Any help on this?

PPPS - Well... I believe the proper command is:
Code:
root@altpve:~# pct restore 121 /var/lib/vz/dump/vzdump-lxc-121-2021_02_08-12_17_12.tar.lzo --rootfs local-lvm:8
You created a storage (CIFS,NFS, local HDD or whatever) where you have chosen the storage type "vzdump" and this storage will be used to store the vzdump backup files. That storage can list you all created backups and you can click on one of the backups to restore it using GUI:
pvebackup.png
 
  • Like
Reactions: Helio Mendonça

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!