[pve-devel] [PATCH manager] Delete "exclude" when switching a backup job to pool

Stefan Reiter s.reiter at proxmox.com
Tue Aug 6 14:41:42 CEST 2019


I don't see a reason to blanket-forbid excluding VMs in pool backups, so 
I felt leaving the API unchanged was the better option in this case. The 
GUI is the broken part, the API is working fine, albeit for a use-case 
it wasn't intentionally designed for.

That said, I'm fine with either change.

On 8/6/19 2:22 PM, Tim Marx wrote:
> Thanks for spotting this one.
> IMHO this would be better fixed in the API, unless we really want to allow pool backups which exclude vms:
> diff --git a/PVE/API2/Backup.pm b/PVE/API2/Backup.pm
> index bf9a3330..6c2e16c3 100644
> --- a/PVE/API2/Backup.pm
> +++ b/PVE/API2/Backup.pm
> @@ -476,6 +476,7 @@ __PACKAGE__->register_method({
>                      } elsif ($job->{pool}) {
>                          delete $job->{vmid};
>                          delete $job->{all};
> +                       delete $job->{exclude};
>                      }
>> Stefan Reiter <s.reiter at proxmox.com> hat am 6. August 2019 11:17 geschrieben:
>>
>>   
>> Previously, if you selected a job in "exclude" mode (in DC GUI) with some VMIDs
>> selected and then switched that backup job to "pool", the backup job would
>> retain the "exclude" section and thus not back up all VMs.
>>
>> The backend technically supports this, but the GUI would then misrepresent this,
>> showing that all VMs will be backed up (when in reality some will be excluded)
>> or straight up break and show "exclude" mode again, with the backend still being
>> on "pool".
>>
>> Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
>> ---
>>   www/manager6/dc/Backup.js | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
>> index 6810d92f..79e9cace 100644
>> --- a/www/manager6/dc/Backup.js
>> +++ b/www/manager6/dc/Backup.js
>> @@ -251,6 +251,8 @@ Ext.define('PVE.dc.BackupEdit', {
>>   		    values.exclude = values.vmid;
>>   		    delete values.vmid;
>>   		} else if (selMode === 'pool') {
>> +		    delete values.exclude;
>> +		    Proxmox.Utils.assemble_field_data(values, { 'delete': 'exclude' });
>>   		    delete values.vmid;
>>   		}
>>   
>> -- 
>> 2.20.1
>>
>>
>> _______________________________________________
>> pve-devel mailing list
>> pve-devel at pve.proxmox.com
>> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



More information about the pve-devel mailing list