ovirt

package
v0.0.0-...-b5d9bff Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderID = "ganto.ovirt"

BuilderID defines the unique id for the builder.

Variables

This section is empty.

Functions

func WaitForState

func WaitForState(conf *StateChangeConf) (i interface{}, err error)

WaitForState watches an object and waits for it to achieve a certain state.

Types

type AccessConfig

type AccessConfig struct {
	OvirtURLRaw        string `mapstructure:"ovirt_url"`
	OvirtURL           *url.URL
	SkipCertValidation bool   `mapstructure:"insecure_skip_tls_verify"`
	Username           string `mapstructure:"username"`
	Password           string `mapstructure:"password"`
}

AccessConfig contains the oVirt API access and authentication configuration

func (*AccessConfig) Prepare

func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error

Prepare performs basic validation on the AccessConfig

type Artifact

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

Artifact is an artifact implementation that contains built disk.

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

BuilderId uniquely identifies the builder.

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

Destroy deletes the custom image associated with the artifact.

func (*Artifact) Files

func (*Artifact) Files() []string

Files returns the files represented by the artifact. Not used for oVirt.

func (*Artifact) Id

func (a *Artifact) Id() string

Id returns the disk identifier of the artifact.

func (*Artifact) State

func (a *Artifact) State(name string) interface{}

State returns specific details from the artifact. Not used for oVirt.

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

Builder is a builder implementation that creates oVirt custom images.

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) ([]string, error)

Prepare processes the build configuration parameters.

func (*Builder) Run

func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error)

Run is the main function executing the image build.

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`

	AccessConfig `mapstructure:",squash"`
	SourceConfig `mapstructure:",squash"`

	Comm communicator.Config `mapstructure:",squash"`

	VMName    string `mapstructure:"vm_name"`
	IPAddress string `mapstructure:"address"`
	Netmask   string `mapstructure:"netmask"`
	Gateway   string `mapstructure:"gateway"`

	DiskName        string `mapstructure:"disk_name"`
	DiskDescription string `mapstructure:"disk_description"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(raws ...interface{}) (*Config, []string, error)

type SourceConfig

type SourceConfig struct {
	Cluster string `mapstructure:"cluster"`

	SourceType string `mapstructure:"source_type"`

	SourceTemplateName    string `mapstructure:"source_template_name"`
	SourceTemplateVersion int    `mapstructure:"source_template_version"`
	SourceTemplateID      string `mapstructure:"source_template_id"`
}

SourceConfig contains the various source properties for an oVirt image

func (*SourceConfig) Prepare

func (c *SourceConfig) Prepare(ctx *interpolate.Context) []error

Prepare performs basic validation on the SourceConfig

type StateChangeConf

type StateChangeConf struct {
	Pending   []string
	Refresh   StateRefreshFunc
	StepState multistep.StateBag
	Target    []string
}

StateChangeConf is the configuration struct used for `WaitForState`.

type StateRefreshFunc

type StateRefreshFunc func() (result interface{}, state string, err error)

StateRefreshFunc is a function type used for StateChangeConf that is responsible for refreshing the item being watched for a state change.

It returns three results: `result` is any object that will be returned as the final object after waiting for state change. This allows you to return the final updated object. `state` is the latest state of that object. `err` is any error that may have happened while refreshing the state.

func DiskAttachmentStateRefreshFunc

func DiskAttachmentStateRefreshFunc(
	conn *ovirtsdk4.Connection, vmID string, diskID string) StateRefreshFunc

DiskAttachmentStateRefreshFunc returns a StateRefreshFunc that is used to watch a oVirt disk attachment.

func DiskStateRefreshFunc

func DiskStateRefreshFunc(
	conn *ovirtsdk4.Connection, diskID string) StateRefreshFunc

DiskStateRefreshFunc returns a StateRefreshFunc that is used to watch a oVirt disk.

func VMStateRefreshFunc

func VMStateRefreshFunc(
	conn *ovirtsdk4.Connection, vmID string) StateRefreshFunc

VMStateRefreshFunc returns a StateRefreshFunc that is used to watch a oVirt virtual machine.

Jump to

Keyboard shortcuts

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