vspherejanitor

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: MIT Imports: 8 Imported by: 0

README

vSphere Janitor

A little tool used for cleaning up leftover ("stale") VMs in vSphere.

configuration

Example configuration is available in the example.env file.

running via upstart

Check out the example upstart conf.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Janitor

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

func NewJanitor

func NewJanitor(vmLister VMLister, opts *JanitorOpts) *Janitor

func (*Janitor) Cleanup

func (j *Janitor) Cleanup(ctx context.Context, path string, now time.Time) error

type JanitorOpts

type JanitorOpts struct {
	Cutoff           time.Duration
	ZeroUptimeCutoff time.Duration
	SkipDestroy      bool
	Concurrency      int
	RatePerSecond    int
	SkipNoBootTime   bool
}

type VMLister

type VMLister interface {
	ListVMs(ctx context.Context, path string) ([]VirtualMachine, error)
}

type VirtualMachine

type VirtualMachine interface {
	Name() string
	ID() string
	Uptime() time.Duration
	BootTime() *time.Time
	PoweredOn() bool
	PowerOff(context.Context) error
	Destroy(context.Context) error
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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