Instant mount of vm

Lapointemar

New Member
Oct 18, 2020
3
1
3
29
I can with sucess mount the backup from pbs with the qemu-nbd -s commande (ive found that on a other tread on this forum) then i can map de device with
Ln -s /dev/nbd0 rpool/data/vm-100-disk-1
After that i can restor the config file and edit the config to point to new drive

I have booted a windows vm with success but the question i have is "did i risk to break backup by mounting backup like that ?"

And how can we speed up that nbd read ? Because it work slow a bit (around 10 minute to boot windows domain controleur from backup)

It cool because we can instantly boot multiple terabyte vm to test backup, recover data and desaste recovery (ex: ransomware) and then i suppose migrate vm to original server whiout to many down time for customer.


Any idea all ?

Anyway very good product and it still beta i cannot wait stable product :)
 

Lapointemar

New Member
Oct 18, 2020
3
1
3
29
Just quick dirt note if some on need complet procedure to mount drive from backup (It just some information ive found every where)

export PBS_REPOSITORY='username@pbs@x.x.x.x:datastoreName'
export PBS_PASSWORD='PasswordUsername'
export PBS_FINGERPRINT='Figerprint'
qemu-nbd --connect=/dev/nbd0 -f raw -s --cache=writeback pbs:repository=$PBS_REPOSITORY,snapshot=vm_snapshot,archive=drive-scsi0.img.fidx
mkdir /var/lib/vz/images/VMID
ln -s /dev/nbd0 /var/lib/vz/images/VMID/vm-VMID-disk-0.raw
_________________________
Copy configuration from backup and edit configuration to point du new drive
Start VM from cmd or web GUI
____________________________
Stop vm & delete Config file
Delete drive
rm /var/lib/vz/images/VMID/vm-VMID-disk-0.raw
qemu-nbd -d /dev/nbd0


I wish someone from dev team can let us know if they think this can be add as a option on PBS to start from backup VM :)
 
  • Like
Reactions: flames

Stefan_R

Proxmox Staff Member
Staff member
Jun 4, 2019
742
134
43
Vienna
Just for completeness I'll put it here too: Since proxmox-backup-client 0.9.1 you can do the mapping of backups easier with the 'map' and 'unmap' subcommands. Mapping directly to VMs will be discussed further on the bugtracker: https://bugzilla.proxmox.com/show_bug.cgi?id=3080
 

Lapointemar

New Member
Oct 18, 2020
3
1
3
29
Thank stefan, i gona test this map/unmap commande then. the post is solved for me i let it open for sometime if someone need to add something

Cordialement,
 

Stefan_R

Proxmox Staff Member
Staff member
Jun 4, 2019
742
134
43
Vienna
This is entirely seperate from storage backends, the data is directly streamed from PBS... not sure where Ceph would come into play here.
 

Cookiefamily

New Member
Jan 29, 2020
18
0
1
I was having a bit of a brainfart, the disk format of course is the same for whatever storage backend was used in the first place once backed up with pbs.

What packages are needed for this to work btw? qemu-utils for the qemu-nbd, but what package provides the pbs format for qemu-nbd?
 

Stefan_R

Proxmox Staff Member
Staff member
Jun 4, 2019
742
134
43
Vienna
I was having a bit of a brainfart, the disk format of course is the same for whatever storage backend was used in the first place once backed up with pbs.
The disk format for PBS backups is always the raw data, i.e. you get the data exactly as it was previously seen from within the guest (e.g. if you backup a VM on qcow2, what gets backed up is the data within the qcow2 image, not including any qcow2 metadata).

What packages are needed for this to work btw? qemu-utils for the qemu-nbd, but what package provides the pbs format for qemu-nbd?
PBS support is not upstream (and most likely never will be), so you need the PVE version of QEMU. You can get it from the PVE APT repository, just install the pve-qemu-kvm package (that should be possible without installing any other PVE component, so you can install this on other systems as well).
 
  • Like
Reactions: Cookiefamily

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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!