one icon indicating copy to clipboard operation
one copied to clipboard

Checkmark for backup volatile disk cant be reverted from Sunstone when it has or had attached a volatile disk

Open Franco-Sparrow opened this issue 1 year ago • 3 comments

Description

Sunstone fails to disable the backup of volatile disks when the VM has or had attached a volatile disk. It works only when the VM never had attached a volatile disk attached to it.

To Reproduce

Create a VM and configure the backups, add a volatile disk and mark the checkbox for backup volatile disks. Then, edit the configuration again and try to revert this. The VM will keep this configuration (BACKUP_VOLATILE: 'YES'), when should not.

Remove the volatile disk from the VM and try to disable again the backup of the volatile disks. The result is the same.

The only way to successfully revert this, is using the one CLI:

onevm updateconf <vm_id>

Edit the following line:

# [...]
BACKUP_VOLATILE: 'NO'
# [...]

Expected behavior

Revert the volatile disks backup from Sunstone if the VM has or had a volatile disk attached.

Details

  • Affected Component: [Sunstone]
  • Hypervisor: [KVM]
  • Version: [6.8.1]

Additional context Add any other context about the problem here.

Progress Status

  • [ ] Code committed
  • [ ] Testing - QA
  • [ ] Documentation (Release notes - resolved issues, compatibility, known issues)

Franco-Sparrow avatar Mar 11 '24 03:03 Franco-Sparrow

Yes @Franco-Sparrow , i can confirm the issue:

There are a condition in the file: src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/backup.js

https://github.com/OpenNebula/one/blob/57efabf2d59051788be3aec67bcd8bce36d95566/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/backup.js#L102-L104

That is only setting the value 'YES' if the condition are meet, but the variable will never get 'NO'.

I have solved in the following way!

    if (backupVolatile){
      backupConfigJSON['BACKUP_VOLATILE'] = 'YES'
    }else{
      backupConfigJSON['BACKUP_VOLATILE'] = 'NO'
    }

I have tested it is working properly!

nachowork90 avatar Mar 17 '24 06:03 nachowork90

Indeed @nachowork90 , thanks

Also, another posible solution is to initialize with NO before the if statement, but your solution is more elegant :)

Franco-Sparrow avatar Mar 17 '24 06:03 Franco-Sparrow

Hi Mr @rsmontero

This issue was patched with @nachowork90 proposal and it works.

Regards

Franco-Sparrow avatar Mar 19 '24 00:03 Franco-Sparrow