ovf

package
v0.53.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 105

Documentation

Overview

Package ovf provides functionality to unmarshal and inspect the structure of an OVF file. It is not a complete implementation of the specification and is intended to be used to import virtual infrastructure into vSphere.

For a complete specification of the OVF standard, refer to: https://www.dmtf.org/sites/default/files/standards/documents/DSP0243_2.1.0.pdf

Index

Constants

View Source
const (
	ResourceSubTypeSoundCardSB16          = "vmware.soundcard.sb16"
	ResourceSubTypeSoundCardEnsoniq1371   = "vmware.soundcard.ensoniq1371"
	ResourceSubTypeSoundCardHDAudio       = "vmware.soundcard.hdaudio"
	ResourceSubTypePCIController          = "vmware.pcicontroller"
	ResourceSubTypePS2Controller          = "vmware.ps2controller"
	ResourceSubTypeSIOController          = "vmware.siocontroller"
	ResourceSubTypeKeyboard               = "vmware.keyboard"
	ResourceSubTypePointingDevice         = "vmware.pointingdevice"
	ResourceSubTypeVMCI                   = "vmware.vmci"
	ResourceSubTypeUSBEHCI                = "vmware.usb.ehci" /* USB 2.0 */
	ResourceSubTypeUSBXHCI                = "vmware.usb.xhci" /* USB 3.0 */
	ResourceSubTypeCdromISO               = "vmware.cdrom.iso"
	ResourceSubTypeCDROMRemotePassthrough = "vmware.cdrom.remotepassthrough"
	ResourceSubTypeCDROMRemoteATAPI       = "vmware.cdrom.remoteatapi"
	ResourceSubTypeCDROMPassthrough       = "vmware.cdrom.passthrough"
	ResourceSubTypeCDROMATAPI             = "vmware.cdrom.atapi"
	ResourceSubTypeFloppyDevice           = "vmware.floppy.device"
	ResourceSubTypeFloppyImage            = "vmware.floppy.image"
	ResourceSubTypeFloppyRemoveDevice     = "vmware.floppy.remotedevice"
	ResourceSubTypeSCSIPassthrough        = "vmware.scsi.passthrough"
	ResourceSubTypeParallelPortDevice     = "vmware.parallelport.device"
	ResourceSubTypeParallelPortFile       = "vmware.parallelport.file"
	ResourceSubTypeSerialPortDevice       = "vmware.serialport.device"
	ResourceSubTypeSerialPortFile         = "vmware.serialport.file"
	ResourceSubTypeSerialPortPipe         = "vmware.serialport.pipe"
	ResourceSubTypeSerialPortURI          = "vmware.serialport.uri"
	ResourceSubTypeSerialPortThinPrint    = "vmware.serialport.thinprint"
	ResourceSubTypeSATAAHCI               = "vmware.sata.ahci"
	ResourceSubTypeSATAAHCIAlter          = "ahci"
	ResourceSubTypeNVMEController         = "vmware.nvme.controller"
	ResourceSubTypeNVDIMMController       = "vmware.nvdimm.controller"
	ResourceSubTypeNVDIMMDevice           = "vmware.nvdimm.device"
	ResourceSubTypePCIPassthrough         = "vmware.pci.passthrough"
	ResourceSubTypePCIPassthroughDVX      = "vmware.pci.passthrough-dvx"
	ResourceSubTypePCIPassthroughAH       = "vmware.pci.passthrough-ah"
	ResourceSubTypePCIPassthroughVMIOP    = "vmware.pci.passthrough-vmiop"
	ResourceSubTypePrecisionClock         = "vmware.precisionclock"
	ResourceSubTypeWatchdogTimer          = "vmware.watchdogtimer"
	ResourceSubTypeVTPM                   = "vmware.vtpm"
)

Variables

This section is empty.

Functions

func ParseCapacityAllocationUnits added in v0.40.0

func ParseCapacityAllocationUnits(s string) int64

ParseCapacityAllocationUnits validates the string s is a valid programmatic unit with respect to the base unit 'byte' and parses the string to return the number of bytes s represents

Types

type AnnotationSection

type AnnotationSection struct {
	Section

	Annotation string `xml:"Annotation" json:"annotation,omitempty"`
}

type CIMOSType added in v0.53.0

type CIMOSType int

CIMOSType represents the CIM (Common Information Model) OSType enumeration values. These values are defined by the DMTF CIM schema and used in various management standards. Please refer to the following URL for more information: https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/cim-operatingsystem

