diff --git a/docs/drvesx.html.in b/docs/drvesx.html.in index 10f1225061ea051f38c2f57052f0e11f5a5b2426..4ae7a5180c0747bf2cc1816379372557285f2d76 100644 --- a/docs/drvesx.html.in +++ b/docs/drvesx.html.in @@ -2,10 +2,10 @@

VMware ESX hypervisor driver

- 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. Since 0.8.3 the driver can also - connect to a VMware vCenter 2.5/4.0 (VPX). + connect to a VMware vCenter 2.5/4.x (VPX).

diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 3a5854f612f4715803abce8aaee1fb42c68ace6a..f9affea3f1f4d14f859ee73adf3fba55b9bd06b0 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 8c43d67a881b746284bf9921ef4d6b70145b1f20..69ba7a929e063a1b216c993b4e1a9207cde766ac 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 f5e89e9ec8c685f9aa444db56df7c093af02f0b2..9eb50944c55bdf4986e60132470efd9e87251fb6 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 e075149a659745be4f2212a49a4615a4f66259c9..c63b15905e62482cd6d29629836ec99311a2b993 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;