]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: boot order: handle cloudinit correctly
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Oct 2020 16:43:45 +0000 (18:43 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Oct 2020 16:45:31 +0000 (18:45 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/qemu/BootOrderEdit.js

index 11048896c31fce25ea1bfb7d4984a0e6a3cc8586..1e924dea2dfab59a3ee25cc2cd4a144d7c4686cd 100644 (file)
@@ -19,12 +19,14 @@ Ext.define('PVE.qemu.BootOrderPanel', {
        xclass: 'Ext.app.ViewController',
     },
 
+    isCloudinit: (v) => v.match(/media=cdrom/) && v.match(/[:/]vm-\d+-cloudinit/),
+
     isDisk: function(value) {
        return PVE.Utils.bus_match.test(value);
     },
 
     isBootdev: function(dev, value) {
-       return this.isDisk(dev) ||
+       return (this.isDisk(dev) && !this.isCloudinit(value)) ||
            (/^net\d+/).test(dev) ||
            (/^hostpci\d+/).test(dev) ||
            ((/^usb\d+/).test(dev) && !(/spice/).test(value));
@@ -59,7 +61,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
                    }
                } else if (orderList[i] === 'd') {
                    Ext.Object.each(me.vmconfig, function(key, value) {
-                       if (me.isDisk(key) && (/media=cdrom/).test(value)) {
+                       if (me.isDisk(key) && value.match(/media=cdrom/) && !me.isCloudinit(value)) {
                            list.push(key);
                        }
                    });