Limit infrastructure details revealed to the end user after a failed migration on KVM (#8680)

* remove details when error occurs

* Update plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java

Co-authored-by: dahn <daan.hoogland@gmail.com>

---------

Co-authored-by: Gabriel <gabriel.fernandes@scclouds.com.br>
Co-authored-by: dahn <daan.hoogland@gmail.com>
This commit is contained in:
GaOrtiga 2024-04-16 09:58:35 -03:00 committed by GitHub
parent 45daa1ce59
commit 31f28f6516
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -308,7 +308,8 @@ public final class LibvirtMigrateCommandWrapper extends CommandWrapper<MigrateCo
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("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
| ExecutionException