vmwareify

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: MIT Imports: 7 Imported by: 1

README

vmwareify

What is it?

A Go library and application for creating VMWare friendly OVF files.

Use cases

This library makes it possible to create virtual appliances for VirtualBox and VMWare a single OVF configuration.

For example, the packer automation tool can create VirtualBox and VMWare virtual machine appliances. However, this requires building the same VM twice; once for VirtualBox, and a second time for VMWare. Rather than build the same machine twice, this library allows us to build the VM once (for VirtualBox), and then convert the VirtualBox OVF into a VMWare friendly copy.

Additionally, while certain VMWare tools are agnostic to the VirtualBox OVF parameters, not all are. Most notably, vSphere will reject VirtualBox OVFs. This library allows us to take an existing VirtualBox OVF, and use it with the more restrictive tools like vSphere.

API

The library provides several public functions for converting an OVF to a VMWare friendly copy. The most notable is the BasicConvert function, which converts an existing OVF into a VMWare friendly file. Here is an example application:

package main

import (
    "log"

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

func main() {
    err := vmwareify.BasicConvert("/some.ovf", "/some-vmware.ovf")
    if err != nil {
        log.Fatal("Failed to convert .ovf file - " + err.Error())
    }
}

Application usage

The included application can convert an existing OVF file into a VMWare friendly one like so:

go run cmd/vmwareify/main.go -f /some.ovf
# Creates '/some-vmware.ovf'.

Optionally, you can specify the output file using -o:

go run cmd/vmwareify/main.go -f /some.ovf -o /my-awesome-vmware.ovf

Documentation

Overview

Package vmwareify provides functionality for converting non-VMWare .ovf files (i.e., files generated by VirtualBox) to VMWare-compatible .ovf files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicConvert

func BasicConvert(ovfFilePath string, newFilePath string) error

BasicConvert converts a non-VMWare .ovf file to a VMWare friendly .ovf file. It does the following:

  • Removes any IDE controllers
  • Converts any existing SATA controllers to the VMWare kind
  • Set the VMWare compatibility level to vmx-10
  • Disables automatic allocation of CD/DVD drives

func ConvertSataControllersFunc

func ConvertSataControllersFunc() ovf.EditObjectFunc

ConvertSataControllersFunc returns an ovf.EditObjectFunc that will convert an existing SATA controller to a VMWare friendly SATA controller.

func DisableCdromAutomaticAllocationFunc added in v0.1.0

func DisableCdromAutomaticAllocationFunc() ovf.EditObjectFunc

DisableCdromAutomaticAllocationFunc returns an ovf.EditObjectFunc that will disable AutomaticAllocation for OVF ResourceType 15 devices.

func RemoveIdeControllersFunc

func RemoveIdeControllersFunc(limit int) ovf.EditObjectFunc

RemoveIdeControllersFunc returns an ovf.EditObjectFunc that will remove the specified number of IDE controllers.

func SetVirtualSystemTypeFunc

func SetVirtualSystemTypeFunc(systemType string) ovf.EditObjectFunc

SetVirtualSystemTypeFunc returns an ovf.EditObjectFunc that will set the .ovf's VirtualSystemType to the specified value.

Types

This section is empty.

Directories

Path Synopsis
cmd
internal
xmlutil
Package xmlutil provides helpful XML function extensions.
Package xmlutil provides helpful XML function extensions.
Package ovf provides extremely basic functionality for parsing and modifying .ovf files.
Package ovf provides extremely basic functionality for parsing and modifying .ovf files.

Jump to

Keyboard shortcuts

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