const (
	CIMOSTypeUnknown                          CIMOSType = 0
	CIMOSTypeOther                            CIMOSType = 1
	CIMOSTypeMACOS                            CIMOSType = 2
	CIMOSTypeATTUNIX                          CIMOSType = 3
	CIMOSTypeDGUX                             CIMOSType = 4
	CIMOSTypeDECNT                            CIMOSType = 5
	CIMOSTypeTru64UNIX                        CIMOSType = 6
	CIMOSTypeOpenVMS                          CIMOSType = 7
	CIMOSTypeHPUX                             CIMOSType = 8
	CIMOSTypeAIX                              CIMOSType = 9
	CIMOSTypeMVS                              CIMOSType = 10
	CIMOSTypeOS400                            CIMOSType = 11
	CIMOSTypeOS2                              CIMOSType = 12
	CIMOSTypeJavaMachine                      CIMOSType = 13
	CIMOSTypeMSDOS                            CIMOSType = 14
	CIMOSTypeWIN3x                            CIMOSType = 15
	CIMOSTypeWIN95                            CIMOSType = 16
	CIMOSTypeWIN98                            CIMOSType = 17
	CIMOSTypeWINNT                            CIMOSType = 18
	CIMOSTypeWINCE                            CIMOSType = 19
	CIMOSTypeNCR3000                          CIMOSType = 20
	CIMOSTypeNetWare                          CIMOSType = 21
	CIMOSTypeOSF                              CIMOSType = 22
	CIMOSTypeDCOS                             CIMOSType = 23
	CIMOSTypeReliantUNIX                      CIMOSType = 24
	CIMOSTypeSCOUnixWare                      CIMOSType = 25
	CIMOSTypeSCOOpenServer                    CIMOSType = 26
	CIMOSTypeSequent                          CIMOSType = 27
	CIMOSTypeIRIX                             CIMOSType = 28
	CIMOSTypeSolaris                          CIMOSType = 29
	CIMOSTypeSunOS                            CIMOSType = 30
	CIMOSTypeU6000                            CIMOSType = 31
	CIMOSTypeASERIES                          CIMOSType = 32
	CIMOSTypeTandemNSK                        CIMOSType = 33
	CIMOSTypeTandemNT                         CIMOSType = 34
	CIMOSTypeBS2000                           CIMOSType = 35
	CIMOSTypeLINUX                            CIMOSType = 36
	CIMOSTypeLynx                             CIMOSType = 37
	CIMOSTypeXENIX                            CIMOSType = 38
	CIMOSTypeVMESA                            CIMOSType = 39
	CIMOSTypeInteractive                      CIMOSType = 40
	CIMOSTypeBSDUNIX                          CIMOSType = 41
	CIMOSTypeFreeBSD                          CIMOSType = 42
	CIMOSTypeNetBSD                           CIMOSType = 43
	CIMOSTypeGNUHurd                          CIMOSType = 44
	CIMOSTypeOS9                              CIMOSType = 45
	CIMOSTypeMACHKernel                       CIMOSType = 46
	CIMOSTypeInferno                          CIMOSType = 47
	CIMOSTypeQNX                              CIMOSType = 48
	CIMOSTypeEPOC                             CIMOSType = 49
	CIMOSTypeIXWorks                          CIMOSType = 50
	CIMOSTypeVxWorks                          CIMOSType = 51
	CIMOSTypeMiNT                             CIMOSType = 52
	CIMOSTypeBeOS                             CIMOSType = 53
	CIMOSTypeHPMPE                            CIMOSType = 54
	CIMOSTypeNextStep                         CIMOSType = 55
	CIMOSTypePalmPilot                        CIMOSType = 56
	CIMOSTypeRhapsody                         CIMOSType = 57
	CIMOSTypeWindows2000                      CIMOSType = 58
	CIMOSTypeDedicated                        CIMOSType = 59
	CIMOSTypeOS390                            CIMOSType = 60
	CIMOSTypeVSE                              CIMOSType = 61
	CIMOSTypeTPF                              CIMOSType = 62
	CIMOSTypeWindowsMe                        CIMOSType = 63
	CIMOSTypeCalderaOpenUNIX                  CIMOSType = 64
	CIMOSTypeOpenBSD                          CIMOSType = 65
	CIMOSTypeNotApplicable                    CIMOSType = 66
	CIMOSTypeWindowsXP                        CIMOSType = 67
	CIMOSTypezOS                              CIMOSType = 68
	CIMOSTypeMicrosoftWindowsServer2003       CIMOSType = 69
	CIMOSTypeMicrosoftWindowsServer2003_64Bit CIMOSType = 70
	CIMOSTypeWindowsXP64Bit                   CIMOSType = 71
	CIMOSTypeWindowsXPEmbedded                CIMOSType = 72
	CIMOSTypeWindowsVista                     CIMOSType = 73
	CIMOSTypeWindowsVista64Bit                CIMOSType = 74
	CIMOSTypeWindowsEmbeddedforPointofService CIMOSType = 75
	CIMOSTypeMicrosoftWindowsServer2008       CIMOSType = 76
	CIMOSTypeMicrosoftWindowsServer2008_64Bit CIMOSType = 77
	CIMOSTypeFreeBSD64Bit                     CIMOSType = 78
	CIMOSTypeRedHatEnterpriseLinux            CIMOSType = 79
	CIMOSTypeRedHatEnterpriseLinux64Bit       CIMOSType = 80
	CIMOSTypeSolaris64Bit                     CIMOSType = 81
	CIMOSTypeSUSE                             CIMOSType = 82
	CIMOSTypeSUSE64Bit                        CIMOSType = 83
	CIMOSTypeSLES                             CIMOSType = 84
	CIMOSTypeSLES64Bit                        CIMOSType = 85
	CIMOSTypeNovellOES                        CIMOSType = 86
	CIMOSTypeNovellLinuxDesktop               CIMOSType = 87
	CIMOSTypeSunJavaDesktopSystem             CIMOSType = 88
	CIMOSTypeMandriva                         CIMOSType = 89
	CIMOSTypeMandriva64Bit                    CIMOSType = 90
	CIMOSTypeTurboLinux                       CIMOSType = 91
	CIMOSTypeTurboLinux64Bit                  CIMOSType = 92
	CIMOSTypeUbuntu                           CIMOSType = 93
	CIMOSTypeUbuntu64Bit                      CIMOSType = 94
	CIMOSTypeDebian                           CIMOSType = 95
	CIMOSTypeDebian64Bit                      CIMOSType = 96
	CIMOSTypeLinux24x                         CIMOSType = 97
	CIMOSTypeLinux24x64Bit                    CIMOSType = 98
	CIMOSTypeLinux26x                         CIMOSType = 99
	CIMOSTypeLinux26x64Bit                    CIMOSType = 100
	CIMOSTypeLinux64Bit                       CIMOSType = 101
	CIMOSTypeOther64Bit                       CIMOSType = 102
	CIMOSTypeMicrosoftWindowsServer2008R2     CIMOSType = 103
	CIMOSTypeVMwareESXi                       CIMOSType = 104
	CIMOSTypeMicrosoftWindows7                CIMOSType = 105
	CIMOSTypeCentOS32bit                      CIMOSType = 106
	CIMOSTypeCentOS64bit                      CIMOSType = 107
	CIMOSTypeOracle32bit                      CIMOSType = 108
	CIMOSTypeOracle64bit                      CIMOSType = 109
	CIMOSTypeeComStation32bitx                CIMOSType = 110
	CIMOSTypeMicrosoftWindowsServer2011       CIMOSType = 111
	CIMOSTypeMicrosoftWindowsServer2012       CIMOSType = 112
	CIMOSTypeMicrosoftWindows8                CIMOSType = 113
	CIMOSTypeMicrosoftWindows81               CIMOSType = 114
	CIMOSTypeMicrosoftWindowsServer2012R2     CIMOSType = 115
)

