ovf: Support non-file backed disks, deployment configs, and vApp property qualifiers#3971
Open
akutz wants to merge 8 commits intovmware:mainfrom
Open
ovf: Support non-file backed disks, deployment configs, and vApp property qualifiers#3971akutz wants to merge 8 commits intovmware:mainfrom
akutz wants to merge 8 commits intovmware:mainfrom
Conversation
6d109f8 to
ab1a238
Compare
Distinguish OVF disks that are backed by a file (ovf:fileRef) from capacity-only (empty) disks in the generated ConfigSpec. Implementation (configspec.go): - Build a fileRefs map from Envelope.References and pass it through toHardware into toVirtualDisk. - For disks with a DiskSection fileRef, set backing FileName from path.Base(File.Href) so file-backed disks get a non-empty name; empty disks keep an empty backing name. - Build DeviceChange explicitly: for VirtualDisks, set FileOperation to Create for empty disks and to empty string for file-backed disks (existing file). Tests and fixtures: - Add fixtures/mixed-disks.ovf (one file-backed disk, one empty) and test "Mixed file-backed and empty disks" for backing FileName and FileOperation. - Add test "File-backed disk name from path.Base(File.Href)" using fixtures/file-ref-path.ovf. - In "Large" test, assert file-backed disk has non-empty FileName and empty disk has empty FileName. Signed-off-by: akutz <andrew.kutz@broadcom.com>
- Add OVF-to-vApp type mapping (DSP0243 Table 6 → vim.vApp.PropertyInfo): uint8/sint8/.../sint64 → int, String → string, Boolean → boolean, real32/real64 → real. Honor ovf:password for string → password. - Parse ovf:qualifiers per DSP0243 9.5.1 Table 7: MinLen, MaxLen, ValueMap for string; ValueMap for integer types. - Build VAppPropertyInfo.Type from base type and qualifiers (e.g. MinLen(1),MaxLen(65535) → string(1..65535), ValueMap → string["a","b"] or int(min..max)). - Use computed type in toVAppConfig for both the property Info.Type and for parseVAppConfigValue so qualifier-derived constraints are applied. - Add tests for qualifier-derived types and expect root_pwd Type "password" when ovf:password="true". Signed-off-by: akutz <andrew.kutz@broadcom.com>
ab1a238 to
6cab4c9
Compare
6cab4c9 to
2e797ce
Compare
hpannem
reviewed
Mar 6, 2026
hpannem
reviewed
Mar 6, 2026
2e797ce to
e13f3be
Compare
Add DeploymentConfiguration to ToConfigSpecOptions to select which deployment option (DeploymentOptionSection) to use; default or first if empty. Resolve by name with resolveDeploymentConfiguration(). Add tests for deployment config selection, OVF property types to vAppPropertyInfo.Type, and file-ref path in disk backing. Add fixtures: deployment-configs.ovf, property-types.ovf, file-ref-path.ovf. Signed-off-by: akutz <andrew.kutz@broadcom.com>
e13f3be to
9d8ceb0
Compare
This patch fixes the vAppPropertyInfo types for strings with min/max qualifiers. Signed-off-by: akutz <andrew.kutz@broadcom.com>
This patch adds support for specifying OVF disk capacity via an OVF property as well as handles possible invalid property key names. Signed-off-by: akutz <andrew.kutz@broadcom.com>
This patch supports OVF product categories. Signed-off-by: akutz <andrew.kutz@broadcom.com>
This patch adds OVF testing based on an uber OVF. Signed-off-by: akutz <andrew.kutz@broadcom.com>
a6f8527 to
aa91758
Compare
This patch adds support for vSphere-specific OVF property qualifiers. Signed-off-by: akutz <andrew.kutz@broadcom.com>
711396e to
76edb74
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR extends the
ovfpackage’s OVF→ConfigSpec behavior in three areas: file-backed vs empty disks, OVF property types/qualifiers per DSP0243, and explicit deployment configuration selection.1. File-backed disks in OVF→ConfigSpec
ovf:fileRefas file-backed and all others as capacity-only (empty) in the generated ConfigSpec.fileRefsmap fromEnvelope.Referencesand pass it throughtoHardwareintotoVirtualDisk.fileRef, set backingFileNamefrompath.Base(File.Href); empty disks keep an empty backing name.FileOperationtoCreatefor empty disks and to empty string for file-backed disks (existing file).fixtures/mixed-disks.ovf(one file-backed, one empty), plus tests for backingFileName,FileOperation, and file-backed disk name frompath.Base(File.Href).2. Parse OVF property qualifiers per DSP0243
uint8/sint8/…/sint64→int,String→string,Boolean→boolean,real32/real64→real. Honorovf:passwordso string becomespassword.ovf:qualifiers: MinLen, MaxLen, ValueMap for string; ValueMap for integer types.MinLen(1),MaxLen(65535)→string(1..65535), ValueMap →string["a","b"]orint(min..max)).toVAppConfigfor propertyInfo.Typeand inparseVAppConfigValueso qualifier-derived constraints are applied.root_pwdType"password"whenovf:password="true".3. Explicit deployment configuration
DeploymentConfigurationtoToConfigSpecOptionsto select which deployment option (DeploymentOptionSection) to use; if empty, use the default or the first configuration.resolveDeploymentConfiguration()resolves by name and validates against the envelope’s DeploymentOptionSection.deployment-configs.ovf,property-types.ovf,file-ref-path.ovf.Closes: #(issue-number)
NAHow Has This Been Tested?
go test -v ./ovfGuidelines
Please read and follow the
CONTRIBUTIONguidelines of this project.