[Possible Bug] Bareos VMware plugin fails when restoring a backed up VM as a new VM with Error message "VM disks not matching backed up disks"

118 views
Skip to first unread message

Robi Setia Permadi

unread,
Apr 28, 2024, 1:32:04 PM4/28/24
to bareos-users
Hi Guys, 

I have installed Bareos with version details as below:
```
Bareos OS: Rocky Linux 8.9
Bareos: 23.0.2~pre92.c3dac06f1
bareos-vmware-plugin: 23.0.3~pre95.0aeaf0d6d
```

I have setup the backup jobs and other resources that required. 
The backup jobs works fine as the picture i attached in the attachment Picture-1.

After the backup was complete, I ran a Restore job with the parameters as in attachment Picture-2.

The issue is that when I restore the backed up VM as a new VM, bareos-vmware-plugin fails to create the new VM correctly. 

Instead of creating a disk VM according to the name that has been defined, bareos-vmware-plugin creates a disk VM with the name [OLD_VM_NAME]-[SNAPSHOT_ID].vmdk (e.g cmg01z00ad002-000004.vmdk) which should match the value in the vmname parameter (e.g cmg01z00ad002-restore.vmdk).

Expected Result:
bareos-vmware-plugin creates a new VM with a disk name that matches the value in the vmname parameter.

Actual results:
bareos-vmware-plugin creates a new VM with a disk name that does not match the value in the vmname parameter. bareos-vmware-plugin creates a disk with the name [OLD_VM_NAME]-[SNAPSHOT_ID] (e.g cmg01z00ad002-000004.vmdk).

Workarounds:
- Remove the wrong disk from the new vm
- Remove the new vm
- Restore again the vm with same parameter as before, then the new VM will be created correctly as Expected Result.

-----------------------
Based on what I said above, is there a possibility that this is a bug in bareos-vmware-plugin version 23.0.3~pre95.0aeaf0d6d? 

Thanks Anyway.
Picture-2
Picture-1

Stephan Duehr

unread,
May 2, 2024, 4:56:40 PM5/2/24
to bareos...@googlegroups.com
Hi,

thanks for reporting this and you proprosed PR #1796.

There already was a change to address this, see
https://github.com/bareos/bareos/blob/5037b212391da1c4af45907f11a05d07865cd08f/core/src/plugins/filed/python/vmware/bareos-fd-vmware.py#L4071-L4092
but it does not seem to work when using VSAN, and as of your screenshot you are obviously using VSAN.

Looks like with VSAN, the VMFS path is not using the VM-Name as a directory but a unique string instead.

Unfortunately we don't have VSAN in our test environment, so I can't reproduce your problem.

I need some more time to test and understand your PR and the consequences it has when not using VSAN.

Regards,
Stephan

On 4/28/24 19:32, Robi Setia Permadi wrote:
> Hi Guys,
>
> I have installed Bareos with version details as below:
> ```
> Bareos OS: Rocky Linux 8.9
> Bareos: 23.0.2~pre92.c3dac06f1
> bareos-vmware-plugin: 23.0.3~pre95.0aeaf0d6d
> ```
>
> I have setup the backup jobs and other resources that required.
> The backup jobs works fine as the picture i attached in the attachment Picture-1.
>
> After the backup was complete, I ran a Restore job with the parameters as in attachment Picture-2.
>
> The issue is that when I restore the backed up VM as a new VM, bareos-vmware-plugin fails to create the new VM correctly.
>
> Instead of creating a disk VM according to the name that has been defined, bareos-vmware-plugin creates a disk VM with the name [OLD_VM_NAME]-[SNAPSHOT_ID].vmdk (e.g cmg01z00ad002-000004.vmdk) which should match the value in the vmname parameter (e.g cmg01z00ad002-restore.vmdk).
>
> *Expected Result:*
> bareos-vmware-plugin creates a new VM with a disk name that matches the value in the vmname parameter.
>
> *Actual results:*
> bareos-vmware-plugin creates a new VM with a disk name that does not match the value in the vmname parameter. bareos-vmware-plugin creates a disk with the name [OLD_VM_NAME]-[SNAPSHOT_ID] (e.g cmg01z00ad002-000004.vmdk).
>
> *Workarounds:*
> - Remove the wrong disk from the new vm
> - Remove the new vm
> - Restore again the vm with same parameter as before, then the new VM will be created correctly as *Expected Result.*
>
> -----------------------
> Based on what I said above, is there a possibility that this is a bug in bareos-vmware-plugin version 23.0.3~pre95.0aeaf0d6d?
>
> Thanks Anyway.
>
> --
> You received this message because you are subscribed to the Google Groups "bareos-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users...@googlegroups.com <mailto:bareos-users...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/10098505-f941-425c-9da4-38dac8fbbddfn%40googlegroups.com <https://groups.google.com/d/msgid/bareos-users/10098505-f941-425c-9da4-38dac8fbbddfn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Stephan Dühr stepha...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-90
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: S. Dühr, J. Steffens, Philipp Storz

