vmware

package
v1.9.11 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributedPortgroupData

type DistributedPortgroupData struct {
	Name         string
	VlanIDs      []int
	VlanIDRanges []string
	Private      bool
	Tenant       *objects.Tenant
}

type HostPortgroupData

type HostPortgroupData struct {
	// contains filtered or unexported fields
}

type HostProxySwitchData

type HostProxySwitchData struct {
	// contains filtered or unexported fields
}

type HostVirtualSwitchData

type HostVirtualSwitchData struct {
	// contains filtered or unexported fields
}

type NetworkData

type NetworkData struct {
	// DistributedVirtualPortgroups: Portgroup.key -> PortgroupData
	DistributedVirtualPortgroups map[string]*DistributedPortgroupData
	// Vid2Name is a Helper map, for quickly obtaining name of the vid
	Vid2Name map[int]string
	// HostVirtualSwitches: hostName -> VSwitchName-> VSwitchData
	HostVirtualSwitches map[string]map[string]*HostVirtualSwitchData
	// HostProxySwitches: hostName -> PSwitchName -> HostProxySwitchData
	HostProxySwitches map[string]map[string]*HostProxySwitchData
	// HostPortgroups: hostname -> Portgroup.Spec.Name -> HostPortgroupData
	HostPortgroups map[string]map[string]*HostPortgroupData
}

type VmwareSource

type VmwareSource struct {
	common.Config
	// Vmware API data initialized in init functions
	Disks       map[string]mo.Datastore
	DataCenters map[string]mo.Datacenter
	Clusters    map[string]mo.ClusterComputeResource
	Hosts       map[string]mo.HostSystem
	Vms         map[string]mo.VirtualMachine
	Networks    NetworkData

	// Relations between objects "object_id": "object_id"
	Cluster2Datacenter map[string]string // ClusterKey -> DatacenterKey
	Host2Cluster       map[string]string // HostKey -> ClusterKey
	VM2Host            map[string]string // VmKey ->  HostKey

	// CustomField2Name is a map of custom field ids to their names
	CustomFieldID2Name map[int32]string
	// Object2Tags is a map of object ids to their tags
	Object2Tags   map[string][]*tags.Tag
	Object2NBTags map[string][]*objects.Tag // Created in sync function
}

VmwareSource represents an vsphere source.

func (*VmwareSource) CreateClusterDataCenterRelation

func (vc *VmwareSource) CreateClusterDataCenterRelation(
	ctx context.Context,
	client *vim25.Client,
) error

Currently we have to traverse the vsphere tree to get datacenter to cluster relation For other objects relations are available in with containerView.

func (*VmwareSource) CreateCustomFieldRelation

func (vc *VmwareSource) CreateCustomFieldRelation(ctx context.Context, client *vim25.Client) error

Creates a map of custom field ids to their names.

func (*VmwareSource) CreateObjectTagsRelation added in v1.8.12

func (vc *VmwareSource) CreateObjectTagsRelation(
	ctx context.Context,
	vim25client *vim25.Client,
	userInfo *url.Userinfo,
) error

Creates a map of object ids to their tags. This uses the rest api since tags are not available in the containerView (see https://github.com/vmware/govmomi/issues/1825).

func (*VmwareSource) Init

func (vc *VmwareSource) Init() error

func (*VmwareSource) Sync

Function that syncs all data from oVirt to Netbox.

Jump to

Keyboard shortcuts

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