[SOLVED] pbs restore proxmox kvm from cli

EuroDomenii

Well-Known Member
Sep 30, 2016
139
25
48
Slatina
www.domenii.eu
According to
https://pbs.proxmox.com/docs/administration-guide.html#restoring-data, first check

Code:
root@rise1rbx:~# proxmox-backup-client restore vm/100/2020-07-16T09:52:09Z index.json -
{
  "backup-id": "100",
  "backup-time": 1594893129,
  "backup-type": "vm",
  "files": [
    {
      "crypt-mode": "none",
      "csum": "d94abe3ccfce64fb7732782858e50401945f2627be3c3378371284c3a8dd9c88",
      "filename": "qemu-server.conf.blob",
      "size": 1100
    },
    {
      "crypt-mode": "none",
      "csum": "a594dd86580f2caef0d68edeb8c05b920cd58d0062ae7be808cdce1fd1ff7cd7",
      "filename": "drive-scsi0.img.fidx",
      "size": 211741048832
    }
  ],
  "unprotected": {}
}

But, instead of -, I should specify the /target/path/

The problem is that I’m not supposed to rebuild manually the storage for the KVM, instead the proxmox tool should take care of it instead of me, along with all other configuration of the virtual machine. ( especially if i plan to restore to lvm thin, /dev/vmdata/vm-102-disk-0 , not directory)

Looking at the restore log from GUI, I have

Code:
restore proxmox backup image: /usr/bin/pbs-restore --repository root@pam@localhost:store2 vm/100/2020-07-16T09:52:09Z drive-scsi0.img.fidx /dev/vmdata/vm-102-disk-0 --verbose --format raw --skip-zero

Code:
cat /etc/pve/storage.cfg
dir: local
        path /var/lib/vz
        content snippets,backup,vztmpl,iso,rootdir,images
        maxfiles 0
        shared 0

lvmthin: local-lvm
        thinpool vmstore
        vgname vmdata
        content images,rootdir

dir: sata
        path /var/eurodomenii/backup
        content rootdir,vztmpl,backup,images,iso
        maxfiles 0
        shared 0

pbs: pb
        datastore store2
        server localhost
        content backup
        fingerprint 67:21:7d:44:e0:a6:32:2a:d1:6a:f0:09:44:0a:a8:c5:b5:4b:27:05:db:17:3e:6f:7b:35:8c:b0:c2:39:d2:16
        maxfiles 0
        username root@pam

Instead, I was trying to use qmrestore utility

Code:
root@rise1rbx:/# qmrestore /ab/store2/vm/100/2020-07-16T09:52:09Z/drive-scsi0.img.fidx 103
ERROR: couldn't determine archive info from '/ab/store2/vm/100/2020-07-16T09:52:09Z/drive-scsi0.img.fidx'

Code:
root@rise1rbx:/ab/store2/vm/100/2020-07-16T09:52:09Z# qmrestore /ab/store2/vm/100/2020-07-16T09:52:09Z/index.json.blob 105
ERROR: couldn't determine archive info from '/ab/store2/vm/100/2020-07-16T09:52:09Z/index.json.blob'

Code:
root@rise1rbx:~# qmrestore pb:/vm/100/2020-07-16T09:52:09Z 103
unable to parse PBS volume name '/vm/100/2020-07-16T09:52:09Z'

Especially required for https://forum.proxmox.com/threads/proxmox-backup-server-continuous-restore-script.73072/ . Thx!
 

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
6,210
1,056
164
for 'qmrestore', you need to pass in a full volume ID as returned by 'pvesm list'
 
  • Like
Reactions: EuroDomenii

EuroDomenii

Well-Known Member
Sep 30, 2016
139
25
48
Slatina
www.domenii.eu
Code:
root@rise1rbx:~# pvesm list
400 not enough arguments
pvesm list <storage> [OPTIONS]
root@rise1rbx:~# pvesm list pb
Volid                                 Format  Type              Size VMID
pb:backup/ct/104/2020-07-16T14:40:58Z pbs-ct  backup       902334049 104
pb:backup/ct/104/2020-07-16T14:43:57Z pbs-ct  backup      1300845995 104
pb:backup/ct/104/2020-07-16T15:17:39Z pbs-ct  backup     30543534356 104
pb:backup/ct/104/2020-07-16T15:30:52Z pbs-ct  backup     34746569641 104
pb:backup/vm/100/2020-07-16T09:52:09Z pbs-vm  backup    211741050242 100
pb:backup/vm/100/2020-07-16T10:11:49Z pbs-vm  backup    211741050242 100
pb:backup/vm/100/2020-07-16T10:25:27Z pbs-vm  backup    211741050245 100
pb:backup/vm/100/2020-07-16T11:17:17Z pbs-vm  backup    748611962330 100
pb:backup/vm/100/2020-07-16T12:08:16Z pbs-vm  backup    748611962329 100
pb:backup/vm/100/2020-07-16T12:24:48Z pbs-vm  backup    748611962331 100
pb:backup/vm/102/2020-07-16T09:36:04Z pbs-vm  backup    211741050262 102
pb:backup/vm/102/2020-07-16T09:49:53Z pbs-vm  backup    211741050264 102

It works, thanks!

Code:
qmrestore pb:backup/vm/100/2020-07-16T09:52:09Z 103
 
  • Like
Reactions: fabian

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
6,210
1,056
164
in case you are interested: the 'pbs-restore' binary called by 'qmrestore' uses the same underlying library as proxmox-backup-client to talk with PBS, but it is built together with pve-qemu-kvm like the 'vma' binary, and has access to Qemu block drivers directly.
 
  • Like
Reactions: EuroDomenii

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 your own in 60 seconds.

Buy now!