vmware

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 19 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 map[string]*DistributedPortgroupData         // Portgroup.key -> PortgroupData
	Vid2Name                     map[int]string                               // Helper map, for quickly obtaining name of the vid
	HostVirtualSwitches          map[string]map[string]*HostVirtualSwitchData // hostName -> VSwitchName-> VSwitchData
	HostProxySwitches            map[string]map[string]*HostProxySwitchData   // hostName -> PSwitchName ->
	HostPortgroups               map[string]map[string]*HostPortgroupData     // hostname -> Portgroup.Spec.Name -> 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

	// Netbox relations
	DatacenterClusterGroupRelations map[string]string
	ClusterSiteRelations            map[string]string
	ClusterTenantRelations          map[string]string
	HostTenantRelations             map[string]string
	HostSiteRelations               map[string]string
	VMTenantRelations               map[string]string
	VlanGroupRelations              map[string]string
	VlanTenantRelations             map[string]string

	// Mappings of custom fields to contacts
	CustomFieldMappings map[string]string
}

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) Init

func (vc *VmwareSource) Init() error

func (*VmwareSource) InitClusters

func (vc *VmwareSource) InitClusters(ctx context.Context, containerView *view.ContainerView) error

func (*VmwareSource) InitDataCenters

func (vc *VmwareSource) InitDataCenters(ctx context.Context, containerView *view.ContainerView) error

func (*VmwareSource) InitDisks

func (vc *VmwareSource) InitDisks(ctx context.Context, containerView *view.ContainerView) error

func (*VmwareSource) InitHosts

func (vc *VmwareSource) InitHosts(ctx context.Context, containerView *view.ContainerView) error

func (*VmwareSource) InitNetworks

func (vc *VmwareSource) InitNetworks(ctx context.Context, containerView *view.ContainerView) error

In vsphere we get vlans from DistributedVirtualPortgroups.

func (*VmwareSource) InitVms

func (vc *VmwareSource) InitVms(ctx context.Context, containerView *view.ContainerView) 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