Stephan Duehr

unread,
May 6, 2024, 10:25:13 AM5/6/24
to bareos...@googlegroups.com
Hi,

I can't reproduce the behaviour you are describing, even when a manually created snapshot
was existing at backup time, the virtual disks are created correctly with the given new vmname.

The version on https://download.bareos.org/current/ is now 23.0.3~pre104, could you please update
and try again?

Also please provide the job log as text, use
echo "list joblog jobid=<JobId>" | bconsole
and also the output of
echo "list files jobid=<JobId>" | bconsole

Regards,
Stephan

On 4/28/24 19:32, Robi Setia Permadi wrote:
> Hi Guys,
>
> I have installed Bareos with version details as below:
> ```
> Bareos OS: Rocky Linux 8.9
> Bareos: 23.0.2~pre92.c3dac06f1
> bareos-vmware-plugin: 23.0.3~pre95.0aeaf0d6d
> ```
>
> I have setup the backup jobs and other resources that required.
> The backup jobs works fine as the picture i attached in the attachment Picture-1.
>
> After the backup was complete, I ran a Restore job with the parameters as in attachment Picture-2.
>
> The issue is that when I restore the backed up VM as a new VM, bareos-vmware-plugin fails to create the new VM correctly.
>
> Instead of creating a disk VM according to the name that has been defined, bareos-vmware-plugin creates a disk VM with the name [OLD_VM_NAME]-[SNAPSHOT_ID].vmdk (e.g cmg01z00ad002-000004.vmdk) which should match the value in the vmname parameter (e.g cmg01z00ad002-restore.vmdk).
>
> *Expected Result:*
> bareos-vmware-plugin creates a new VM with a disk name that matches the value in the vmname parameter.
>
> *Actual results:*
> bareos-vmware-plugin creates a new VM with a disk name that does not match the value in the vmname parameter. bareos-vmware-plugin creates a disk with the name [OLD_VM_NAME]-[SNAPSHOT_ID] (e.g cmg01z00ad002-000004.vmdk).
>
> *Workarounds:*
> - Remove the wrong disk from the new vm
> - Remove the new vm
> - Restore again the vm with same parameter as before, then the new VM will be created correctly as *Expected Result.*
>
> -----------------------
> Based on what I said above, is there a possibility that this is a bug in bareos-vmware-plugin version 23.0.3~pre95.0aeaf0d6d?
>
> Thanks Anyway.
>
Message has been deleted
Message has been deleted

Robi Setia Permadi

unread,
May 9, 2024, 11:52:54 PM5/9/24
to bareos-users
Hi,

I Have updated the bareos components to the latest version, which are:
```
bareos-dir: 23.0.3~pre104.aaf825630
bareos-fd: 23.0.3~pre104.aaf825630
bareos-sd: 23.0.3~pre104.aaf825630
bareos-vmware-plugin: 23.0.3~pre104.aaf825630
```

I run restore job and the virtual disks are created correctly with the given new vmname. However, when restoring the backed-up VM as a new VM, it still fails with the error message “VM disks not matching backed up disks” as per the screenshot in Picture-3. I also attached the joblog of the restore job, which is the job with ID 32.

Therefore, I modified the vmware plugin source code according to PR #1796. so when restoring as a new VM, the vmware plugin will ignore if the backup disk is not the same as the new VM. I need a review, whether the changes I made to the PR are correct or it breaks the workflow of the plugin.

Thanks
Picture-3.png
files-job-32.log
job-32.log
Reply all
Reply to author
Forward
0 new messages