func GuestIDToCIMOSType added in v0.53.0

func GuestIDToCIMOSType[T ~string](guestID T) CIMOSType

GuestIDToCIMOSType translates a vSphere Guest OS identifier to a CIM OSType value.

type CIMResourceAllocationSettingData

type CIMResourceAllocationSettingData struct {
	ElementName string `xml:"ElementName" json:"elementName,omitempty"`
	InstanceID  string `xml:"InstanceID" json:"instanceID,omitempty"`

	ResourceType      *CIMResourceType `xml:"ResourceType" json:"resourceType,omitempty"`
	OtherResourceType *string          `xml:"OtherResourceType" json:"otherResourceType,omitempty"`
	ResourceSubType   *string          `xml:"ResourceSubType" json:"resourceSubType,omitempty"`

	AddressOnParent       *string  `xml:"AddressOnParent" json:"addressOnParent,omitempty"`
	Address               *string  `xml:"Address" json:"address,omitempty"`
	AllocationUnits       *string  `xml:"AllocationUnits" json:"allocationUnits,omitempty"`
	AutomaticAllocation   *bool    `xml:"AutomaticAllocation" json:"automaticAllocation,omitempty"`
	AutomaticDeallocation *bool    `xml:"AutomaticDeallocation" json:"automaticDeallocation,omitempty"`
	Caption               *string  `xml:"Caption" json:"caption,omitempty"`
	Connection            []string `xml:"Connection" json:"connection,omitempty"`
	ConsumerVisibility    *uint16  `xml:"ConsumerVisibility" json:"consumerVisibility,omitempty"`
	Description           *string  `xml:"Description" json:"description,omitempty"`
	HostResource          []string `xml:"HostResource" json:"hostResource,omitempty"`
	Limit                 *uint64  `xml:"Limit" json:"limit,omitempty"`
	MappingBehavior       *uint    `xml:"MappingBehavior" json:"mappingBehavior,omitempty"`
	Parent                *string  `xml:"Parent" json:"parent,omitempty"`
	PoolID                *string  `xml:"PoolID" json:"poolID,omitempty"`
	Reservation           *uint64  `xml:"Reservation" json:"reservation,omitempty"`
	VirtualQuantity       *uint    `xml:"VirtualQuantity" json:"virtualQuantity,omitempty"`
	VirtualQuantityUnits  *string  `xml:"VirtualQuantityUnits" json:"virtualQuantityUnits,omitempty"`
	Weight                *uint    `xml:"Weight" json:"weight,omitempty"`
}

