Documentation ¶
Index ¶
- Constants
- func Appendwarns(slice []string, data ...string) []string
- func CommHost(host string) func(multistep.StateBag) (string, error)
- func NewArtifact(dir string, generatedData map[string]interface{}) (packersdk.Artifact, error)
- func ParseBootDeviceIdentifier(deviceIdentifier string, generation uint) (string, uint, uint, error)
- type CommonConfig
- type Driver
- type DriverMock
- func (d *DriverMock) AddVirtualMachineHardDrive(vmName string, vhdFile string, vhdName string, vhdSizeBytes int64, ...) error
- func (d *DriverMock) CheckVMName(vmName string) error
- func (d *DriverMock) CloneVirtualMachine(cloneFromVmcxPath string, cloneFromVmName string, cloneFromSnapshotName string, ...) error
- func (d *DriverMock) CompactDisks(path string) (result string, err error)
- func (d *DriverMock) Connect(vmName string) (context.CancelFunc, error)
- func (d *DriverMock) ConnectVirtualMachineNetworkAdapterToSwitch(vmName string, switchName string) error
- func (d *DriverMock) CreateDvdDrive(vmName string, isoPath string, generation uint) (uint, uint, error)
- func (d *DriverMock) CreateExternalVirtualSwitch(vmName string, switchName string) error
- func (d *DriverMock) CreateVirtualMachine(vmName string, path string, harddrivePath string, ram int64, diskSize int64, ...) error
- func (d *DriverMock) CreateVirtualSwitch(switchName string, switchType string) (bool, error)
- func (d *DriverMock) DeleteDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error
- func (d *DriverMock) DeleteVirtualMachine(vmName string) error
- func (d *DriverMock) DeleteVirtualSwitch(switchName string) error
- func (d *DriverMock) Disconnect(cancel context.CancelFunc)
- func (d *DriverMock) EnableVirtualMachineIntegrationService(vmName string, integrationServiceName string) error
- func (d *DriverMock) ExportVirtualMachine(vmName string, path string) error
- func (d *DriverMock) GetHostAdapterIpAddressForSwitch(switchName string) (string, error)
- func (d *DriverMock) GetHostName(ip string) (string, error)
- func (d *DriverMock) GetVirtualMachineGeneration(vmName string) (uint, error)
- func (d *DriverMock) GetVirtualMachineNetworkAdapterAddress(vmName string) (string, error)
- func (d *DriverMock) GetVirtualMachineSwitchName(vmName string) (string, error)
- func (d *DriverMock) IpAddress(mac string) (string, error)
- func (d *DriverMock) IsOff(vmName string) (bool, error)
- func (d *DriverMock) IsRunning(vmName string) (bool, error)
- func (d *DriverMock) Mac(vmName string) (string, error)
- func (d *DriverMock) MountDvdDrive(vmName string, path string, controllerNumber uint, controllerLocation uint) error
- func (d *DriverMock) MountFloppyDrive(vmName string, path string) error
- func (d *DriverMock) MoveCreatedVHDsToOutputDir(srcPath string, dstPath string) error
- func (d *DriverMock) PreserveLegacyExportBehaviour(srcPath string, dstPath string) error
- func (d *DriverMock) ReplaceVirtualMachineNetworkAdapter(vmName string, replace bool) error
- func (d *DriverMock) ResizeVirtualMachineVhd(vmName string, newSizeInBytes uint64) error
- func (d *DriverMock) RestartVirtualMachine(vmName string) error
- func (d *DriverMock) SetBootDvdDrive(vmName string, controllerNumber uint, controllerLocation uint, generation uint) error
- func (d *DriverMock) SetBootOrder(vmName string, bootOrder []string) error
- func (d *DriverMock) SetFirstBootDevice(vmName string, controllerType string, controllerNumber uint, ...) error
- func (d *DriverMock) SetNetworkAdapterVlanId(switchName string, vlanId string) error
- func (d *DriverMock) SetVirtualMachineCpuCount(vmName string, cpu uint) error
- func (d *DriverMock) SetVirtualMachineDynamicMemory(vmName string, enable bool) error
- func (d *DriverMock) SetVirtualMachineMacSpoofing(vmName string, enable bool) error
- func (d *DriverMock) SetVirtualMachineSecureBoot(vmName string, enable bool, templateName string) error
- func (d *DriverMock) SetVirtualMachineTPM(vmName string, enable bool) error
- func (d *DriverMock) SetVirtualMachineVirtualizationExtensions(vmName string, enable bool) error
- func (d *DriverMock) SetVirtualMachineVlanId(vmName string, vlanId string) error
- func (d *DriverMock) SetVmNetworkAdapterMacAddress(vmName string, mac string) error
- func (d *DriverMock) Start(vmName string) error
- func (d *DriverMock) Stop(vmName string) error
- func (d *DriverMock) TypeScanCodes(vmName string, scanCodes string) error
- func (d *DriverMock) UnmountDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error
- func (d *DriverMock) UnmountFloppyDrive(vmName string) error
- func (d *DriverMock) UntagVirtualMachineNetworkAdapterVlan(vmName string, switchName string) error
- func (d *DriverMock) Uptime(vmName string) (uint64, error)
- func (d *DriverMock) Verify() error
- type DvdControllerProperties
- type FlatOutputConfig
- type HypervPS4Driver
- func (d *HypervPS4Driver) AddVirtualMachineHardDrive(vmName string, vhdFile string, vhdName string, vhdSizeBytes int64, ...) error
- func (d *HypervPS4Driver) CheckVMName(vmName string) error
- func (d *HypervPS4Driver) CloneVirtualMachine(cloneFromVmcxPath string, cloneFromVmName string, cloneFromSnapshotName string, ...) error
- func (d *HypervPS4Driver) CompactDisks(path string) (result string, err error)
- func (d *HypervPS4Driver) Connect(vmName string) (context.CancelFunc, error)
- func (d *HypervPS4Driver) ConnectVirtualMachineNetworkAdapterToSwitch(vmName string, switchName string) error
- func (d *HypervPS4Driver) CreateDvdDrive(vmName string, isoPath string, generation uint) (uint, uint, error)
- func (d *HypervPS4Driver) CreateExternalVirtualSwitch(vmName string, switchName string) error
- func (d *HypervPS4Driver) CreateVirtualMachine(vmName string, path string, harddrivePath string, ram int64, diskSize int64, ...) error
- func (d *HypervPS4Driver) CreateVirtualSwitch(switchName string, switchType string) (bool, error)
- func (d *HypervPS4Driver) DeleteDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error
- func (d *HypervPS4Driver) DeleteVirtualMachine(vmName string) error
- func (d *HypervPS4Driver) DeleteVirtualSwitch(switchName string) error
- func (d *HypervPS4Driver) Disconnect(cancel context.CancelFunc)
- func (d *HypervPS4Driver) EnableVirtualMachineIntegrationService(vmName string, integrationServiceName string) error
- func (d *HypervPS4Driver) ExportVirtualMachine(vmName string, path string) error
- func (d *HypervPS4Driver) GetHostAdapterIpAddressForSwitch(switchName string) (string, error)
- func (d *HypervPS4Driver) GetHostName(ip string) (string, error)
- func (d *HypervPS4Driver) GetVirtualMachineGeneration(vmName string) (uint, error)
- func (d *HypervPS4Driver) GetVirtualMachineNetworkAdapterAddress(vmName string) (string, error)
- func (d *HypervPS4Driver) GetVirtualMachineSwitchName(vmName string) (string, error)
- func (d *HypervPS4Driver) IpAddress(mac string) (string, error)
- func (d *HypervPS4Driver) IsOff(vmName string) (bool, error)
- func (d *HypervPS4Driver) IsRunning(vmName string) (bool, error)
- func (d *HypervPS4Driver) Mac(vmName string) (string, error)
- func (d *HypervPS4Driver) MountDvdDrive(vmName string, path string, controllerNumber uint, controllerLocation uint) error
- func (d *HypervPS4Driver) MountFloppyDrive(vmName string, path string) error
- func (d *HypervPS4Driver) MoveCreatedVHDsToOutputDir(srcPath string, dstPath string) error
- func (d *HypervPS4Driver) PreserveLegacyExportBehaviour(srcPath string, dstPath string) error
- func (d *HypervPS4Driver) ReplaceVirtualMachineNetworkAdapter(vmName string, virtual bool) error
- func (d *HypervPS4Driver) ResizeVirtualMachineVhd(vmName string, newSizeInBytes uint64) error
- func (d *HypervPS4Driver) RestartVirtualMachine(vmName string) error
- func (d *HypervPS4Driver) SetBootDvdDrive(vmName string, controllerNumber uint, controllerLocation uint, generation uint) error
- func (d *HypervPS4Driver) SetBootOrder(vmName string, bootOrder []string) error
- func (d *HypervPS4Driver) SetFirstBootDevice(vmName string, controllerType string, controllerNumber uint, ...) error
- func (d *HypervPS4Driver) SetNetworkAdapterVlanId(switchName string, vlanId string) error
- func (d *HypervPS4Driver) SetVirtualMachineCpuCount(vmName string, cpu uint) error
- func (d *HypervPS4Driver) SetVirtualMachineDynamicMemory(vmName string, enable bool) error
- func (d *HypervPS4Driver) SetVirtualMachineMacSpoofing(vmName string, enable bool) error
- func (d *HypervPS4Driver) SetVirtualMachineSecureBoot(vmName string, enable bool, templateName string) error
- func (d *HypervPS4Driver) SetVirtualMachineTPM(vmName string, enable bool) error
- func (d *HypervPS4Driver) SetVirtualMachineVirtualizationExtensions(vmName string, enable bool) error
- func (d *HypervPS4Driver) SetVirtualMachineVlanId(vmName string, vlanId string) error
- func (d *HypervPS4Driver) SetVmNetworkAdapterMacAddress(vmName string, mac string) error
- func (d *HypervPS4Driver) Start(vmName string) error
- func (d *HypervPS4Driver) Stop(vmName string) error
- func (d *HypervPS4Driver) TypeScanCodes(vmName string, scanCodes string) error
- func (d *HypervPS4Driver) UnmountDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error
- func (d *HypervPS4Driver) UnmountFloppyDrive(vmName string) error
- func (d *HypervPS4Driver) UntagVirtualMachineNetworkAdapterVlan(vmName string, switchName string) error
- func (d *HypervPS4Driver) Uptime(vmName string) (uint64, error)
- func (d *HypervPS4Driver) Verify() error
- type OutputConfig
- type SSHConfig
- type StepCloneVM
- type StepCollateArtifacts
- type StepCompactDisk
- type StepConfigureIp
- type StepConfigureVlan
- type StepCreateBuildDir
- type StepCreateExternalSwitch
- type StepCreateSwitch
- type StepCreateVM
- type StepDisableVlan
- type StepEnableIntegrationService
- type StepExportVm
- type StepMountDvdDrive
- type StepMountFloppydrive
- type StepMountGuestAdditions
- type StepMountSecondaryDvdImages
- type StepPollingInstallation
- type StepRebootVm
- type StepResizeVhd
- type StepRun
- type StepSetBootOrder
- type StepSetFirstBootDevice
- type StepShutdown
- type StepSleep
- type StepTypeBootCommand
- type StepUnmountDvdDrive
- type StepUnmountFloppyDrive
- type StepUnmountGuestAdditions
- type StepUnmountSecondaryDvdImages
- type StepWaitForInstallToComplete
- type StepWaitForPowerOff
Constants ¶
const ( DefaultDiskSize = 40 * 1024 // ~40GB MinDiskSize = 256 // 256MB MaxDiskSize = 64 * 1024 * 1024 // 64TB MaxVHDSize = 2040 * 1024 // 2040GB DefaultDiskBlockSize = 32 // 32MB MinDiskBlockSize = 1 // 1MB MaxDiskBlockSize = 256 // 256MB DefaultRamSize = 1 * 1024 // 1GB MinRamSize = 32 // 32MB MaxRamSize = 32 * 1024 // 32GB MinNestedVirtualizationRamSize = 4 * 1024 // 4GB LowRam = 256 // 256MB DefaultUsername = "" DefaultPassword = "" )
const ( SwitchTypeInternal = "Internal" SwitchTypePrivate = "Private" DefaultSwitchType = SwitchTypeInternal )
const BuilderId = "MSOpenTech.hyperv"
This is the common builder ID to all of these artifacts.
const (
FloppyFileName = "assets.vfd"
)
const (
SleepSeconds = 10
)
Variables ¶
This section is empty.
Functions ¶
func Appendwarns ¶
func NewArtifact ¶
NewArtifact returns a hyperv artifact containing the files in the given directory.
Types ¶
type CommonConfig ¶
type CommonConfig struct { commonsteps.FloppyConfig `mapstructure:",squash"` commonsteps.CDConfig `mapstructure:",squash"` // The block size of the VHD to be created. // Recommended disk block size for Linux hyper-v guests is 1 MiB. This // defaults to "32" MiB. DiskBlockSize uint `mapstructure:"disk_block_size" required:"false"` // The amount, in megabytes, of RAM to assign to the // VM. By default, this is 1 GB. RamSize uint `mapstructure:"memory" required:"false"` // A list of ISO paths to // attach to a VM when it is booted. This is most useful for unattended // Windows installs, which look for an Autounattend.xml file on removable // media. By default, no secondary ISO will be attached. SecondaryDvdImages []string `mapstructure:"secondary_iso_images" required:"false"` // The size or sizes of any // additional hard disks for the VM in megabytes. If this is not specified // then the VM will only contain a primary hard disk. Additional drives // will be attached to the SCSI interface only. The builder uses // expandable rather than fixed-size virtual hard disks, so the actual // file representing the disk will not use the full size unless it is // full. AdditionalDiskSize []uint `mapstructure:"disk_additional_size" required:"false"` // If set to attach then attach and // mount the ISO image specified in guest_additions_path. If set to // none then guest additions are not attached and mounted; This is the // default. GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"` // The path to the ISO image for guest // additions. GuestAdditionsPath string `mapstructure:"guest_additions_path" required:"false"` // This is the name of the new virtual machine, // without the file extension. By default this is "packer-BUILDNAME", // where "BUILDNAME" is the name of the build. VMName string `mapstructure:"vm_name" required:"false"` // The name of the switch to connect the virtual // machine to. By default, leaving this value unset will cause Packer to // try and determine the switch to use by looking for an external switch // that is up and running. SwitchName string `mapstructure:"switch_name" required:"false"` // This is the VLAN of the virtual switch's // network card. By default none is set. If none is set then a VLAN is not // set on the switch's network card. If this value is set it should match // the VLAN specified in by vlan_id. SwitchVlanId string `mapstructure:"switch_vlan_id" required:"false"` // This allows a specific MAC address to be used on // the default virtual network card. The MAC address must be a string with // no delimiters, for example "0000deadbeef". MacAddress string `mapstructure:"mac_address" required:"false"` // This is the VLAN of the virtual machine's network // card for the new virtual machine. By default none is set. If none is set // then VLANs are not set on the virtual machine's network card. VlanId string `mapstructure:"vlan_id" required:"false"` // The number of CPUs the virtual machine should use. If // this isn't specified, the default is 1 CPU. Cpu uint `mapstructure:"cpus" required:"false"` // The Hyper-V generation for the virtual machine. By // default, this is 1. Generation 2 Hyper-V virtual machines do not support // floppy drives. In this scenario use secondary_iso_images instead. Hard // drives and DVD drives will also be SCSI and not IDE. Generation uint `mapstructure:"generation" required:"false"` // If true enable MAC address spoofing // for the virtual machine. This defaults to false. EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing" required:"false"` // If true enable dynamic memory for // the virtual machine. This defaults to false. EnableDynamicMemory bool `mapstructure:"enable_dynamic_memory" required:"false"` // If true enable secure boot for the // virtual machine. This defaults to false. See secure_boot_template // below for additional settings. EnableSecureBoot bool `mapstructure:"enable_secure_boot" required:"false"` // The secure boot template to be // configured. Valid values are "MicrosoftWindows" (Windows) or // "MicrosoftUEFICertificateAuthority" (Linux). This only takes effect if // enable_secure_boot is set to "true". This defaults to "MicrosoftWindows". SecureBootTemplate string `mapstructure:"secure_boot_template" required:"false"` // If true enable // virtualization extensions for the virtual machine. This defaults to // false. For nested virtualization you need to enable MAC spoofing, // disable dynamic memory and have at least 4GB of RAM assigned to the // virtual machine. EnableVirtualizationExtensions bool `mapstructure:"enable_virtualization_extensions" required:"false"` // If true enable a virtual TPM for the // virtual machine. This defaults to false. EnableTPM bool `mapstructure:"enable_tpm" required:"false"` // The location under which Packer will create a directory to house all the // VM files and folders during the build. By default `%TEMP%` is used // which, for most systems, will evaluate to // `%USERPROFILE%/AppData/Local/Temp`. // // The build directory housed under `temp_path` will have a name similar to // `packerhv1234567`. The seven digit number at the end of the name is // automatically generated by Packer to ensure the directory name is // unique. TempPath string `mapstructure:"temp_path" required:"false"` // This allows you to set the vm version when calling New-VM to generate // the vm. Version string `mapstructure:"configuration_version" required:"false"` // If "true", Packer will not delete the VM from // The Hyper-V manager. // The resulting VM will be housed in a randomly generated folder under %TEMP% by default. // You can set the `temp_path` variable to change the location of the folder. KeepRegistered bool `mapstructure:"keep_registered" required:"false"` // If true skip compacting the hard disk for // the virtual machine when exporting. This defaults to false. SkipCompaction bool `mapstructure:"skip_compaction" required:"false"` // If true Packer will skip the export of the VM. // If you are interested only in the VHD/VHDX files, you can enable this // option. The resulting VHD/VHDX file will be output to // <output_directory>/Virtual Hard Disks. By default this option is false // and Packer will export the VM to output_directory. SkipExport bool `mapstructure:"skip_export" required:"false"` // Packer defaults to building Hyper-V virtual // machines by launching a GUI that shows the console of the machine being // built. When this value is set to true, the machine will start without a // console. Headless bool `mapstructure:"headless" required:"false"` // When configured, determines the device or device type that is given preferential // treatment when choosing a boot device. // // For Generation 1: // - `IDE` // - `CD` *or* `DVD` // - `Floppy` // - `NET` // // For Generation 2: // - `IDE:x:y` // - `SCSI:x:y` // - `CD` *or* `DVD` // - `NET` FirstBootDevice string `mapstructure:"first_boot_device" required:"false"` // When configured, the boot order determines the order of the devices // from which to boot. // // The device name must be in the form of `SCSI:x:y`, for example, // to boot from the first scsi device use `SCSI:0:0`. // // **NB** You should also set `first_boot_device` (e.g. `DVD`). // // **NB** Although the VM will have this initial boot order, the OS can // change it, for example, Ubuntu 18.04 will modify the boot order to // include itself as the first boot option. // // **NB** This only works for Generation 2 machines. BootOrder []string `mapstructure:"boot_order" required:"false"` }
func (*CommonConfig) Prepare ¶
func (c *CommonConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) ([]error, []string)
type Driver ¶
type Driver interface { // Checks if the VM named is running. IsRunning(string) (bool, error) // Checks if the VM named is off. IsOff(string) (bool, error) //How long has VM been on Uptime(vmName string) (uint64, error) // Start starts a VM specified by the name given. Start(string) error // Stop stops a VM specified by the name given. Stop(string) error // Verify checks to make sure that this driver should function // properly. If there is any indication the driver can't function, // this will return an error. Verify() error // Finds the MAC address of the NIC nic0 Mac(string) (string, error) // Finds the IP address of a VM connected that uses DHCP by its MAC address IpAddress(string) (string, error) // Finds the hostname for the ip address GetHostName(string) (string, error) // Finds the IP address of a host adapter connected to switch GetHostAdapterIpAddressForSwitch(string) (string, error) // Type scan codes to virtual keyboard of vm TypeScanCodes(string, string) error //Get the ip address for network adaptor GetVirtualMachineNetworkAdapterAddress(string) (string, error) //Set the vlan to use for switch SetNetworkAdapterVlanId(string, string) error //Set the vlan to use for machine SetVirtualMachineVlanId(string, string) error SetVmNetworkAdapterMacAddress(string, string) error //Replace the network adapter with a (non-)legacy adapter ReplaceVirtualMachineNetworkAdapter(string, bool) error UntagVirtualMachineNetworkAdapterVlan(string, string) error CreateExternalVirtualSwitch(string, string) error GetVirtualMachineSwitchName(string) (string, error) ConnectVirtualMachineNetworkAdapterToSwitch(string, string) error CreateVirtualSwitch(string, string) (bool, error) DeleteVirtualSwitch(string) error CheckVMName(string) error CreateVirtualMachine(string, string, string, int64, int64, int64, string, uint, bool, bool, string) error AddVirtualMachineHardDrive(string, string, string, int64, int64, string) error CloneVirtualMachine(string, string, string, bool, string, string, string, int64, string, bool) error ResizeVirtualMachineVhd(string, uint64) error DeleteVirtualMachine(string) error GetVirtualMachineGeneration(string) (uint, error) SetVirtualMachineCpuCount(string, uint) error SetVirtualMachineMacSpoofing(string, bool) error SetVirtualMachineDynamicMemory(string, bool) error SetVirtualMachineSecureBoot(string, bool, string) error SetVirtualMachineVirtualizationExtensions(string, bool) error SetVirtualMachineTPM(string, bool) error EnableVirtualMachineIntegrationService(string, string) error ExportVirtualMachine(string, string) error PreserveLegacyExportBehaviour(string, string) error MoveCreatedVHDsToOutputDir(string, string) error CompactDisks(string) (string, error) RestartVirtualMachine(string) error CreateDvdDrive(string, string, uint) (uint, uint, error) MountDvdDrive(string, string, uint, uint) error SetBootDvdDrive(string, uint, uint, uint) error SetFirstBootDevice(string, string, uint, uint, uint) error SetBootOrder(string, []string) error UnmountDvdDrive(string, uint, uint) error DeleteDvdDrive(string, uint, uint) error MountFloppyDrive(string, string) error UnmountFloppyDrive(string) error // Connect connects to a VM specified by the name given. Connect(string) (context.CancelFunc, error) // Disconnect disconnects to a VM specified by the context cancel function. Disconnect(context.CancelFunc) }
A driver is able to talk to HyperV and perform certain operations with it. Some of the operations on here may seem overly specific, but they were built specifically in mind to handle features of the HyperV builder for Packer, and to abstract differences in versions out of the builder steps, so sometimes the methods are extremely specific.
func NewHypervPS4Driver ¶
type DriverMock ¶
type DriverMock struct { IsRunning_Called bool IsRunning_VmName string IsRunning_Return bool IsRunning_Err error IsOff_Called bool IsOff_VmName string IsOff_Return bool IsOff_Err error Uptime_Called bool Uptime_VmName string Uptime_Return uint64 Uptime_Err error Start_Called bool Start_VmName string Start_Err error Stop_Called bool Stop_VmName string Stop_Err error Verify_Called bool Verify_Err error Mac_Called bool Mac_VmName string Mac_Return string Mac_Err error IpAddress_Called bool IpAddress_Mac string IpAddress_Return string IpAddress_Err error GetHostName_Called bool GetHostName_Ip string GetHostName_Return string GetHostName_Err error GetVirtualMachineGeneration_Called bool GetVirtualMachineGeneration_VmName string GetVirtualMachineGeneration_Return uint GetVirtualMachineGeneration_Err error GetHostAdapterIpAddressForSwitch_Called bool GetHostAdapterIpAddressForSwitch_SwitchName string GetHostAdapterIpAddressForSwitch_Return string GetHostAdapterIpAddressForSwitch_Err error TypeScanCodes_Called bool TypeScanCodes_VmName string TypeScanCodes_ScanCodes string TypeScanCodes_Err error GetVirtualMachineNetworkAdapterAddress_Called bool GetVirtualMachineNetworkAdapterAddress_VmName string GetVirtualMachineNetworkAdapterAddress_Return string GetVirtualMachineNetworkAdapterAddress_Err error ReplaceVirtualMachineNetworkAdapter_Called bool ReplaceVirtualMachineNetworkAdapter_VmName string ReplaceVirtualMachineNetworkAdapter_Replace bool ReplaceVirtualMachineNetworkAdapter_Err error SetNetworkAdapterVlanId_Called bool SetNetworkAdapterVlanId_SwitchName string SetNetworkAdapterVlanId_VlanId string SetNetworkAdapterVlanId_Err error SetVmNetworkAdapterMacAddress_Called bool SetVmNetworkAdapterMacAddress_VmName string SetVmNetworkAdapterMacAddress_Mac string SetVmNetworkAdapterMacAddress_Err error SetVirtualMachineVlanId_Called bool SetVirtualMachineVlanId_VmName string SetVirtualMachineVlanId_VlanId string SetVirtualMachineVlanId_Err error UntagVirtualMachineNetworkAdapterVlan_Called bool UntagVirtualMachineNetworkAdapterVlan_VmName string UntagVirtualMachineNetworkAdapterVlan_SwitchName string UntagVirtualMachineNetworkAdapterVlan_Err error CreateExternalVirtualSwitch_Called bool CreateExternalVirtualSwitch_VmName string CreateExternalVirtualSwitch_SwitchName string CreateExternalVirtualSwitch_Err error GetVirtualMachineSwitchName_Called bool GetVirtualMachineSwitchName_VmName string GetVirtualMachineSwitchName_Return string GetVirtualMachineSwitchName_Err error ConnectVirtualMachineNetworkAdapterToSwitch_Called bool ConnectVirtualMachineNetworkAdapterToSwitch_VmName string ConnectVirtualMachineNetworkAdapterToSwitch_SwitchName string ConnectVirtualMachineNetworkAdapterToSwitch_Err error DeleteVirtualSwitch_Called bool DeleteVirtualSwitch_SwitchName string DeleteVirtualSwitch_Err error CheckVMName_Called bool CheckVMName_Err error CreateVirtualSwitch_Called bool CreateVirtualSwitch_SwitchName string CreateVirtualSwitch_SwitchType string CreateVirtualSwitch_Return bool CreateVirtualSwitch_Err error AddVirtualMachineHardDrive_Called bool AddVirtualMachineHardDrive_VmName string AddVirtualMachineHardDrive_VhdFile string AddVirtualMachineHardDrive_VhdName string AddVirtualMachineHardDrive_VhdSizeBytes int64 AddVirtualMachineHardDrive_VhdBlockSize int64 AddVirtualMachineHardDrive_ControllerType string AddVirtualMachineHardDrive_Err error CreateVirtualMachine_Called bool CreateVirtualMachine_VmName string CreateVirtualMachine_Path string CreateVirtualMachine_HarddrivePath string CreateVirtualMachine_Ram int64 CreateVirtualMachine_DiskSize int64 CreateVirtualMachine_DiskBlockSize int64 CreateVirtualMachine_SwitchName string CreateVirtualMachine_Generation uint CreateVirtualMachine_DifferentialDisk bool CreateVirtualMachine_FixedVHD bool CreateVirtualMachine_Version string CreateVirtualMachine_Err error CloneVirtualMachine_Called bool CloneVirtualMachine_CloneFromVmcxPath string CloneVirtualMachine_CloneFromVmName string CloneVirtualMachine_CloneFromSnapshotName string CloneVirtualMachine_CloneAllSnapshots bool CloneVirtualMachine_VmName string CloneVirtualMachine_Path string CloneVirtualMachine_HarddrivePath string CloneVirtualMachine_Ram int64 CloneVirtualMachine_SwitchName string CloneVirtualMachine_Copy bool CloneVirtualMachine_Err error ResizeVirtualMachineVhd_Called bool ResizeVirtualMachineVhd_VmName string ResizeVirtualMachineVhd_newSizeInBytes uint64 ResizeVirtualMachineVhd_Err error DeleteVirtualMachine_Called bool DeleteVirtualMachine_VmName string DeleteVirtualMachine_Err error SetVirtualMachineCpuCount_Called bool SetVirtualMachineCpuCount_VmName string SetVirtualMachineCpuCount_Cpu uint SetVirtualMachineCpuCount_Err error SetVirtualMachineMacSpoofing_Called bool SetVirtualMachineMacSpoofing_VmName string SetVirtualMachineMacSpoofing_Enable bool SetVirtualMachineMacSpoofing_Err error SetVirtualMachineDynamicMemory_Called bool SetVirtualMachineDynamicMemory_VmName string SetVirtualMachineDynamicMemory_Enable bool SetVirtualMachineDynamicMemory_Err error SetVirtualMachineSecureBoot_Called bool SetVirtualMachineSecureBoot_VmName string SetVirtualMachineSecureBoot_TemplateName string SetVirtualMachineSecureBoot_Enable bool SetVirtualMachineSecureBoot_Err error SetVirtualMachineVirtualizationExtensions_Called bool SetVirtualMachineVirtualizationExtensions_VmName string SetVirtualMachineVirtualizationExtensions_Enable bool SetVirtualMachineVirtualizationExtensions_Err error SetVirtualMachineTPM_Called bool SetVirtualMachineTPM_VmName string SetVirtualMachineTPM_Enable bool SetVirtualMachineTPM_Err error EnableVirtualMachineIntegrationService_Called bool EnableVirtualMachineIntegrationService_VmName string EnableVirtualMachineIntegrationService_IntegrationServiceName string EnableVirtualMachineIntegrationService_Err error ExportVirtualMachine_Called bool ExportVirtualMachine_VmName string ExportVirtualMachine_Path string ExportVirtualMachine_Err error PreserveLegacyExportBehaviour_Called bool PreserveLegacyExportBehaviour_SrcPath string PreserveLegacyExportBehaviour_DstPath string PreserveLegacyExportBehaviour_Err error MoveCreatedVHDsToOutputDir_Called bool MoveCreatedVHDsToOutputDir_SrcPath string MoveCreatedVHDsToOutputDir_DstPath string MoveCreatedVHDsToOutputDir_Err error CompactDisks_Called bool CompactDisks_Path string CompactDisks_Result string CompactDisks_Err error RestartVirtualMachine_Called bool RestartVirtualMachine_VmName string RestartVirtualMachine_Err error CreateDvdDrive_Called bool CreateDvdDrive_VmName string CreateDvdDrive_IsoPath string CreateDvdDrive_Generation uint CreateDvdDrive_ControllerNumber uint CreateDvdDrive_ControllerLocation uint CreateDvdDrive_Err error MountDvdDrive_Called bool MountDvdDrive_VmName string MountDvdDrive_Path string MountDvdDrive_ControllerNumber uint MountDvdDrive_ControllerLocation uint MountDvdDrive_Err error SetBootDvdDrive_Called bool SetBootDvdDrive_VmName string SetBootDvdDrive_ControllerNumber uint SetBootDvdDrive_ControllerLocation uint SetBootDvdDrive_Generation uint SetBootDvdDrive_Err error SetFirstBootDevice_Called bool SetFirstBootDevice_VmName string SetFirstBootDevice_ControllerType string SetFirstBootDevice_ControllerNumber uint SetFirstBootDevice_ControllerLocation uint SetFirstBootDevice_Generation uint SetFirstBootDevice_Err error SetBootOrder_Called bool SetBootOrder_VmName string SetBootOrder_BootOrder []string SetBootOrder_Err error UnmountDvdDrive_Called bool UnmountDvdDrive_VmName string UnmountDvdDrive_ControllerNumber uint UnmountDvdDrive_ControllerLocation uint UnmountDvdDrive_Err error DeleteDvdDrive_Called bool DeleteDvdDrive_VmName string DeleteDvdDrive_ControllerNumber uint DeleteDvdDrive_ControllerLocation uint DeleteDvdDrive_Err error MountFloppyDrive_Called bool MountFloppyDrive_VmName string MountFloppyDrive_Path string MountFloppyDrive_Err error UnmountFloppyDrive_Called bool UnmountFloppyDrive_VmName string UnmountFloppyDrive_Err error Connect_Called bool Connect_VmName string Connect_Cancel context.CancelFunc Connect_Err error Disconnect_Called bool Disconnect_Cancel context.CancelFunc }
func (*DriverMock) AddVirtualMachineHardDrive ¶
func (*DriverMock) CheckVMName ¶
func (d *DriverMock) CheckVMName(vmName string) error
func (*DriverMock) CloneVirtualMachine ¶
func (*DriverMock) CompactDisks ¶
func (d *DriverMock) CompactDisks(path string) (result string, err error)
func (*DriverMock) Connect ¶
func (d *DriverMock) Connect(vmName string) (context.CancelFunc, error)
func (*DriverMock) ConnectVirtualMachineNetworkAdapterToSwitch ¶
func (d *DriverMock) ConnectVirtualMachineNetworkAdapterToSwitch(vmName string, switchName string) error
func (*DriverMock) CreateDvdDrive ¶
func (*DriverMock) CreateExternalVirtualSwitch ¶
func (d *DriverMock) CreateExternalVirtualSwitch(vmName string, switchName string) error
func (*DriverMock) CreateVirtualMachine ¶
func (*DriverMock) CreateVirtualSwitch ¶
func (d *DriverMock) CreateVirtualSwitch(switchName string, switchType string) (bool, error)
func (*DriverMock) DeleteDvdDrive ¶
func (d *DriverMock) DeleteDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error
func (*DriverMock) DeleteVirtualMachine ¶
func (d *DriverMock) DeleteVirtualMachine(vmName string) error
func (*DriverMock) DeleteVirtualSwitch ¶
func (d *DriverMock) DeleteVirtualSwitch(switchName string) error
func (*DriverMock) Disconnect ¶
func (d *DriverMock) Disconnect(cancel context.CancelFunc)
func (*DriverMock) EnableVirtualMachineIntegrationService ¶
func (d *DriverMock) EnableVirtualMachineIntegrationService(vmName string, integrationServiceName string) error
func (*DriverMock) ExportVirtualMachine ¶
func (d *DriverMock) ExportVirtualMachine(vmName string, path string) error
func (*DriverMock) GetHostAdapterIpAddressForSwitch ¶
func (d *DriverMock) GetHostAdapterIpAddressForSwitch(switchName string) (string, error)
func (*DriverMock) GetHostName ¶
func (d *DriverMock) GetHostName(ip string) (string, error)
func (*DriverMock) GetVirtualMachineGeneration ¶
func (d *DriverMock) GetVirtualMachineGeneration(vmName string) (uint, error)
func (*DriverMock) GetVirtualMachineNetworkAdapterAddress ¶
func (d *DriverMock) GetVirtualMachineNetworkAdapterAddress(vmName string) (string, error)
func (*DriverMock) GetVirtualMachineSwitchName ¶
func (d *DriverMock) GetVirtualMachineSwitchName(vmName string) (string, error)
func (*DriverMock) MountDvdDrive ¶
func (*DriverMock) MountFloppyDrive ¶
func (d *DriverMock) MountFloppyDrive(vmName string, path string) error
func (*DriverMock) MoveCreatedVHDsToOutputDir ¶
func (d *DriverMock) MoveCreatedVHDsToOutputDir(srcPath string, dstPath string) error
func (*DriverMock) PreserveLegacyExportBehaviour ¶
func (d *DriverMock) PreserveLegacyExportBehaviour(srcPath string, dstPath string) error
func (*DriverMock) ReplaceVirtualMachineNetworkAdapter ¶
func (d *DriverMock) ReplaceVirtualMachineNetworkAdapter(vmName string, replace bool) error
func (*DriverMock) ResizeVirtualMachineVhd ¶ added in v1.1.0
func (d *DriverMock) ResizeVirtualMachineVhd(vmName string, newSizeInBytes uint64) error
func (*DriverMock) RestartVirtualMachine ¶
func (d *DriverMock) RestartVirtualMachine(vmName string) error
func (*DriverMock) SetBootDvdDrive ¶
func (*DriverMock) SetBootOrder ¶
func (d *DriverMock) SetBootOrder(vmName string, bootOrder []string) error
func (*DriverMock) SetFirstBootDevice ¶
func (*DriverMock) SetNetworkAdapterVlanId ¶
func (d *DriverMock) SetNetworkAdapterVlanId(switchName string, vlanId string) error
func (*DriverMock) SetVirtualMachineCpuCount ¶
func (d *DriverMock) SetVirtualMachineCpuCount(vmName string, cpu uint) error
func (*DriverMock) SetVirtualMachineDynamicMemory ¶
func (d *DriverMock) SetVirtualMachineDynamicMemory(vmName string, enable bool) error
func (*DriverMock) SetVirtualMachineMacSpoofing ¶
func (d *DriverMock) SetVirtualMachineMacSpoofing(vmName string, enable bool) error
func (*DriverMock) SetVirtualMachineSecureBoot ¶
func (d *DriverMock) SetVirtualMachineSecureBoot(vmName string, enable bool, templateName string) error
func (*DriverMock) SetVirtualMachineTPM ¶ added in v1.1.1
func (d *DriverMock) SetVirtualMachineTPM(vmName string, enable bool) error
func (*DriverMock) SetVirtualMachineVirtualizationExtensions ¶
func (d *DriverMock) SetVirtualMachineVirtualizationExtensions(vmName string, enable bool) error
func (*DriverMock) SetVirtualMachineVlanId ¶
func (d *DriverMock) SetVirtualMachineVlanId(vmName string, vlanId string) error
func (*DriverMock) SetVmNetworkAdapterMacAddress ¶
func (d *DriverMock) SetVmNetworkAdapterMacAddress(vmName string, mac string) error
func (*DriverMock) Start ¶
func (d *DriverMock) Start(vmName string) error
func (*DriverMock) Stop ¶
func (d *DriverMock) Stop(vmName string) error
func (*DriverMock) TypeScanCodes ¶
func (d *DriverMock) TypeScanCodes(vmName string, scanCodes string) error
func (*DriverMock) UnmountDvdDrive ¶
func (d *DriverMock) UnmountDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error
func (*DriverMock) UnmountFloppyDrive ¶
func (d *DriverMock) UnmountFloppyDrive(vmName string) error
func (*DriverMock) UntagVirtualMachineNetworkAdapterVlan ¶
func (d *DriverMock) UntagVirtualMachineNetworkAdapterVlan(vmName string, switchName string) error
func (*DriverMock) Verify ¶
func (d *DriverMock) Verify() error
type DvdControllerProperties ¶
type FlatOutputConfig ¶
type FlatOutputConfig struct {
OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"`
}
FlatOutputConfig is an auto-generated flat version of OutputConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type HypervPS4Driver ¶
type HypervPS4Driver struct { }
func (*HypervPS4Driver) AddVirtualMachineHardDrive ¶
func (*HypervPS4Driver) CheckVMName ¶
func (d *HypervPS4Driver) CheckVMName(vmName string) error
func (*HypervPS4Driver) CloneVirtualMachine ¶
func (*HypervPS4Driver) CompactDisks ¶
func (d *HypervPS4Driver) CompactDisks(path string) (result string, err error)
func (*HypervPS4Driver) Connect ¶
func (d *HypervPS4Driver) Connect(vmName string) (context.CancelFunc, error)
Connect connects to a VM specified by the name given.
func (*HypervPS4Driver) ConnectVirtualMachineNetworkAdapterToSwitch ¶
func (d *HypervPS4Driver) ConnectVirtualMachineNetworkAdapterToSwitch(vmName string, switchName string) error
func (*HypervPS4Driver) CreateDvdDrive ¶
func (*HypervPS4Driver) CreateExternalVirtualSwitch ¶
func (d *HypervPS4Driver) CreateExternalVirtualSwitch(vmName string, switchName string) error
func (*HypervPS4Driver) CreateVirtualMachine ¶
func (*HypervPS4Driver) CreateVirtualSwitch ¶
func (d *HypervPS4Driver) CreateVirtualSwitch(switchName string, switchType string) (bool, error)
func (*HypervPS4Driver) DeleteDvdDrive ¶
func (d *HypervPS4Driver) DeleteDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error
func (*HypervPS4Driver) DeleteVirtualMachine ¶
func (d *HypervPS4Driver) DeleteVirtualMachine(vmName string) error
func (*HypervPS4Driver) DeleteVirtualSwitch ¶
func (d *HypervPS4Driver) DeleteVirtualSwitch(switchName string) error
func (*HypervPS4Driver) Disconnect ¶
func (d *HypervPS4Driver) Disconnect(cancel context.CancelFunc)
Disconnect disconnects to a VM specified by calling the context cancel function returned from Connect.
func (*HypervPS4Driver) EnableVirtualMachineIntegrationService ¶
func (d *HypervPS4Driver) EnableVirtualMachineIntegrationService(vmName string, integrationServiceName string) error
func (*HypervPS4Driver) ExportVirtualMachine ¶
func (d *HypervPS4Driver) ExportVirtualMachine(vmName string, path string) error
func (*HypervPS4Driver) GetHostAdapterIpAddressForSwitch ¶
func (d *HypervPS4Driver) GetHostAdapterIpAddressForSwitch(switchName string) (string, error)
Finds the IP address of a host adapter connected to switch
func (*HypervPS4Driver) GetHostName ¶
func (d *HypervPS4Driver) GetHostName(ip string) (string, error)
Get host name from ip address
func (*HypervPS4Driver) GetVirtualMachineGeneration ¶
func (d *HypervPS4Driver) GetVirtualMachineGeneration(vmName string) (uint, error)
func (*HypervPS4Driver) GetVirtualMachineNetworkAdapterAddress ¶
func (d *HypervPS4Driver) GetVirtualMachineNetworkAdapterAddress(vmName string) (string, error)
Get network adapter address
func (*HypervPS4Driver) GetVirtualMachineSwitchName ¶
func (d *HypervPS4Driver) GetVirtualMachineSwitchName(vmName string) (string, error)
func (*HypervPS4Driver) IpAddress ¶
func (d *HypervPS4Driver) IpAddress(mac string) (string, error)
Get ip address for mac address.
func (*HypervPS4Driver) IsRunning ¶
func (d *HypervPS4Driver) IsRunning(vmName string) (bool, error)
func (*HypervPS4Driver) Mac ¶
func (d *HypervPS4Driver) Mac(vmName string) (string, error)
Get mac address for VM.
func (*HypervPS4Driver) MountDvdDrive ¶
func (*HypervPS4Driver) MountFloppyDrive ¶
func (d *HypervPS4Driver) MountFloppyDrive(vmName string, path string) error
func (*HypervPS4Driver) MoveCreatedVHDsToOutputDir ¶
func (d *HypervPS4Driver) MoveCreatedVHDsToOutputDir(srcPath string, dstPath string) error
func (*HypervPS4Driver) PreserveLegacyExportBehaviour ¶
func (d *HypervPS4Driver) PreserveLegacyExportBehaviour(srcPath string, dstPath string) error
func (*HypervPS4Driver) ReplaceVirtualMachineNetworkAdapter ¶
func (d *HypervPS4Driver) ReplaceVirtualMachineNetworkAdapter(vmName string, virtual bool) error
Replace the network adapter with a (non-)legacy adapter
func (*HypervPS4Driver) ResizeVirtualMachineVhd ¶ added in v1.1.0
func (d *HypervPS4Driver) ResizeVirtualMachineVhd(vmName string, newSizeInBytes uint64) error
func (*HypervPS4Driver) RestartVirtualMachine ¶
func (d *HypervPS4Driver) RestartVirtualMachine(vmName string) error
func (*HypervPS4Driver) SetBootDvdDrive ¶
func (*HypervPS4Driver) SetBootOrder ¶
func (d *HypervPS4Driver) SetBootOrder(vmName string, bootOrder []string) error
func (*HypervPS4Driver) SetFirstBootDevice ¶
func (*HypervPS4Driver) SetNetworkAdapterVlanId ¶
func (d *HypervPS4Driver) SetNetworkAdapterVlanId(switchName string, vlanId string) error
Set the vlan to use for switch
func (*HypervPS4Driver) SetVirtualMachineCpuCount ¶
func (d *HypervPS4Driver) SetVirtualMachineCpuCount(vmName string, cpu uint) error
func (*HypervPS4Driver) SetVirtualMachineDynamicMemory ¶
func (d *HypervPS4Driver) SetVirtualMachineDynamicMemory(vmName string, enable bool) error
func (*HypervPS4Driver) SetVirtualMachineMacSpoofing ¶
func (d *HypervPS4Driver) SetVirtualMachineMacSpoofing(vmName string, enable bool) error
func (*HypervPS4Driver) SetVirtualMachineSecureBoot ¶
func (d *HypervPS4Driver) SetVirtualMachineSecureBoot(vmName string, enable bool, templateName string) error
func (*HypervPS4Driver) SetVirtualMachineTPM ¶ added in v1.1.1
func (d *HypervPS4Driver) SetVirtualMachineTPM(vmName string, enable bool) error
func (*HypervPS4Driver) SetVirtualMachineVirtualizationExtensions ¶
func (d *HypervPS4Driver) SetVirtualMachineVirtualizationExtensions(vmName string, enable bool) error
func (*HypervPS4Driver) SetVirtualMachineVlanId ¶
func (d *HypervPS4Driver) SetVirtualMachineVlanId(vmName string, vlanId string) error
Set the vlan to use for machine
func (*HypervPS4Driver) SetVmNetworkAdapterMacAddress ¶
func (d *HypervPS4Driver) SetVmNetworkAdapterMacAddress(vmName string, mac string) error
func (*HypervPS4Driver) Start ¶
func (d *HypervPS4Driver) Start(vmName string) error
Start starts a VM specified by the name given.
func (*HypervPS4Driver) Stop ¶
func (d *HypervPS4Driver) Stop(vmName string) error
Stop stops a VM specified by the name given.
func (*HypervPS4Driver) TypeScanCodes ¶
func (d *HypervPS4Driver) TypeScanCodes(vmName string, scanCodes string) error
Type scan codes to virtual keyboard of vm
func (*HypervPS4Driver) UnmountDvdDrive ¶
func (d *HypervPS4Driver) UnmountDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error
func (*HypervPS4Driver) UnmountFloppyDrive ¶
func (d *HypervPS4Driver) UnmountFloppyDrive(vmName string) error
func (*HypervPS4Driver) UntagVirtualMachineNetworkAdapterVlan ¶
func (d *HypervPS4Driver) UntagVirtualMachineNetworkAdapterVlan(vmName string, switchName string) error
func (*HypervPS4Driver) Verify ¶
func (d *HypervPS4Driver) Verify() error
type OutputConfig ¶
type OutputConfig struct { // This setting specifies the directory that // artifacts from the build, such as the virtual machine files and disks, // will be output to. The path to the directory may be relative or // absolute. If relative, the path is relative to the working directory // packer is executed from. This directory must not exist or, if // created, must be empty prior to running the builder. By default this is // "output-BUILDNAME" where "BUILDNAME" is the name of the build. OutputDir string `mapstructure:"output_directory" required:"false"` }
func (*OutputConfig) FlatMapstructure ¶
func (*OutputConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatOutputConfig. FlatOutputConfig is an auto-generated flat version of OutputConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*OutputConfig) Prepare ¶
func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error
type SSHConfig ¶
type SSHConfig struct {
Comm communicator.Config `mapstructure:",squash"`
}
type StepCloneVM ¶
type StepCloneVM struct { CloneFromVMCXPath string CloneFromVMName string CloneFromSnapshotName string CloneAllSnapshots bool VMName string SwitchName string CompareCopy bool RamSize uint Cpu uint EnableMacSpoofing bool EnableDynamicMemory bool EnableSecureBoot bool SecureBootTemplate string EnableVirtualizationExtensions bool EnableTPM bool MacAddress string KeepRegistered bool AdditionalDiskSize []uint DiskBlockSize uint }
This step clones an existing virtual machine.
Produces:
VMName string - The name of the VM
func (*StepCloneVM) Cleanup ¶
func (s *StepCloneVM) Cleanup(state multistep.StateBag)
func (*StepCloneVM) Run ¶
func (s *StepCloneVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCollateArtifacts ¶
func (*StepCollateArtifacts) Cleanup ¶
func (s *StepCollateArtifacts) Cleanup(state multistep.StateBag)
Cleanup does nothing
func (*StepCollateArtifacts) Run ¶
func (s *StepCollateArtifacts) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
Runs the step required to collate all build artifacts under the specified output directory
type StepCompactDisk ¶
type StepCompactDisk struct {
SkipCompaction bool
}
func (*StepCompactDisk) Cleanup ¶
func (s *StepCompactDisk) Cleanup(state multistep.StateBag)
Cleanup does nothing
func (*StepCompactDisk) Run ¶
func (s *StepCompactDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
Run runs a compaction/optimisation process on attached VHD/VHDX disks
type StepConfigureIp ¶
type StepConfigureIp struct { }
func (*StepConfigureIp) Cleanup ¶
func (s *StepConfigureIp) Cleanup(state multistep.StateBag)
func (*StepConfigureIp) Run ¶
func (s *StepConfigureIp) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepConfigureVlan ¶
func (*StepConfigureVlan) Cleanup ¶
func (s *StepConfigureVlan) Cleanup(state multistep.StateBag)
func (*StepConfigureVlan) Run ¶
func (s *StepConfigureVlan) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCreateBuildDir ¶
type StepCreateBuildDir struct { // User supplied directory under which we create the main build // directory. The build directory is used to house the VM files and // folders during the build. If unspecified the default temp directory // for the OS is used TempPath string // If true, the build directory will not be deleted when the step // Cleanup() method is called KeepRegistered bool // contains filtered or unexported fields }
func (*StepCreateBuildDir) Cleanup ¶
func (s *StepCreateBuildDir) Cleanup(state multistep.StateBag)
Cleanup removes the build directory
func (*StepCreateBuildDir) Run ¶
func (s *StepCreateBuildDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
Creates the main directory used to house the VMs files and folders during the build
type StepCreateExternalSwitch ¶
type StepCreateExternalSwitch struct { SwitchName string // contains filtered or unexported fields }
This step creates an external switch for the VM.
Produces:
SwitchName string - The name of the Switch
func (*StepCreateExternalSwitch) Cleanup ¶
func (s *StepCreateExternalSwitch) Cleanup(state multistep.StateBag)
func (*StepCreateExternalSwitch) Run ¶
func (s *StepCreateExternalSwitch) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
Run runs the step required to create an external switch. Depending on the connectivity of the host machine, the external switch will allow the build VM to connect to the outside world.
type StepCreateSwitch ¶
type StepCreateSwitch struct { // Specifies the name of the switch to be created. SwitchName string // Specifies the type of the switch to be created. Allowed values are Internal and Private. To create an External // virtual switch, specify either the NetAdapterInterfaceDescription or the NetAdapterName parameter, which // implicitly set the type of the virtual switch to External. SwitchType string // Specifies the name of the network adapter to be bound to the switch to be created. NetAdapterName string // Specifies the interface description of the network adapter to be bound to the switch to be created. NetAdapterInterfaceDescription string // contains filtered or unexported fields }
This step creates switch for VM.
Produces:
SwitchName string - The name of the Switch
func (*StepCreateSwitch) Cleanup ¶
func (s *StepCreateSwitch) Cleanup(state multistep.StateBag)
func (*StepCreateSwitch) Run ¶
func (s *StepCreateSwitch) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCreateVM ¶
type StepCreateVM struct { VMName string SwitchName string HarddrivePath string RamSize uint DiskSize uint DiskBlockSize uint UseLegacyNetworkAdapter bool Generation uint Cpu uint EnableMacSpoofing bool EnableDynamicMemory bool EnableSecureBoot bool SecureBootTemplate string EnableVirtualizationExtensions bool EnableTPM bool AdditionalDiskSize []uint DifferencingDisk bool MacAddress string FixedVHD bool Version string KeepRegistered bool }
This step creates the actual virtual machine.
Produces:
VMName string - The name of the VM
func (*StepCreateVM) Cleanup ¶
func (s *StepCreateVM) Cleanup(state multistep.StateBag)
func (*StepCreateVM) Run ¶
func (s *StepCreateVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepDisableVlan ¶
type StepDisableVlan struct { }
func (*StepDisableVlan) Cleanup ¶
func (s *StepDisableVlan) Cleanup(state multistep.StateBag)
func (*StepDisableVlan) Run ¶
func (s *StepDisableVlan) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepEnableIntegrationService ¶
type StepEnableIntegrationService struct {
// contains filtered or unexported fields
}
func (*StepEnableIntegrationService) Cleanup ¶
func (s *StepEnableIntegrationService) Cleanup(state multistep.StateBag)
func (*StepEnableIntegrationService) Run ¶
func (s *StepEnableIntegrationService) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepExportVm ¶
func (*StepExportVm) Cleanup ¶
func (s *StepExportVm) Cleanup(state multistep.StateBag)
func (*StepExportVm) Run ¶
func (s *StepExportVm) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepMountDvdDrive ¶
func (*StepMountDvdDrive) Cleanup ¶
func (s *StepMountDvdDrive) Cleanup(state multistep.StateBag)
func (*StepMountDvdDrive) Run ¶
func (s *StepMountDvdDrive) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepMountFloppydrive ¶
type StepMountFloppydrive struct { Generation uint // contains filtered or unexported fields }
func (*StepMountFloppydrive) Cleanup ¶
func (s *StepMountFloppydrive) Cleanup(state multistep.StateBag)
func (*StepMountFloppydrive) Run ¶
func (s *StepMountFloppydrive) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepMountGuestAdditions ¶
type StepMountGuestAdditions struct { GuestAdditionsMode string GuestAdditionsPath string Generation uint }
func (*StepMountGuestAdditions) Cleanup ¶
func (s *StepMountGuestAdditions) Cleanup(state multistep.StateBag)
func (*StepMountGuestAdditions) Run ¶
func (s *StepMountGuestAdditions) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepMountSecondaryDvdImages ¶
func (*StepMountSecondaryDvdImages) Cleanup ¶
func (s *StepMountSecondaryDvdImages) Cleanup(state multistep.StateBag)
func (*StepMountSecondaryDvdImages) Run ¶
func (s *StepMountSecondaryDvdImages) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepPollingInstallation ¶
type StepPollingInstallation struct { }
func (*StepPollingInstallation) Cleanup ¶
func (s *StepPollingInstallation) Cleanup(state multistep.StateBag)
func (*StepPollingInstallation) Run ¶
func (s *StepPollingInstallation) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepRebootVm ¶
type StepRebootVm struct { }
func (*StepRebootVm) Cleanup ¶
func (s *StepRebootVm) Cleanup(state multistep.StateBag)
func (*StepRebootVm) Run ¶
func (s *StepRebootVm) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepResizeVhd ¶ added in v1.1.0
type StepResizeVhd struct {
DiskSize *uint
}
This resizes the first vhd on the virtual machine to the specified DiskSize (in MB)
func (*StepResizeVhd) Cleanup ¶ added in v1.1.0
func (s *StepResizeVhd) Cleanup(state multistep.StateBag)
func (*StepResizeVhd) Run ¶ added in v1.1.0
func (s *StepResizeVhd) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepRun ¶
type StepRun struct { GuiCancelFunc context.CancelFunc Headless bool SwitchName string // contains filtered or unexported fields }
type StepSetBootOrder ¶
type StepSetBootOrder struct {
BootOrder []string
}
func (*StepSetBootOrder) Cleanup ¶
func (s *StepSetBootOrder) Cleanup(state multistep.StateBag)
func (*StepSetBootOrder) Run ¶
func (s *StepSetBootOrder) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepSetFirstBootDevice ¶
func (*StepSetFirstBootDevice) Cleanup ¶
func (s *StepSetFirstBootDevice) Cleanup(state multistep.StateBag)
func (*StepSetFirstBootDevice) Run ¶
func (s *StepSetFirstBootDevice) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepShutdown ¶
This step shuts down the machine. It first attempts to do so gracefully, but ultimately forcefully shuts it down if that fails.
Uses:
communicator packersdk.Communicator driver Driver ui packersdk.Ui vmName string
Produces:
<nothing>
func (*StepShutdown) Cleanup ¶
func (s *StepShutdown) Cleanup(state multistep.StateBag)
func (*StepShutdown) Run ¶
func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepTypeBootCommand ¶
type StepTypeBootCommand struct { BootCommand string BootWait time.Duration SwitchName string Ctx interpolate.Context GroupInterval time.Duration }
This step "types" the boot command into the VM via the Hyper-V virtual keyboard
func (*StepTypeBootCommand) Cleanup ¶
func (*StepTypeBootCommand) Cleanup(multistep.StateBag)
func (*StepTypeBootCommand) Run ¶
func (s *StepTypeBootCommand) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepUnmountDvdDrive ¶
type StepUnmountDvdDrive struct { }
func (*StepUnmountDvdDrive) Cleanup ¶
func (s *StepUnmountDvdDrive) Cleanup(state multistep.StateBag)
func (*StepUnmountDvdDrive) Run ¶
func (s *StepUnmountDvdDrive) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepUnmountFloppyDrive ¶
type StepUnmountFloppyDrive struct {
Generation uint
}
func (*StepUnmountFloppyDrive) Cleanup ¶
func (s *StepUnmountFloppyDrive) Cleanup(state multistep.StateBag)
func (*StepUnmountFloppyDrive) Run ¶
func (s *StepUnmountFloppyDrive) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepUnmountGuestAdditions ¶
type StepUnmountGuestAdditions struct { }
func (*StepUnmountGuestAdditions) Cleanup ¶
func (s *StepUnmountGuestAdditions) Cleanup(state multistep.StateBag)
func (*StepUnmountGuestAdditions) Run ¶
func (s *StepUnmountGuestAdditions) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepUnmountSecondaryDvdImages ¶
type StepUnmountSecondaryDvdImages struct { }
func (*StepUnmountSecondaryDvdImages) Cleanup ¶
func (s *StepUnmountSecondaryDvdImages) Cleanup(state multistep.StateBag)
func (*StepUnmountSecondaryDvdImages) Run ¶
func (s *StepUnmountSecondaryDvdImages) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepWaitForInstallToComplete ¶
func (*StepWaitForInstallToComplete) Cleanup ¶
func (s *StepWaitForInstallToComplete) Cleanup(state multistep.StateBag)
func (*StepWaitForInstallToComplete) Run ¶
func (s *StepWaitForInstallToComplete) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepWaitForPowerOff ¶
type StepWaitForPowerOff struct { }
func (*StepWaitForPowerOff) Cleanup ¶
func (s *StepWaitForPowerOff) Cleanup(state multistep.StateBag)
func (*StepWaitForPowerOff) Run ¶
func (s *StepWaitForPowerOff) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
Source Files ¶
- artifact.go
- config.go
- driver.go
- driver_mock.go
- driver_ps_4.go
- output_config.go
- output_config.hcl2spec.go
- ssh.go
- ssh_config.go
- step_clone_vm.go
- step_collate_artifacts.go
- step_compact_disk.go
- step_configure_ip.go
- step_configure_vlan.go
- step_create_build_dir.go
- step_create_external_switch.go
- step_create_switch.go
- step_create_vm.go
- step_disable_vlan.go
- step_enable_integration_service.go
- step_export_vm.go
- step_mount_dvddrive.go
- step_mount_floppydrive.go
- step_mount_guest_additions.go
- step_mount_secondary_dvd_images.go
- step_polling_installation.go
- step_reboot_vm.go
- step_resize_vhd.go
- step_run.go
- step_set_boot_order.go
- step_set_first_boot_device.go
- step_shutdown.go
- step_sleep.go
- step_type_boot_command.go
- step_unmount_dvddrive.go
- step_unmount_floppydrive.go
- step_unmount_guest_additions.go
- step_unmount_secondary_dvd_images.go
- step_wait_for_install_to_complete.go