了解 ImageProfileSoftwarePackageImageProfileDiff 对象的结构有助于管理部署和升级过程。

ImageProfile 对象属性

可以使用 Get-EsxImageProfile PowerCLI cmdlet 访问的 ImageProfile 对象具有以下属性。

名称 类型 描述
AcceptanceLevel AcceptanceLevel 确定可以添加到配置文件的 VIB。级别为 VMwareCertified、VMwareAccepted、PartnerSupported 和 CommunitySupported。请参见使用接受级别
Author System.String 创建配置文件的人员。不超过 60 个字符。
CreationTime System.DateTime 创建时间的时间戳。
Description System.String 配置文件的完整文本描述。无长度限制。
GUID System.String 映像配置文件的全局唯一 ID。
ModifiedTime System.DateTime 上次修改时间的时间戳。
Name System.String 映像配置文件的名称。不超过 80 个字符。
ReadOnly System.Boolean 设置为 true 时,无法编辑配置文件。使用 Set-EsxImageProfile -Readonly 将自定义映像配置文件设置为只读。
Rules ImageProfileRule[] 映像配置文件可能具有的任何 OEM 硬件要求和限制。vSphere Auto Deploy 会在部署映像配置文件时验证此属性的值,并在匹配的硬件可用时部署配置文件。
Vendor System.String 发布配置文件的组织。不超过 40 个字符。
VibList SoftwarePackage[] 映像所包含的 VIB ID 的列表。

SoftwarePackage 对象属性

准备映像配置文件时,可以检查软件包以确定哪些软件包适合纳入。SoftwarePackage 对象具有以下属性:

名称 类型 描述
AcceptanceLevel AcceptanceLevel 该 VIB 的接受程度。
Conflicts SoftwareConstraint[] 不能与该 VIB 同时安装的 VIB 的列表。每个限制均采用以下格式:

package-name[<<|<=|=|>=|<< version]

Depends SoftwareConstraint[] 必须与该 VIB 同时安装的 VIB 的列表。与 Conflicts 属性的限制格式相同。
Description System.String VIB 的详细描述。
Guid System.String VIB 的唯一 ID。
LiveInstallOk System.Boolean 如果支持该 VIB 的实时安装,则为 true。
LiveRemoveOk System.Boolean 如果支持该 VIB 的实时移除,则为 true。
MaintenanceMode System.Boolean 如果在进行该 VIB 安装时主机必须处于维护模式,则为 true。
Name System.String VIB 的名称。通常情况下,唯一描述正在运行的 ESXi 系统上的软件包。
Provides SoftwareProvides 该 VIB 提供的虚拟软件包或接口列表。请参见SoftwareProvide 对象属性
ReferenceURLs SupportReference[] 包含详尽支持信息的 SupportReference 对象列表。SupportReference 对象具有两个属性 TitleURL,两个属性都属于 System.String 类型。
Replaces SoftwareConstraint[] 确定替换该 VIB 或将其淘汰的 VIB 的 SoftwareConstraint 对象列表。VIB 会自动替换名称相同但版本较低的 VIB。
ReleaseDate System.DateTime VIB 发布或发行的日期和时间。
SourceUrls System.String[] 可以下载该 VIB 的源 URL 的列表。
StatelessReady System.Boolean 如果软件包支持主机配置文件或使其适合与 vSphere Auto Deploy 结合使用的其他技术,则为 true。
Summary System.String VIB 的单行摘要。
Tags System.String[] 供应商或发布者为该软件包定义的一组字符串标记。这些标记可用于标识软件包的特性。
Vendor System.String VIB 供应商或发布者。
Version System.String VIB 版本。
VersionObject Software.Version VersionObject 属性属于 SoftwareVersion 类型。SoftwareVersion 类实施静态 Compare 方法来比较两个字符串版本。请参见SoftwareVersion 对象属性

ImageProfileDiff 对象属性

运行 Compare-EsxImageProfile cmdlet 时,可以传递两个参数:首先传递引用配置文件,然后是比较配置文件。该 cmdlet 返回 ImageProfileDiff 对象,该对象具有以下属性。

名称 类型 描述
CompAcceptanceLevel System.String 传递到 Compare-EsxImageProfile 的第二个配置文件的接受程度。
DowngradeFromRef System.String[] 第二个配置文件中包含的从第一个配置文件中的 VIB 降级的 VIB 的列表。
Equal System.Boolean 如果两个映像配置文件具有相同的软件包和接受程度,则为 True
OnlyInComp System.String 仅可在传递到 Compare-EsxImageProfile 的第二个配置文件中找到的 VIB 的列表。
OnlyInRef System.String[] 仅可在传递到 Compare-EsxImageProfile 的第一个配置文件中找到的 VIB 的列表。
PackagesEqual System.Boolean 如果映像配置文件具有相同的 VIB 软件包组,则为 True
RefAcceptanceLevel System.String 传递到 Compare-EsxImageProfile 的第一个配置文件的接受程度。
UpgradeFromRef System.String[] 第二个配置文件中包含的从第一个配置文件中的 VIB 升级的 VIB 的列表。

SoftwareVersion 对象属性

您可通过 SoftwareVersion 对象比较两个版本字符串。该对象包含静态 Compare 方法。该方法接受两个字符串作为输入内容,并会在第一个版本字符串的数字高于第二个版本字符串时返回 1。如果两个版本字符串相等,Compare 会返回 0。如果第二个版本字符串的数字高于第一个字符串,则 Compare 会返回 -1。对象具有以下属性:

名称 类型 描述
Version System.String 连字符之前的版本部分。该部分表示主版本。
Release System.String 连字符之后的版本部分。该部分表示发行版本。

SoftwareConstraint 对象属性

SoftwareConstraint 对象实施 MatchesProvide 方法。该方法接受 SoftwareProvidesSoftwarePackage 对象作为输入内容。如果 constraint 符合 SoftwareProvideSoftwarePackage,会返回 True,否则会返回 False

SoftwareConstraint 对象包括以下属性。

名称 类型 描述
Name System.String constraint 的名称。该名称应该匹配相应的 SoftwareProvide Name 属性。
Relation System.String 枚举或以下比较指示符之一:<<, <=, = >=, >>。如果 constraint 没有 RelationVersion 属性,则该属性可为 $null。
Version System.String 要与 constraint 进行比较的版本。如果 constraint 没有 RelationVersion 属性,则该属性可为 $null。
VersionObject SoftwareVersion SoftwareVersion 对象表示的版本。

SoftwareProvide 对象属性

SoftwareProvide 对象包括以下属性。

名称 类型 描述
Name System.String provide 的名称。
Version System.String provide 的版本。如果 provide 未指定版本,则可为 $null。
Release System.String provide 的版本以 SoftwareVersion 对象表示。请参见SoftwareVersion 对象属性