type CIMResourceType added in v0.47.0

type CIMResourceType uint16

Source:

const (
	Other              CIMResourceType = 1
	ComputerSystem     CIMResourceType = 2
	Processor          CIMResourceType = 3
	Memory             CIMResourceType = 4
	IdeController      CIMResourceType = 5
	ParallelScsiHba    CIMResourceType = 6
	FcHba              CIMResourceType = 7
	IScsiHba           CIMResourceType = 8
	IbHba              CIMResourceType = 9
	EthernetAdapter    CIMResourceType = 10
	OtherNetwork       CIMResourceType = 11
	IoSlot             CIMResourceType = 12
	IoDevice           CIMResourceType = 13
	FloppyDrive        CIMResourceType = 14
	CdDrive            CIMResourceType = 15
	DvdDrive           CIMResourceType = 16
	DiskDrive          CIMResourceType = 17
	TapeDrive          CIMResourceType = 18
	StorageExtent      CIMResourceType = 19
	OtherStorage       CIMResourceType = 20
	SerialPort         CIMResourceType = 21
	ParallelPort       CIMResourceType = 22
	UsbController      CIMResourceType = 23
	Graphics           CIMResourceType = 24
	Ieee1394           CIMResourceType = 25
	PartitionableUnit  CIMResourceType = 26
	BasePartitionable  CIMResourceType = 27
	PowerSupply        CIMResourceType = 28
	CoolingDevice      CIMResourceType = 29
	EthernetSwitchPort CIMResourceType = 30
	LogicalDisk        CIMResourceType = 31
	StorageVolume      CIMResourceType = 32
	EthernetConnection CIMResourceType = 33
)

Please note, the iota pattern is not used to ensure these constants remain affixed to an explicit value.

type CIMStorageAllocationSettingData added in v0.22.0

type CIMStorageAllocationSettingData struct {
	ElementName string `xml:"ElementName" json:"elementName"`
	InstanceID  string `xml:"InstanceID" json:"instanceID"`

	ResourceType      *CIMResourceType `xml:"ResourceType" json:"resourceType,omitempty"`
	OtherResourceType *string          `xml:"OtherResourceType" json:"otherResourceType,omitempty"`
	ResourceSubType   *string          `xml:"ResourceSubType" json:"resourceSubType,omitempty"`

	Access                       *uint16         `xml:"Access" json:"access,omitempty"`
	Address                      *string         `xml:"Address" json:"address,omitempty"`
	AddressOnParent              *string         `xml:"AddressOnParent" json:"addressOnParent,omitempty"`
	AllocationUnits              *string         `xml:"AllocationUnits" json:"allocationUnits,omitempty"`
	AutomaticAllocation          *bool           `xml:"AutomaticAllocation" json:"automaticAllocation,omitempty"`
	AutomaticDeallocation        *bool           `xml:"AutomaticDeallocation" json:"automaticDeallocation,omitempty"`
	Caption                      *string         `xml:"Caption" json:"caption,omitempty"`
	ChangeableType               *uint16         `xml:"ChangeableType" json:"changeableType,omitempty"`
	ComponentSetting             []types.AnyType `xml:"ComponentSetting" json:"componentSetting,omitempty"`
	ConfigurationName            *string         `xml:"ConfigurationName" json:"configurationName,omitempty"`
	Connection                   []string        `xml:"Connection" json:"connection,omitempty"`
	ConsumerVisibility           *uint16         `xml:"ConsumerVisibility" json:"consumerVisibility,omitempty"`
	Description                  *string         `xml:"Description" json:"description,omitempty"`
	Generation                   *uint64         `xml:"Generation" json:"generation,omitempty"`
	HostExtentName               *string         `xml:"HostExtentName" json:"hostExtentName,omitempty"`
	HostExtentNameFormat         *uint16         `xml:"HostExtentNameFormat" json:"hostExtentNameFormat,omitempty"`
	HostExtentNameNamespace      *uint16         `xml:"HostExtentNameNamespace" json:"hostExtentNameNamespace,omitempty"`
	HostExtentStartingAddress    *uint64         `xml:"HostExtentStartingAddress" json:"hostExtentStartingAddress,omitempty"`
	HostResource                 []string        `xml:"HostResource" json:"hostResource,omitempty"`
	HostResourceBlockSize        *uint64         `xml:"HostResourceBlockSize" json:"hostResourceBlockSize,omitempty"`
	Limit                        *uint64         `xml:"Limit" json:"limit,omitempty"`
	MappingBehavior              *uint           `xml:"MappingBehavior" json:"mappingBehavior,omitempty"`
	OtherHostExtentNameFormat    *string         `xml:"OtherHostExtentNameFormat" json:"otherHostExtentNameFormat,omitempty"`
	OtherHostExtentNameNamespace *string         `xml:"OtherHostExtentNameNamespace" json:"otherHostExtentNameNamespace,omitempty"`
	Parent                       *string         `xml:"Parent" json:"parent,omitempty"`
	PoolID                       *string         `xml:"PoolID" json:"poolID,omitempty"`
	Reservation                  *uint64         `xml:"Reservation" json:"reservation,omitempty"`
	SoID                         *string         `xml:"SoID" json:"soID,omitempty"`
	SoOrgID                      *string         `xml:"SoOrgID" json:"soOrgID,omitempty"`
	VirtualQuantity              *uint           `xml:"VirtualQuantity" json:"virtualQuantity,omitempty"`
	VirtualQuantityUnits         *string         `xml:"VirtualQuantityUnits" json:"virtualQuantityUnits,omitempty"`
	VirtualResourceBlockSize     *uint64         `xml:"VirtualResourceBlockSize" json:"virtualResourceBlockSize,omitempty"`
	Weight                       *uint           `xml:"Weight" json:"weight,omitempty"`
}

Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_StorageAllocationSettingData.xsd

