Skip to content

Commit

Permalink
Add VirtualHardwareSection.StorageItem
Browse files Browse the repository at this point in the history
Within VirtualHardwareSection, we've noticed that some ovfs reference
disks using Item nodes, while others use StorageItem nodes. This
adds a definition for StorageItem nodes.

Fixes vmware#1606
  • Loading branch information
EricEdens committed Sep 13, 2019
1 parent 3dbba02 commit d84679e
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# changelog

### 0.22.0 (2019-09-13)

* Add VirtualHardwareSection.StorageItem

### 0.21.0 (2019-07-24)

* Add vsan package
Expand Down
2 changes: 1 addition & 1 deletion govc/flags/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"
)

const Version = "0.21.0"
const Version = "0.22.0"

var GitVersion string

Expand Down
50 changes: 50 additions & 0 deletions ovf/cim.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ limitations under the License.

package ovf

import (
"github.com/vmware/govmomi/vim25/types"
)

/*
Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_VirtualSystemSettingData.xsd
*/
Expand Down Expand Up @@ -76,3 +80,49 @@ type CIMResourceAllocationSettingData struct {
VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"`
Weight *uint `xml:"Weight"`
}

/*
Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_StorageAllocationSettingData.xsd
*/
type CIMStorageAllocationSettingData struct {
ElementName string `xml:"ElementName"`
InstanceID string `xml:"InstanceID"`

ResourceType *uint16 `xml:"ResourceType"`
OtherResourceType *string `xml:"OtherResourceType"`
ResourceSubType *string `xml:"ResourceSubType"`

Access *uint16 `xml:"Access"`
Address *string `xml:"Address"`
AddressOnParent *string `xml:"AddressOnParent"`
AllocationUnits *string `xml:"AllocationUnits"`
AutomaticAllocation *bool `xml:"AutomaticAllocation"`
AutomaticDeallocation *bool `xml:"AutomaticDeallocation"`
Caption *string `xml:"Caption"`
ChangeableType *uint16 `xml:"ChangeableType"`
ComponentSetting []types.AnyType `xml:"ComponentSetting"`
ConfigurationName *string `xml:"ConfigurationName"`
Connection []string `xml:"Connection"`
ConsumerVisibility *uint16 `xml:"ConsumerVisibility"`
Description *string `xml:"Description"`
Generation *uint64 `xml:"Generation"`
HostExtentName *string `xml:"HostExtentName"`
HostExtentNameFormat *uint16 `xml:"HostExtentNameFormat"`
HostExtentNameNamespace *uint16 `xml:"HostExtentNameNamespace"`
HostExtentStartingAddress *uint64 `xml:"HostExtentStartingAddress"`
HostResource []string `xml:"HostResource"`
HostResourceBlockSize *uint64 `xml:"HostResourceBlockSize"`
Limit *uint64 `xml:"Limit"`
MappingBehavior *uint `xml:"MappingBehavior"`
OtherHostExtentNameFormat *string `xml:"OtherHostExtentNameFormat"`
OtherHostExtentNameNamespace *string `xml:"OtherHostExtentNameNamespace"`
Parent *string `xml:"Parent"`
PoolID *string `xml:"PoolID"`
Reservation *uint64 `xml:"Reservation"`
SoID *string `xml:"SoID"`
SoOrgID *string `xml:"SoOrgID"`
VirtualQuantity *uint `xml:"VirtualQuantity"`
VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"`
VirtualResourceBlockSize *uint64 `xml:"VirtualResourceBlockSize"`
Weight *uint `xml:"Weight"`
}
13 changes: 11 additions & 2 deletions ovf/envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ type VirtualHardwareSection struct {
ID *string `xml:"id,attr"`
Transport *string `xml:"transport,attr"`

System *VirtualSystemSettingData `xml:"System"`
Item []ResourceAllocationSettingData `xml:"Item"`
System *VirtualSystemSettingData `xml:"System"`
Item []ResourceAllocationSettingData `xml:"Item"`
StorageItem []StorageAllocationSettingData `xml:"StorageItem"`
}

type VirtualSystemSettingData struct {
Expand All @@ -170,6 +171,14 @@ type ResourceAllocationSettingData struct {
Bound *string `xml:"bound,attr"`
}

type StorageAllocationSettingData struct {
CIMStorageAllocationSettingData

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

type ResourceAllocationSection struct {
Section

Expand Down

0 comments on commit d84679e

Please sign in to comment.