[libvirt] [PATCH v3 repost] esx: Add the actual product version to the error
No change, just a repost of this trivial patch which is sitting in my queue. Previous post: http://www.redhat.com/archives/libvir-list/2014-September/msg00417.html
Really this should be a warning, not an error, but at least let's print out the product version so we have a hope of diagnosing the problem. error: internal error: v2v-vcenter is neither an ESX 3.5, 4.x nor 5.x host (product version = 0x40007) In this instance the error was that you have to use 'vpx://' instead of 'esx://'. --- src/esx/esx_driver.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 39784b9..21ebe82 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -704,8 +704,9 @@ esxConnectToHost(esxPrivate *priv, priv->host->productVersion != esxVI_ProductVersion_ESX51 && priv->host->productVersion != esxVI_ProductVersion_ESX5x) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s is neither an ESX 3.5, 4.x nor 5.x host"), - conn->uri->server); + _("%s is neither an ESX 3.5, 4.x nor 5.x host " + "(product version = 0x%x)"), + conn->uri->server, priv->host->productVersion); goto cleanup; } } else { /* GSX */ @@ -823,8 +824,9 @@ esxConnectToVCenter(esxPrivate *priv, priv->vCenter->productVersion != esxVI_ProductVersion_VPX51 && priv->vCenter->productVersion != esxVI_ProductVersion_VPX5x) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s is neither a vCenter 2.5, 4.x nor 5.x server"), - hostname); + _("%s is neither a vCenter 2.5, 4.x nor 5.x server " + "(product version = 0x%x)"), + hostname, priv->vCenter->productVersion); goto cleanup; } -- 2.0.4
2014-10-18 16:10 GMT+02:00 Richard W.M. Jones <rjones@redhat.com>:
Really this should be a warning, not an error, but at least let's print out the product version so we have a hope of diagnosing the problem.
error: internal error: v2v-vcenter is neither an ESX 3.5, 4.x nor 5.x host (product version = 0x40007)
In this instance the error was that you have to use 'vpx://' instead of 'esx://'.
No, this should not be a warning and it cannot be a warning easily without reworking the URI semantic of the driver. The esx:// and vpx:// URI formats are different. An essential difference is that you have to specify the datacenter name, cluster name (conditional) and server name as the path of a vpx:// URI. All of this information has no meaning for an esx:// URI. The driver already warns you that it is going to ignore the path section of an esx:// URI if it's not empty. Which should give you a hint that there is something wrong with your URI. The driver also complains if the path section is malformed of missing from a vpx:// URI. So in the case you mentioned about accidentally using esx:// instead of vpx:// to connect to a ESX serer through a vCenter server, you already get a warning like this: Ignoring unexpected path '/dc1/srv1' for non-vpx scheme 'esx' from virsh -c esx://v2v-vcenter/dc1/srv1 assuming you provided a proper path in you URI, but just mixed up esx:// and vpx://. Also reporting this product version value doesn't really help here, as this is just some driver internal enum value. I propose a different patch instead: https://www.redhat.com/archives/libvir-list/2014-October/msg00517.html This simplifies and relaxes the internal version checks and as a side effect also improves the error messages. In your case it would now report Expecting 'v2v-vcenter' to be a ESX(i) host but found a vCenter/VPX host -- Matthias Bolte http://photron.blogspot.com
On Sun, Oct 19, 2014 at 12:12:34AM +0200, Matthias Bolte wrote:
I propose a different patch instead:
https://www.redhat.com/archives/libvir-list/2014-October/msg00517.html
This simplifies and relaxes the internal version checks and as a side effect also improves the error messages. In your case it would now report
This is fine - please ignore my patch. However the alternative patch is a bit big for me to be able to review right now, but I'll try to test it with virt-v2v soon. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
participants (2)
-
Matthias Bolte -
Richard W.M. Jones