type CIMVirtualSystemSettingData

type CIMVirtualSystemSettingData struct {
	ElementName string `xml:"ElementName" json:"elementName"`
	InstanceID  string `xml:"InstanceID" json:"instanceID"`

	AutomaticRecoveryAction              *uint8   `xml:"AutomaticRecoveryAction" json:"automaticRecoveryAction,omitempty"`
	AutomaticShutdownAction              *uint8   `xml:"AutomaticShutdownAction" json:"automaticShutdownAction,omitempty"`
	AutomaticStartupAction               *uint8   `xml:"AutomaticStartupAction" json:"automaticStartupAction,omitempty"`
	AutomaticStartupActionDelay          *string  `xml:"AutomaticStartupActionDelay>Interval" json:"automaticStartupActionDelay,omitempty"`
	AutomaticStartupActionSequenceNumber *uint16  `xml:"AutomaticStartupActionSequenceNumber" json:"automaticStartupActionSequenceNumber,omitempty"`
	Caption                              *string  `xml:"Caption" json:"caption,omitempty"`
	ConfigurationDataRoot                *string  `xml:"ConfigurationDataRoot" json:"configurationDataRoot,omitempty"`
	ConfigurationFile                    *string  `xml:"ConfigurationFile" json:"configurationFile,omitempty"`
	ConfigurationID                      *string  `xml:"ConfigurationID" json:"configurationID,omitempty"`
	CreationTime                         *string  `xml:"CreationTime" json:"creationTime,omitempty"`
	Description                          *string  `xml:"Description" json:"description,omitempty"`
	LogDataRoot                          *string  `xml:"LogDataRoot" json:"logDataRoot,omitempty"`
	Notes                                []string `xml:"Notes" json:"notes,omitempty"`
	RecoveryFile                         *string  `xml:"RecoveryFile" json:"recoveryFile,omitempty"`
	SnapshotDataRoot                     *string  `xml:"SnapshotDataRoot" json:"snapshotDataRoot,omitempty"`
	SuspendDataRoot                      *string  `xml:"SuspendDataRoot" json:"suspendDataRoot,omitempty"`
	SwapFileDataRoot                     *string  `xml:"SwapFileDataRoot" json:"swapFileDataRoot,omitempty"`
	VirtualSystemIdentifier              *string  `xml:"VirtualSystemIdentifier" json:"virtualSystemIdentifier,omitempty"`
	VirtualSystemType                    *string  `xml:"VirtualSystemType" json:"virtualSystemType,omitempty"`
}

type Config added in v0.24.1

type Config struct {
	Required *bool  `xml:"required,attr" json:"required,omitempty"`
	Key      string `xml:"key,attr" json:"key,omitempty"`
	Value    string `xml:"value,attr" json:"value,omitempty"`
}

type Content

type Content struct {
	ID   string  `xml:"id,attr" json:"id,omitempty"`
	Info string  `xml:"Info" json:"info,omitempty"`
	Name *string `xml:"Name" json:"name,omitempty"`
}

type CoresPerSocket added in v0.47.0

type CoresPerSocket struct {
	Required *bool `xml:"required,attr" json:"required,omitempty"`
	Value    int32 `xml:",chardata" json:"value,omitempty"`
}

type DeploymentOptionConfiguration

