[SOLVED] VM backup/restore and RDB additional disk

samontetro

Active Member
Jun 19, 2012
78
2
28
Grenoble, France
I've some troubles understanding backup/restore for a (CentOS) VM with Ceph storage, used as NFS server. Let say it is VM n. 100.
I've added a hard drive to this VM (virtio1) and it is located on my ceph RDB storage.
I do not want to backup this additionnal disk when I backup the VM as it is a large user storage area (250GB) so I've checked "no backup". It's backup is done separatly.

Today I had some troubles after an update of the VM: NFS was broken and "yum history rollback" was not able to restore the previous state.

I've tryed to restore my VM from the backup with a diffrent VMID: 103 (VM 100 was stopped). Restore is successfull but VM fails to start because of an error on the additional disk wich is not found. This disk still exist as starting VM 100 again shows all the data (only NFS is broken).

So my backup-process or restore-process is wrong as I'm unable to go back quickly to a working state.
- Is there a way to (re)connect this additionnal disk to the restored VM on a different ID (after a stop of the VM n. 100 of course and before removing it)?
- If I remove VM 100 and restore the backup with the same ID will the OS find this additionnal storage again? Or will the "remove" action destroy all the disks ?

Thanks for your advices
 
Thanks czechsys to suggest working at the file config level, but could you provide some links I should (have) read about this ?
I'm sorry but proxmox is working very well and so I'm not famillar with its file-based admin level, GUI was enought until now for me even if last year, at Proxmox training session, we saw some config files...
 
I'm still confused on howto backup/restore a VM with an additional disk not backed up....
I've run some test with "VM 103". Disk1 is the OS, disk2 is user data that I do not want to backup it with the OS as it is very large (on the VM in prod, not in this one where the test config has just a 8Gb user disk)

# pvesm list cephstorage
cephstorage:vm-103-disk-1 raw 17179869184 103 <= OS
cephstorage:vm-103-disk-2 raw 8589934592 103 <= user's data​

If backup is set to "on" for vm-103-disk1 and vm-103-disk2 all run fine (I can destroy the VM and restore it).

If backup is set to 0 for vm-103-disk2 I cannot restore anything in a running state:
-> restarting the VM (after removing the initial one) fails as it is looking for the second disk with: "a start job is running for dev-vda device" and I fall in a sort of rescue shell to modify /etc/fstab.
-> restarting the VM after a restore without removing the initial one let proxmoxVE showing all the disks with pvesm command but restart of the VM fails too with the same message...

What is the correct backup/restore process when vm-103-disk2 is a very large user disk that cannot be backed up every night by proxmoxVE with the VM OS (but is managed by a remote BackuPC server) ?
Just like restoring a system on a partitioned hard drive without changing anything in the user's data partition...

Thanks for your advices

Patrick

Proxmox is: 4.4.12

Config of the VM 103:
# qm config 103
bootdisk: scsi0
cores: 1
ide2: local:iso/CentOS-7-x86_64-Minimal-1611.iso,media=cdrom
memory: 2048
name: testbackup
net0: virtio=CE:C4:CE:87:8A:94,bridge=vmbr9
numa: 0
ostype: l26
scsi0: cephstorage:vm-103-disk-1,size=16G
scsihw: virtio-scsi-pci
smbios1: uuid=32cdec8b-2754-42e0-8d5d-63414180759e
sockets: 1
virtio1: cephstorage:vm-103-disk-2,size=8G
 
No idea ? Nor from proxmox users nor from proxmox team ?
Am I doing something wrong in this VM setup when I check the no-backup option for the additionnal disk (or may be not supported by the backup/restore proxmox tool)?
I'm surprised that nobody reach in this situation where VM backup can't be restored so it is merelly an abnormal config from myself....

Patrick
 
if you exclude a disk from backup, it is not contained in the backup and therefore also not restored when restoring from that backup. so you need to re-create the disk after restoring from backup if it is required for the VM to boot..
 
Thanks Fabian for helping in this Backup/restore problem.
So I must:
1) restore the backup
2) from the interface add the additionnal disk (with same confguration I suppose)
3) then boot the VM

But, is it possible at step 2 to use the disk image associated with the previous VM ? It seams difficult for me to imagine a storage known by 2 VMs.

My tests show that
- if I remove the VM before restoring the additionnal disk is removed too. It's a good feature.
- if I restore with the same VM id (the saved VM is in stopped state) the VM is overwritten but the additionnal disk seams to be removed too. Is there a way to keep it ?

Or could this feature (re-using the additionnal and not saved storage when the VM is restored - with overwrite of an existing VM - with the same ID) become an enhancement of proxmoxVE when retoring a VM?

Patrick
 
first off: if you destroy a VM, all disks associated with that VMID are destroyed. this includes disks referenced as unused in the configuration, or not referenced at all! so be careful when destroying VMs ;)

that being said, if you make a backup and then restore that backup back into the same VMID, only those disks which are actually contained in the backup archive are destroyed and re-created. all the others (e.g., disks which were excluded from the backup and still existed when restoring, but also leftover source disks from a "move disk" operation, or manually removed disks, or disks which have been added after the backup has been made, ...) are added as unused disk and can easily be re-added via the GUI or "qm set" (unused disks lose all their options/properties though, so you need to know which disk goes into which slot, should be marked read-only, excluded from backup, etc..).

if you make a backup with disks excluded and then destroy the source VM, those excluded disks are obviously lost.
 
Hi Fabian
It was so simple and my question was so stupid!
I had investigated "unused disks" last year in a proxmox training session but missunderstood this part about storage behavior in Proxmox.
In my defense there is only one small slide about this in documents provided but... Okay :oops:.
Restoring a VM with a non backed up disk is as simple as
- stop the VM you need to restore to a previous state
- retore the backup from "server view" -> "node" -> "VMid" view and click "backup" to choose the backup to restore.
- then the non backed up disk appears as unused in the "hardware" section of the VM
- Just select the disk and click "edit" to set it with the right driver (scsi, virtio...) and check again "no backup"
- boot the VM
And that's all.
ProxmoxVE is really a magic et powerfull tool.

Many thanks Fabian
 
To set a final point to this thread, is there a way to move an unused disk from a VM to another ? The move option available in the GUI is only for changing the storage.
  1. -> disk is removed from the stopped VM 103 (it appears as unused)
  2. -> I've restored a backup of this VM with a new ID: 104 (without removing VM 103)
  3. -> is it possible to move the unused disk of VM 103 to VM 104 ?
 
not really. you can add a reference using the API/CLI (e.g., using "qm set"), but the ownership association will be wrong and when you delete VM 103, the disk will be gone. so this is rather dangerous! if you really want to go this route, I would suggest reserving a special VM ID (e.g., 999999) for those disks, so that you won't accidentally delete them.
 
Thanks Fabian for this precision. May be this could become a new feature of proxmox, moving a "data disk" from one VM to another....
The context could be testing a new file server with a different linux version and switching to prod with just moving the disk which has the users data.
 

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!