Documentation
¶
Overview ¶
Package vhd implements the packer.PostProcessor interface and adds a post-processor that produces a standalone VHD file.
Index ¶
Constants ¶
const BuilderId = "benwebber.post-processor.vhd"
A unique name for this post-processor.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
// Path is the path to the VHD file on disk.
Path string
// Provider represents the upstream source to the
Provider string
}
Artifact represents a Virtual Hard Disk (VHD) file.
func NewArtifact ¶
NewArtifact creates a new VHD artifact.
type Config ¶
type Config struct {
common.PackerConfig `mapstructure:",squash"`
// Where the VHD will be output to.
OutputPath string `mapstructure:"output"`
// Whether to keep the Provider artifact (e.g., VirtualBox VMDK).
KeepInputArtifact bool `mapstructure:"keep_input_artifict"`
// Whether to overwrite the VHD if it exists.
Force bool `mapstructure:"force"`
// contains filtered or unexported fields
}
Config contains the post-processor configuration.
type PostProcessor ¶
type PostProcessor struct {
// contains filtered or unexported fields
}
PostProcessor satisfies the packer.PostProcessor interface.
func (*PostProcessor) Configure ¶
func (p *PostProcessor) Configure(raws ...interface{}) error
Configure the PostProcessor, rendering templated values if necessary.
type Provider ¶ added in v0.2.0
type Provider interface {
// Name should return a simple lowercase identifier for the provider.
Name() string
// Execute runs a command using the Provider's Driver.
Execute(ui packer.Ui, command ...string) error
// Convert converts a builder artifact into a VHD located at outputPath.
Convert(ui packer.Ui, artifact packer.Artifact, outputPath string) error
// String satisfies the Stringer interface and will be used in log
// messages.
String() string
}
A Provider wraps logic necessary to convert specific builder artifacts to VHD.
type QEMUProvider ¶ added in v0.2.0
type QEMUProvider struct {
// contains filtered or unexported fields
}
QEMUProvider satisfies the Provider interface.
func NewQEMUProvider ¶ added in v0.2.1
func NewQEMUProvider() *QEMUProvider
func (*QEMUProvider) Execute ¶ added in v0.2.0
func (p *QEMUProvider) Execute(ui packer.Ui, command ...string) error
Execute wraps qemu-img to run a QEMU command.
func (*QEMUProvider) Name ¶ added in v0.2.1
func (p *QEMUProvider) Name() string
func (*QEMUProvider) String ¶ added in v0.2.0
func (p *QEMUProvider) String() string
type VirtualBoxProvider ¶ added in v0.2.0
type VirtualBoxProvider struct {
// contains filtered or unexported fields
}
VirtualBoxProvider satisfies the Provider interface.
func NewVirtualBoxProvider ¶ added in v0.2.1
func NewVirtualBoxProvider() *VirtualBoxProvider
func (*VirtualBoxProvider) Convert ¶ added in v0.2.0
func (p *VirtualBoxProvider) Convert(ui packer.Ui, artifact packer.Artifact, outputPath string) (err error)
Convert a VirtualBox VMDK artifact to a VHD file.
func (*VirtualBoxProvider) Execute ¶ added in v0.2.0
func (p *VirtualBoxProvider) Execute(ui packer.Ui, command ...string) error
Execute wraps VBoxManage to run a VirtualBox command.
func (*VirtualBoxProvider) Name ¶ added in v0.2.1
func (p *VirtualBoxProvider) Name() string
func (*VirtualBoxProvider) String ¶ added in v0.2.0
func (p *VirtualBoxProvider) String() string