[pve-devel] applied: [PATCH manager] ui: boot order: handle cloudinit correctly

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Oct 22 18:45:18 CEST 2020


heuristically..

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

and it's biting us once again to handle the cloudinit temp build like a cdrom
drive...

 www/manager6/qemu/BootOrderEdit.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/www/manager6/qemu/BootOrderEdit.js b/www/manager6/qemu/BootOrderEdit.js
index 11048896..1e924dea 100644
--- a/www/manager6/qemu/BootOrderEdit.js
+++ b/www/manager6/qemu/BootOrderEdit.js
@@ -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);
 			}
 		    });
-- 
2.20.1






More information about the pve-devel mailing list