This will allow to disable replication, when for instance we
add a disk on a non-replicatable storage.
The option is hidden in the wizard, because at that time no VM
replication has been set.
---
 www/manager6/qemu/HDEdit.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 0060394a..43e5d965 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -89,6 +89,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
            delete me.drive.backup;
        }
 
+       if (values.noreplicate) {
+           me.drive.replicate = 'no';
+       } else {
+           delete me.drive.replicate;
+       }
+
        if (values.discard) {
            me.drive.discard = 'on';
        } else {
@@ -147,6 +153,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
 
        values.hdimage = drive.file;
        values.nobackup = !PVE.Parser.parseBoolean(drive.backup, 1);
+       values.noreplicate = !PVE.Parser.parseBoolean(drive.replicate, 1);
        values.diskformat = drive.format || 'raw';
        values.cache = drive.cache || '__default__';
        values.discard = (drive.discard === 'on');
@@ -254,6 +261,13 @@ Ext.define('PVE.qemu.HDInputPanel', {
 
        me.column2.push({
            xtype: 'pvecheckbox',
+           hidden: me.insideWizard,
+           fieldLabel: gettext('Skip replication'),
+           name: 'noreplicate'
+       });
+
+       me.column2.push({
+           xtype: 'pvecheckbox',
            fieldLabel: gettext('Discard'),
            name: 'discard'
        });
-- 
2.11.0


_______________________________________________
pve-devel mailing list
[email protected]
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to