ovaify

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: MIT Imports: 5 Imported by: 1

README

ovaify

What is it?

A Go library for creating OVA (Open Virtual Appliance) files.

Use cases

This library was developed to simplify the virtual machine deployment supply chain. It enables the creation of OVA (Open Virtual Appliance) files from an existing OVF (Open Virtualization Format) file and its associated artifacts (such as a virtual machine disk image).

An OVF only provides the configuration for a virtual machine appliance - it does not provide the appliance's disk, or other files. A OVA on the other hand provides all of these in the form of a single compressed file. Using OVAs makes deploying new appliances easier, and more maintainable.

While open source tools like packer and VirtualBox can create these files, they cannot easily create OVA files from existing OVFs. This is usually worked around using VMWare's ovftool. Because ovftool is closed source, incorporating it into a VM development toolchain can be a logistical headache. This library allows developers to incorporate ovftool's functionality into their toolchain without such headaches.

API

The library's API is very small. The most notable function is the CreateOvaFile function. This function creats an OVA using the provided OvaConfig. Here is an example application that uses this function:

package main

import (
    "log"

    "github.com/stephen-fox/ovaify"
)

func main() {
    config := ovaify.OvaConfig{
        OvfFilePath:        "/my-vm.ovf",
		FilePathsToInclude: []string{
            "/my-vm-disk-image.vmdk",
            "/my-awesome.ova",
        },
    }

    err := ovaify.CreateOvaFile(config)
    if err != nil {
        log.Fatal("Failed to create OVA - " + err.Error())
    }
}

Documentation

Overview

Package ovaify provides functionality for creating Open Virtual Appliances (OVAs).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFileIntoOva

func CopyFileIntoOva(filePath string, ova *tar.Writer) error

CopyFileIntoOva copies the specified file into a .ova.

Based on work by Daniel "thebsdbox" Finneran: https://github.com/thebsdbox/gova

func CreateOvaFile

func CreateOvaFile(config OvaConfig) error

CreateOvaFile creates an OVA file using the specified OvaConfig.

Based on work by Daniel "thebsdbox" Finneran: https://github.com/thebsdbox/gova

Types

type OvaConfig

type OvaConfig struct {
	// OvfFilePath is the OVF file to include in the OVA.
	OvfFilePath string

	// FilePathsToInclude are the paths to the files to included
	// in the OVA.
	FilePathsToInclude []string

	// OutputFileMode specifies the mode for the resulting
	// OVA file. If it is not specified, then the OVF's mode
	// is used.
	OutputFileMode os.FileMode

	// OutputFilePath is the file path where the OVA will be saved.
	OutputFilePath string
}

OvaConfig provides a configuration for creating a .ova file.

func (*OvaConfig) Validate

func (o *OvaConfig) Validate() error

Validate returns a non-nil error if the configuration is invalid.

Jump to

Keyboard shortcuts

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