type DeploymentOptionConfiguration struct {
	ID      string `xml:"id,attr" json:"id"`
	Default *bool  `xml:"default,attr" json:"default,omitempty"`

	Label       string `xml:"Label" json:"label,omitempty"`
	Description string `xml:"Description" json:"description,omitempty"`
}

type DeploymentOptionSection

type DeploymentOptionSection struct {
	Section

	Configuration []DeploymentOptionConfiguration `xml:"Configuration" json:"configuration,omitempty"`
}

type DiskSection

type DiskSection struct {
	Section

	Disks []VirtualDiskDesc `xml:"Disk" json:"disk,omitempty"`
}

type Env

type Env struct {
	XMLName xml.Name `xml:"http://schemas.dmtf.org/ovf/environment/1 Environment" json:"xmlName"`
	ID      string   `xml:"id,attr" json:"id"`
	EsxID   string   `xml:"http://www.vmware.com/schema/ovfenv esxId,attr" json:"esxID"`

	Platform *PlatformSection `xml:"PlatformSection" json:"platformSection,omitempty"`
	Property *PropertySection `xml:"PropertySection" json:"propertySection,omitempty"`
}

func (Env) Marshal added in v0.3.0

func (e Env) Marshal() (string, error)

Marshal marshals Env to xml by using xml.Marshal.

func (Env) MarshalManual added in v0.3.0

func (e Env) MarshalManual() string

MarshalManual manually marshals Env to xml suitable for a vApp guest. It exists to overcome the lack of expressiveness in Go's XML namespaces.

type EnvProperty

type EnvProperty struct {
	Key   string `xml:"key,attr" json:"key"`
	Value string `xml:"value,attr" json:"value,omitempty"`
}

type Envelope

type Envelope struct {
	References []File `xml:"References>File" json:"references,omitempty"`

	// Package level meta-data
	Disk             *DiskSection             `xml:"DiskSection,omitempty" json:"diskSection,omitempty"`
	Network          *NetworkSection          `xml:"NetworkSection,omitempty" json:"networkSection,omitempty"`
	DeploymentOption *DeploymentOptionSection `xml:"DeploymentOptionSection,omitempty" json:"deploymentOptionSection,omitempty"`

	// Content: A VirtualSystem or a VirtualSystemCollection
	VirtualSystem           *VirtualSystem           `xml:"VirtualSystem,omitempty" json:"virtualSystem,omitempty"`
	VirtualSystemCollection *VirtualSystemCollection `xml:"VirtualSystemCollection,omitempty" json:"virtualSystemCollection,omitempty"`
}

Envelope is defined according to https://www.dmtf.org/sites/default/files/standards/documents/DSP0243_2.1.1.pdf.

Section 9 describes the parent/child relationships.

A VirtualSystem may have zero or more VirtualHardware sections.

func Unmarshal

func Unmarshal(r io.Reader) (*Envelope, error)

func (Envelope) ToConfigSpec added in v0.47.0

func (e Envelope) ToConfigSpec() (types.VirtualMachineConfigSpec, error)

ToConfigSpec calls ToConfigSpecWithOptions with an empty ToConfigSpecOptions object.

func (Envelope) ToConfigSpecWithOptions added in v0.47.0

func (e Envelope) ToConfigSpecWithOptions(
	opts ToConfigSpecOptions) (types.VirtualMachineConfigSpec, error)

ToConfigSpecWithOptions transforms the envelope into a ConfigSpec that may be used to create a new virtual machine. Please note, at this time:

  • Only a single VirtualSystem is supported. The VirtualSystemCollection section is ignored.
  • Only the first VirtualHardware section is supported.
  • Only the default deployment option configuration is considered. Elements part of a non-default configuration are ignored.
  • Disks must specify zero or one HostResource elements.
  • Many, many more constraints...

func (*Envelope) Write added in v0.47.0

func (e *Envelope) Write(w io.Writer) error

Write satisfies the flags.OutputWriter interface.

type ErrUnsupportedItem added in v0.47.0

type ErrUnsupportedItem struct {
	Name             string
	Index            int
	InstanceID       string
	ResourceType     CIMResourceType
	ResourceSubType  string
	LocalizedMessage string
}

ErrUnsupportedItem is returned by Envelope.ToConfigSpec when there is an invalid item configuration.

func AsErrUnsupportedItem added in v0.47.0

func AsErrUnsupportedItem(in error) (ErrUnsupportedItem, bool)

AsErrUnsupportedItem returns any possible wrapped ErrUnsupportedItem error from the provided error.

func (ErrUnsupportedItem) Error added in v0.47.0

func (e ErrUnsupportedItem) Error() string

type EulaSection

type EulaSection struct {
	Section

	License string `xml:"License" json:"license,omitempty"`
}

type File

