From: Markus Frank <m.frank@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager v3 11/11] directory mapping: add live-migration-method option for virtiofs
Date: Mon, 27 Apr 2026 14:17:00 +0200 [thread overview]
Message-ID: <20260427121746.270544-12-m.frank@proxmox.com> (raw)
In-Reply-To: <20260427121746.270544-1-m.frank@proxmox.com>
Display warnings indicating that this feature is experimental.
Add the Messages.js file to reuse warnings, hints, and other messages
in different locations. Display the virtiofs warnings from the
Messages.js file in the migration and directory edit windows.
Requires the qemu-server commit named "virtiofs: add live migration
support".
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
v3 changes:
* remove severity option from Messages.js
* renamed hideComment to hideClusterOptions
* moved all live-migration related fields to columnB
* added has_virtiofs_live_migration variable
* improved the warning messages
www/manager6/Makefile | 1 +
www/manager6/Messages.js | 15 ++++++++
www/manager6/dc/DirMapView.js | 8 ++++
www/manager6/window/DirMapEdit.js | 63 +++++++++++++++++++++++++++++--
www/manager6/window/Migrate.js | 13 +++++++
5 files changed, 97 insertions(+), 3 deletions(-)
create mode 100644 www/manager6/Messages.js
diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index b506849d..80ce4a7c 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -7,6 +7,7 @@ JSSRC= \
StateProvider.js \
Utils.js \
UIOptions.js \
+ Messages.js \
Toolkit.js \
VNCConsole.js \
button/ConsoleButton.js \
diff --git a/www/manager6/Messages.js b/www/manager6/Messages.js
new file mode 100644
index 00000000..8e412a45
--- /dev/null
+++ b/www/manager6/Messages.js
@@ -0,0 +1,15 @@
+Ext.define('PVE.Messages', {
+ singleton: true,
+
+ virtiofs: {
+ prerequisites: gettext(
+ 'Before migrating with a virtiofs device, ensure that virtiofsd is installed on all hosts and that they are using the same shared directory on the same file system (e.g. CephFS).',
+ ),
+ umount: gettext(
+ 'The safest way to migrate a VM with a virtiofs device is to either unmount or mount the device as read-only.',
+ ),
+ migration_method_change: gettext(
+ 'Changes to the migration method will only take effect once a VM has been stopped and restarted, or migrated. When changing this from disabled, please restart VMs to ensure that additional migration checks are enabled.',
+ ),
+ },
+});
diff --git a/www/manager6/dc/DirMapView.js b/www/manager6/dc/DirMapView.js
index f0dfe28f..26f938e9 100644
--- a/www/manager6/dc/DirMapView.js
+++ b/www/manager6/dc/DirMapView.js
@@ -26,6 +26,14 @@ Ext.define('PVE.dc.DirMapView', {
dataIndex: 'text',
width: 200,
},
+ {
+ header: gettext('Live Migration Method'),
+ dataIndex: 'live-migration',
+ renderer: function (value, _meta, record) {
+ return Ext.String.htmlEncode(value ?? record.data['live-migration-method']);
+ },
+ width: 150,
+ },
{
header: gettext('Comment'),
dataIndex: 'description',
diff --git a/www/manager6/window/DirMapEdit.js b/www/manager6/window/DirMapEdit.js
index 841ff1fe..ac34d1a4 100644
--- a/www/manager6/window/DirMapEdit.js
+++ b/www/manager6/window/DirMapEdit.js
@@ -8,7 +8,7 @@ Ext.define('PVE.window.DirMapEditWindow', {
me.isCreate = !me.name;
me.method = me.isCreate ? 'POST' : 'PUT';
me.hideMapping = !!me.entryOnly;
- me.hideComment = me.name && !me.entryOnly;
+ me.hideClusterOptions = me.name && !me.entryOnly;
me.hideNodeSelector = me.nodename || me.entryOnly;
me.hideNode = !me.nodename || !me.hideNodeSelector;
return {
@@ -17,6 +17,15 @@ Ext.define('PVE.window.DirMapEditWindow', {
};
},
+ viewModel: {
+ data: {
+ migrationMethod: '__default__',
+ },
+ formulas: {
+ hideMigrationHints: (get) => get('migrationMethod') === '__default__',
+ },
+ },
+
submitUrl: function (_url, data) {
let me = this;
let name = me.isCreate ? '' : me.name;
@@ -39,8 +48,10 @@ Ext.define('PVE.window.DirMapEditWindow', {
let name = values.name;
let description = values.description;
+ let liveMigration = values['live-migration-method'];
let deletes = values.delete;
+ delete values['live-migration-method'];
delete values.description;
delete values.name;
delete values.delete;
@@ -69,6 +80,9 @@ Ext.define('PVE.window.DirMapEditWindow', {
if (description) {
values.description = description;
}
+ if (liveMigration) {
+ values['live-migration-method'] = liveMigration;
+ }
if (deletes && !view.isCreate) {
values.delete = deletes;
}
@@ -184,13 +198,56 @@ Ext.define('PVE.window.DirMapEditWindow', {
],
columnB: [
+ {
+ xtype: 'proxmoxKVComboBox',
+ fieldLabel: `<i class="fa fa-exclamation-triangle warning"></i> ${gettext('Experimental')}:
+ ${gettext('Live Migration Method')}`,
+ reference: 'live-migration-method',
+ name: 'live-migration-method',
+ comboItems: [
+ [
+ '__default__',
+ Proxmox.Utils.defaultText + ' (' + Proxmox.Utils.disabledText + ')',
+ ],
+ ['find-paths', 'find-paths'],
+ ['file-handles', 'file-handles'],
+ ],
+ cbind: {
+ deleteEmpty: '{!isCreate}',
+ disabled: '{hideClusterOptions}',
+ hidden: '{hideClusterOptions}',
+ },
+ bind: {
+ value: '{migrationMethod}',
+ },
+ },
+ {
+ xtype: 'displayfield',
+ reference: 'migration-method-change-hint',
+ columnWidth: 1,
+ value: PVE.Messages.virtiofs.migration_method_change,
+ bind: {
+ hidden: '{hideMigrationHints}',
+ },
+ userCls: 'pmx-hint',
+ },
+ {
+ xtype: 'displayfield',
+ reference: 'migration-hint',
+ columnWidth: 1,
+ value: PVE.Messages.virtiofs.prerequisites + ' ' + PVE.Messages.virtiofs.umount,
+ bind: {
+ hidden: '{hideMigrationHints}',
+ },
+ userCls: 'pmx-hint',
+ },
{
xtype: 'fieldcontainer',
defaultType: 'radiofield',
layout: 'fit',
cbind: {
- disabled: '{hideComment}',
- hidden: '{hideComment}',
+ disabled: '{hideClusterOptions}',
+ hidden: '{hideClusterOptions}',
},
items: [
{
diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index ff80c70c..1bc0315d 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -335,6 +335,19 @@ Ext.define('PVE.window.Migrate', {
if (vm.get('running')) {
let allowed = [];
let notAllowed = [];
+ let has_virtiofs_live_migration = Object.entries(mappedResources).some(
+ ([key, resource]) => key.match(/^virtiofs\d+/) && resource['live-migration'],
+ );
+ if (has_virtiofs_live_migration) {
+ migration.preconditions.push({
+ text: PVE.Messages.virtiofs.prerequisites,
+ severity: 'warning',
+ });
+ migration.preconditions.push({
+ text: PVE.Messages.virtiofs.umount,
+ severity: 'warning',
+ });
+ }
for (const [key, resource] of Object.entries(mappedResources)) {
if (resource['live-migration']) {
allowed.push(key);
--
2.47.3
next prev parent reply other threads:[~2026-04-27 12:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 12:16 [PATCH guest-common/qemu-server/docs/manager v3 0/11] Virtiofs improvements Markus Frank
2026-04-27 12:16 ` [PATCH guest-common v3 1/11] mapping: dir: add 'live-migration-method' parameter Markus Frank
2026-04-27 12:16 ` [PATCH qemu-server v3 2/11] fix #6370: virtiofs: add support for thread-pool-size option Markus Frank
2026-04-27 12:16 ` [PATCH qemu-server v3 3/11] virtiofs: add readonly option Markus Frank
2026-04-27 12:16 ` [PATCH qemu-server v3 4/11] virtiofs: add live migration support Markus Frank
2026-04-27 12:16 ` [PATCH docs v3 5/11] virtiofs: add explanation for cache=metadata behavior Markus Frank
2026-04-27 12:16 ` [PATCH docs v3 6/11] virtiofs: add table for optional parameters Markus Frank
2026-04-27 12:16 ` [PATCH docs v3 7/11] virtiofs: add description for thread-pool-size and readonly Markus Frank
2026-04-27 12:16 ` [PATCH docs v3 8/11] virtiofs: add documentation for live migration Markus Frank
2026-04-27 12:16 ` [PATCH manager v3 09/11] fix #6370: ui: virtiofs edit: add support for thread-pool-size option Markus Frank
2026-04-27 12:16 ` [PATCH manager v3 10/11] virtiofs edit: add support for readonly option Markus Frank
2026-04-27 12:17 ` Markus Frank [this message]
2026-04-27 15:18 ` [PATCH guest-common/qemu-server/docs/manager v3 0/11] Virtiofs improvements Filip Schauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260427121746.270544-12-m.frank@proxmox.com \
--to=m.frank@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.