diff options
author | Matthias Bolte <matthias.bolte@googlemail.com> | 2010-07-22 01:19:04 +0200 |
---|---|---|
committer | Matthias Bolte <matthias.bolte@googlemail.com> | 2010-07-24 21:22:54 +0200 |
commit | d3864c3782d0ab6d79fdd7a1fe4bfa4c7b0ddd9f (patch) | |
tree | 5798c75e2c75d1fc8c84e216591ec4d3363915d6 | |
parent | esx: Add vpx:// scheme to allow direct connection to a vCenter (diff) | |
download | libvirt-d3864c3782d0ab6d79fdd7a1fe4bfa4c7b0ddd9f.tar.gz libvirt-d3864c3782d0ab6d79fdd7a1fe4bfa4c7b0ddd9f.tar.bz2 libvirt-d3864c3782d0ab6d79fdd7a1fe4bfa4c7b0ddd9f.zip |
esx: Support vSphere 4.1
Also accept version > 4.1, but output a warning.
-rw-r--r-- | docs/drvesx.html.in | 4 | ||||
-rw-r--r-- | src/esx/esx_driver.c | 12 | ||||
-rw-r--r-- | src/esx/esx_vi.c | 27 | ||||
-rw-r--r-- | src/esx/esx_vi.h | 10 | ||||
-rw-r--r-- | src/esx/esx_vmx.c | 9 |
5 files changed, 51 insertions, 11 deletions
diff --git a/docs/drvesx.html.in b/docs/drvesx.html.in index 10f122506..4ae7a5180 100644 --- a/docs/drvesx.html.in +++ b/docs/drvesx.html.in @@ -2,10 +2,10 @@ <h1>VMware ESX hypervisor driver</h1> <ul id="toc"></ul> <p> - The libvirt VMware ESX driver can manage VMware ESX/ESXi 3.5/4.0 and + The libvirt VMware ESX driver can manage VMware ESX/ESXi 3.5/4.x and VMware GSX 2.0, also called VMware Server 2.0, and possibly later versions. <span class="since">Since 0.8.3</span> the driver can also - connect to a VMware vCenter 2.5/4.0 (VPX). + connect to a VMware vCenter 2.5/4.x (VPX). </p> diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 3a5854f61..f9affea3f 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -353,9 +353,11 @@ esxConnectToHost(esxPrivate *priv, virConnectAuthPtr auth, if (expectedProductVersion == esxVI_ProductVersion_ESX) { if (priv->host->productVersion != esxVI_ProductVersion_ESX35 && - priv->host->productVersion != esxVI_ProductVersion_ESX40) { + priv->host->productVersion != esxVI_ProductVersion_ESX40 && + priv->host->productVersion != esxVI_ProductVersion_ESX41 && + priv->host->productVersion != esxVI_ProductVersion_ESX4x) { ESX_ERROR(VIR_ERR_INTERNAL_ERROR, - _("%s is neither an ESX 3.5 host nor an ESX 4.0 host"), + _("%s is neither an ESX 3.5 host nor an ESX 4.x host"), hostname); goto cleanup; } @@ -462,10 +464,12 @@ esxConnectToVCenter(esxPrivate *priv, virConnectAuthPtr auth, } if (priv->vCenter->productVersion != esxVI_ProductVersion_VPX25 && - priv->vCenter->productVersion != esxVI_ProductVersion_VPX40) { + priv->vCenter->productVersion != esxVI_ProductVersion_VPX40 && + priv->vCenter->productVersion != esxVI_ProductVersion_VPX41 && + priv->vCenter->productVersion != esxVI_ProductVersion_VPX4x) { ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("%s is neither a vCenter 2.5 server nor a vCenter " - "4.0 server"), hostname); + "4.x server"), hostname); goto cleanup; } diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 8c43d67a8..69ba7a929 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -378,9 +378,16 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url, ctx->apiVersion = esxVI_APIVersion_25; } else if (STRPREFIX(ctx->service->about->apiVersion, "4.0")) { ctx->apiVersion = esxVI_APIVersion_40; + } else if (STRPREFIX(ctx->service->about->apiVersion, "4.1")) { + ctx->apiVersion = esxVI_APIVersion_41; + } else if (STRPREFIX(ctx->service->about->apiVersion, "4.")) { + ctx->apiVersion = esxVI_APIVersion_4x; + + VIR_WARN("Found untested VI API major/minor version '%s'", + ctx->service->about->apiVersion); } else { ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, - _("Expecting VI API major/minor version '2.5' or '4.0' " + _("Expecting VI API major/minor version '2.5' or '4.x' " "but found '%s'"), ctx->service->about->apiVersion); goto cleanup; } @@ -400,10 +407,17 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url, ctx->productVersion = esxVI_ProductVersion_ESX35; } else if (STRPREFIX(ctx->service->about->version, "4.0")) { ctx->productVersion = esxVI_ProductVersion_ESX40; + } else if (STRPREFIX(ctx->service->about->version, "4.1")) { + ctx->productVersion = esxVI_ProductVersion_ESX41; + } else if (STRPREFIX(ctx->service->about->version, "4.")) { + ctx->productVersion = esxVI_ProductVersion_ESX4x; + + VIR_WARN("Found untested ESX major/minor version '%s'", + ctx->service->about->version); } else { ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, _("Expecting ESX major/minor version '3.5' or " - "'4.0' but found '%s'"), + "'4.x' but found '%s'"), ctx->service->about->version); goto cleanup; } @@ -412,9 +426,16 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url, ctx->productVersion = esxVI_ProductVersion_VPX25; } else if (STRPREFIX(ctx->service->about->version, "4.0")) { ctx->productVersion = esxVI_ProductVersion_VPX40; + } else if (STRPREFIX(ctx->service->about->version, "4.1")) { + ctx->productVersion = esxVI_ProductVersion_VPX41; + } else if (STRPREFIX(ctx->service->about->version, "4.")) { + ctx->productVersion = esxVI_ProductVersion_VPX4x; + + VIR_WARN("Found untested VPX major/minor version '%s'", + ctx->service->about->version); } else { ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, - _("Expecting VPX major/minor version '2.5' or '4.0' " + _("Expecting VPX major/minor version '2.5' or '4.x' " "but found '%s'"), ctx->service->about->version); goto cleanup; } diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h index f5e89e9ec..9eb50944c 100644 --- a/src/esx/esx_vi.h +++ b/src/esx/esx_vi.h @@ -94,7 +94,9 @@ enum _esxVI_APIVersion { esxVI_APIVersion_Undefined = 0, esxVI_APIVersion_Unknown, esxVI_APIVersion_25, - esxVI_APIVersion_40 + esxVI_APIVersion_40, + esxVI_APIVersion_41, + esxVI_APIVersion_4x /* > 4.1 */ }; /* @@ -110,10 +112,14 @@ enum _esxVI_ProductVersion { esxVI_ProductVersion_ESX = (1 << 1) << 16, esxVI_ProductVersion_ESX35 = esxVI_ProductVersion_ESX | 1, esxVI_ProductVersion_ESX40 = esxVI_ProductVersion_ESX | 2, + esxVI_ProductVersion_ESX41 = esxVI_ProductVersion_ESX | 3, + esxVI_ProductVersion_ESX4x = esxVI_ProductVersion_ESX | 4, /* > 4.1 */ esxVI_ProductVersion_VPX = (1 << 2) << 16, esxVI_ProductVersion_VPX25 = esxVI_ProductVersion_VPX | 1, - esxVI_ProductVersion_VPX40 = esxVI_ProductVersion_VPX | 2 + esxVI_ProductVersion_VPX40 = esxVI_ProductVersion_VPX | 2, + esxVI_ProductVersion_VPX41 = esxVI_ProductVersion_VPX | 3, + esxVI_ProductVersion_VPX4x = esxVI_ProductVersion_VPX | 4 /* > 4.1 */ }; enum _esxVI_Occurrence { diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c index e075149a6..c63b15905 100644 --- a/src/esx/esx_vmx.c +++ b/src/esx/esx_vmx.c @@ -1184,6 +1184,7 @@ esxVMX_ParseConfig(esxVI_Context *ctx, virCapsPtr caps, const char *vmx, * 4 7 API * ESX 3.5 + 2.5 * ESX 4.0 + + 4.0 + * ESX 4.1 + + 4.1 * GSX 2.0 + + 2.5 */ switch (productVersion) { @@ -1201,7 +1202,9 @@ esxVMX_ParseConfig(esxVI_Context *ctx, virCapsPtr caps, const char *vmx, case esxVI_ProductVersion_GSX20: case esxVI_ProductVersion_ESX40: + case esxVI_ProductVersion_ESX41: case esxVI_ProductVersion_VPX40: + case esxVI_ProductVersion_VPX41: if (virtualHW_version != 4 && virtualHW_version != 7) { ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Expecting VMX entry 'virtualHW.version' to be 4 or 7 " @@ -1212,6 +1215,10 @@ esxVMX_ParseConfig(esxVI_Context *ctx, virCapsPtr caps, const char *vmx, break; + case esxVI_ProductVersion_ESX4x: + case esxVI_ProductVersion_VPX4x: + break; + default: ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Unexpected product version")); @@ -2702,6 +2709,8 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virCapsPtr caps, virDomainDefPtr def, case esxVI_ProductVersion_GSX20: case esxVI_ProductVersion_ESX40: + case esxVI_ProductVersion_ESX41: + case esxVI_ProductVersion_ESX4x: virBufferAddLit(&buffer, "virtualHW.version = \"7\"\n"); break; |