type File struct {
	ID          string  `xml:"id,attr" json:"id,omitempty"`
	Href        string  `xml:"href,attr" json:"href,omitempty"`
	Size        uint    `xml:"size,attr" json:"size,omitempty"`
	Compression *string `xml:"compression,attr" json:"compression,omitempty"`
	ChunkSize   *int    `xml:"chunkSize,attr" json:"chunkSize,omitempty"`
}

type Manager added in v0.16.0

type Manager struct {
	types.ManagedObjectReference
	// contains filtered or unexported fields
}

func NewManager added in v0.16.0

func NewManager(c *vim25.Client) *Manager

func (*Manager) CreateDescriptor added in v0.16.0

CreateDescriptor wraps methods.CreateDescriptor

func (*Manager) CreateImportSpec added in v0.16.0

func (m *Manager) CreateImportSpec(ctx context.Context, ovfDescriptor string, resourcePool mo.Reference, datastore mo.Reference, cisp types.BaseOvfCreateImportSpecParams) (*types.OvfCreateImportSpecResult, error)

CreateImportSpec wraps methods.CreateImportSpec

func (*Manager) ParseDescriptor added in v0.16.0

func (m *Manager) ParseDescriptor(ctx context.Context, ovfDescriptor string, pdp types.OvfParseDescriptorParams) (*types.OvfParseDescriptorResult, error)

ParseDescriptor wraps methods.ParseDescriptor

func (*Manager) ValidateHost added in v0.16.0

func (m *Manager) ValidateHost(ctx context.Context, ovfDescriptor string, host mo.Reference, vhp types.OvfValidateHostParams) (*types.OvfValidateHostResult, error)

ValidateHost wraps methods.ValidateHost

type Network

type Network struct {
	Name string `xml:"name,attr" json:"name,omitempty"`

	Description string `xml:"Description" json:"description,omitempty"`
}

type NetworkSection

type NetworkSection struct {
	Section

	Networks []Network `xml:"Network" json:"network,omitempty"`
}

type OperatingSystemSection

type OperatingSystemSection struct {
	Section

	ID      int16   `xml:"id,attr" json:"id"`
	Version *string `xml:"version,attr" json:"version,omitempty"`
	OSType  *string `xml:"osType,attr" json:"osType,omitempty"`

	Description *string `xml:"Description" json:"description,omitempty"`
}

type PlatformSection

type PlatformSection struct {
	Kind    string `xml:"Kind" json:"kind,omitempty"`
	Version string `xml:"Version" json:"version,omitempty"`
	Vendor  string `xml:"Vendor" json:"vendor,omitempty"`
	Locale  string `xml:"Locale" json:"locale,omitempty"`
}

type ProductSection

type ProductSection struct {
	Section

	Class    *string `xml:"class,attr" json:"class,omitempty"`
	Instance *string `xml:"instance,attr" json:"instance,omitempty"`

	Product     string     `xml:"Product" json:"product,omitempty"`
	Vendor      string     `xml:"Vendor" json:"vendor,omitempty"`
	Version     string     `xml:"Version" json:"version,omitempty"`
	FullVersion string     `xml:"FullVersion" json:"fullVersion,omitempty"`
	ProductURL  string     `xml:"ProductUrl" json:"productUrl,omitempty"`
	VendorURL   string     `xml:"VendorUrl" json:"vendorUrl,omitempty"`
	AppURL      string     `xml:"AppUrl" json:"appUrl,omitempty"`
	Property    []Property `xml:"Property" json:"property,omitempty"`
}

func (ProductSection) Key added in v0.33.0

func (p ProductSection) Key(prop Property) string

type Property

type Property struct {
	Key              string  `xml:"key,attr" json:"key,omitempty"`
	Type             string  `xml:"type,attr" json:"type,omitempty"`
	Qualifiers       *string `xml:"qualifiers,attr" json:"qualifiers,omitempty"`
	UserConfigurable *bool   `xml:"userConfigurable,attr" json:"userConfigurable,omitempty"`
	Default          *string `xml:"value,attr" json:"default,omitempty"`
	Password         *bool   `xml:"password,attr" json:"password,omitempty"`
	Configuration    *string `xml:"configuration,attr" json:"configuration,omitempty"`

	Label       *string `xml:"Label" json:"label,omitempty"`
	Description *string `xml:"Description" json:"description,omitempty"`

	Values []PropertyConfigurationValue `xml:"Value" json:"value,omitempty"`
}

type PropertyConfigurationValue

type PropertyConfigurationValue struct {
	Value         string  `xml:"value,attr" json:"value,omitempty"`
	Configuration *string `xml:"configuration,attr" json:"configuration,omitempty"`
}

type PropertySection

type PropertySection struct {
	Properties []EnvProperty `xml:"Property" json:"property,omitempty"`
}

type ResourceAllocationSection

type ResourceAllocationSection struct {
	Section

	Item []ResourceAllocationSettingData `xml:"Item" json:"item,omitempty"`
}

