From be367d026df8680cacee73ca4064685f59b4b4c2 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 19 Feb 2024 08:57:56 -0300 Subject: [PATCH 1/2] remove details when error occurs --- .../kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java index 210af77f84a6..de2e5cf60ff8 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java @@ -308,7 +308,8 @@ Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0. logger.error(String.format("Can't migrate domain [%s] due to: [%s].", vmName, e.getMessage()), e); result = e.getMessage(); if (result.startsWith("unable to connect to server") && result.endsWith("refused")) { - result = String.format("Migration was refused connection to destination: %s. Please check libvirt configuration compatibility and firewall rules on the source and destination hosts.", destinationUri); + logger.debug(String.format("Migration failed as connection to destination [%s] was refused. Please check libvirt configuration compatibility and firewall rules on the source and destination hosts.", destinationUri)); + result = String.format("Failed to migrate domain [%s].", vmName); } } catch (final InterruptedException | ExecutionException From 62560bfb472f98a193a0def7ea1f2d0e07a160ed Mon Sep 17 00:00:00 2001 From: GaOrtiga <49285692+GaOrtiga@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:24:18 -0300 Subject: [PATCH 2/2] Update plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java Co-authored-by: dahn --- .../kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java index de2e5cf60ff8..c24214dd68cd 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java @@ -308,7 +308,7 @@ Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0. logger.error(String.format("Can't migrate domain [%s] due to: [%s].", vmName, e.getMessage()), e); result = e.getMessage(); if (result.startsWith("unable to connect to server") && result.endsWith("refused")) { - logger.debug(String.format("Migration failed as connection to destination [%s] was refused. Please check libvirt configuration compatibility and firewall rules on the source and destination hosts.", destinationUri)); + logger.debug("Migration failed as connection to destination [{}] was refused. Please check libvirt configuration compatibility and firewall rules on the source and destination hosts.", destinationUri); result = String.format("Failed to migrate domain [%s].", vmName); } } catch (final InterruptedException