type ResourceAllocationSettingData

type ResourceAllocationSettingData struct {
	CIMResourceAllocationSettingData

	Required       *bool           `xml:"required,attr" json:"required,omitempty"`
	Configuration  *string         `xml:"configuration,attr" json:"configuration,omitempty"`
	Bound          *string         `xml:"bound,attr" json:"bound,omitempty"`
	Config         []Config        `xml:"Config" json:"config,omitempty"`
	CoresPerSocket *CoresPerSocket `xml:"CoresPerSocket" json:"coresPerSocket,omitempty"`
}

type Section

type Section struct {
	Required *bool  `xml:"required,attr" json:"required,omitempty"`
	Info     string `xml:"Info" json:"info,omitempty"`
	Category string `xml:"Category" json:"category,omitempty"`
}

type StorageAllocationSettingData added in v0.22.0

type StorageAllocationSettingData struct {
	CIMStorageAllocationSettingData

	Required      *bool   `xml:"required,attr" json:"required,omitempty"`
	Configuration *string `xml:"configuration,attr" json:"configuration,omitempty"`
	Bound         *string `xml:"bound,attr" json:"bound,omitempty"`
}

type ToConfigSpecOptions added in v0.47.0

type ToConfigSpecOptions struct {

	// Strict indicates that an error should be returned on Item elements in
	// a VirtualHardware section that have an unknown ResourceType, i.e. a value
	// that falls outside the range of the enum CIMResourceType.
	Strict bool

	// VirtualSystemCollectionIndex specifies the index of the VirtualSystem in
	// the OVF's VirtualSystemCollection to transform into the ConfigSpec.
	VirtualSystemCollectionIndex *int
}

ToConfigSpecOptions influence the behavior of the ToConfigSpecWithOptions function.

type VirtualDiskDesc

type VirtualDiskDesc struct {
	DiskID                  string  `xml:"diskId,attr" json:"diskId,omitempty"`
	FileRef                 *string `xml:"fileRef,attr" json:"fileRef,omitempty"`
	Capacity                string  `xml:"capacity,attr" json:"capacity,omitempty"`
	CapacityAllocationUnits *string `xml:"capacityAllocationUnits,attr" json:"capacityAllocationUnits,omitempty"`
	Format                  *string `xml:"format,attr" json:"format,omitempty"`
	PopulatedSize           *int    `xml:"populatedSize,attr" json:"populatedSize,omitempty"`
	ParentRef               *string `xml:"parentRef,attr" json:"parentRef,omitempty"`
}

type VirtualHardwareSection

type VirtualHardwareSection struct {
	Section

	ID        *string `xml:"id,attr" json:"id"`
	Transport *string `xml:"transport,attr" json:"transport,omitempty"`

	System      *VirtualSystemSettingData       `xml:"System" json:"system,omitempty"`
	Item        []ResourceAllocationSettingData `xml:"Item" json:"item,omitempty"`
	StorageItem []StorageAllocationSettingData  `xml:"StorageItem" json:"storageItem,omitempty"`
	Config      []Config                        `xml:"Config" json:"config,omitempty"`
	ExtraConfig []Config                        `xml:"ExtraConfig" json:"extraConfig,omitempty"`
}

type VirtualSystem

type VirtualSystem struct {
	Content

	Annotation      *AnnotationSection       `xml:"AnnotationSection,omitempty" json:"annotationSection,omitempty"`
	Product         []ProductSection         `xml:"ProductSection,omitempty" json:"productSection,omitempty"`
	Eula            []EulaSection            `xml:"EulaSection,omitempty" json:"eulaSection,omitempty"`
	OperatingSystem *OperatingSystemSection  `xml:"OperatingSystemSection,omitempty" json:"operatingSystemSection,omitempty"`
	VirtualHardware []VirtualHardwareSection `xml:"VirtualHardwareSection,omitempty" json:"virtualHardwareSection,omitempty"`
}

type VirtualSystemCollection added in v0.47.0

type VirtualSystemCollection struct {
	Content

	// Collection level meta-data
	ResourceAllocation *ResourceAllocationSection `xml:"ResourceAllocationSection,omitempty" json:"resourceAllocationSection,omitempty"`
	Annotation         *AnnotationSection         `xml:"AnnotationSection,omitempty" json:"annotationSection,omitempty"`
	Product            []ProductSection           `xml:"ProductSection,omitempty" json:"productSection,omitempty"`
	Eula               []EulaSection              `xml:"EulaSection,omitempty" json:"eulaSection,omitempty"`

	// Content: One or more VirtualSystems
	VirtualSystem []VirtualSystem `xml:"VirtualSystem,omitempty" json:"virtualSystem,omitempty"`
}

type VirtualSystemSettingData

type VirtualSystemSettingData struct {
	CIMVirtualSystemSettingData
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL