From 24fad50b002b627610c8e424eaee6b6ca1b1e6b1 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 13 Jun 2019 16:31:20 +0200 Subject: [PATCH] hyperv-iso: document boot config, http & floppy from partials --- common/bootcommand/config.go | 17 ++++ .../docs/builders/hyperv-iso.html.md.erb | 88 +++---------------- .../common/bootcommand/_BootConfig.html.md | 17 ++++ 3 files changed, 48 insertions(+), 74 deletions(-) diff --git a/common/bootcommand/config.go b/common/bootcommand/config.go index e50c7288b..25ebb98e3 100644 --- a/common/bootcommand/config.go +++ b/common/bootcommand/config.go @@ -87,6 +87,23 @@ import ( // " ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg" // ] // ``` +// +// The example shown below is a working boot command used to start an Ubuntu +// 12.04 installer: +// +// ``` json +// [ +// "", +// "/install/vmlinuz noapic ", +// "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", +// "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", +// "hostname={{ .Name }} ", +// "fb=false debconf/frontend=noninteractive ", +// "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", +// "keyboard-configuration/variant=USA console-setup/ask_detect=false ", +// "initrd=/install/initrd.gz -- " +// ] +// ``` // For more examples of various boot commands, see the sample projects from our // [community templates page](/community-tools.html#templates). type BootConfig struct { diff --git a/website/source/docs/builders/hyperv-iso.html.md.erb b/website/source/docs/builders/hyperv-iso.html.md.erb index 7b55e5063..ab04d670b 100644 --- a/website/source/docs/builders/hyperv-iso.html.md.erb +++ b/website/source/docs/builders/hyperv-iso.html.md.erb @@ -72,19 +72,6 @@ builder. ### Optional: -- `boot_command` (array of strings) - This is an array of commands to type - when the virtual machine is first booted. The goal of these commands - should be to type just enough to initialize the operating system - installer. Special keys can be typed as well, and are covered in the - section below on the boot command. If this is not specified, it is assumed - the installer will start itself. - -- `boot_wait` (string) - The time to wait after booting the initial virtual - machine before typing the `boot_command`. The value specified should be - a duration. For example, setting a duration of "1m30s" would cause - Packer to wait for 1 minute 30 seconds before typing the boot command. - The default duration is "10s" (10 seconds). - - `configuration_version` (string) - This allows you to set the vm version when calling New-VM to generate the vm. @@ -126,24 +113,6 @@ builder. disable dynamic memory and have at least 4GB of RAM assigned to the virtual machine. -- `floppy_dirs` (array of strings) - A list of directories to place onto - the floppy disk recursively. This is similar to the `floppy_files` option - except that the directory structure is preserved. This is useful for when - your floppy disk includes drivers or if you just want to organize it's - contents as a hierarchy. Wildcard characters (\*, ?, and \[\]) are - allowed. The maximum summary size of all files in the listed directories - are the same as in `floppy_files`. - -- `floppy_files` (array of strings) - A list of files to place onto a floppy - disk that is attached when the VM is booted. This is most useful for - unattended Windows installs, which look for an `Autounattend.xml` file on - removable media. By default, no floppy will be attached. All files listed - in this setting get placed into the root directory of the floppy and the - floppy is attached as the first floppy device. Currently, no support - exists for creating sub-directories on the floppy. Wildcard characters - (`*`, `?`, and `[]`) are allowed. Directory names are also allowed, which - will add all the files found in the directory to the floppy. - - `generation` (number) - 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 @@ -162,21 +131,6 @@ builder. built. When this value is set to true, the machine will start without a console. -- `http_directory` (string) - Path to a directory to serve using Packers - inbuilt HTTP server. The files in this directory will be available - over HTTP to the virtual machine. This is useful for hosting kickstart - files and so on. By default this value is unset and the HTTP server is - not started. The address and port of the HTTP server will be available - as variables in `boot_command`. This is covered in more detail below. - -- `http_port_min` and `http_port_max` (number) - These are the minimum and - maximum port to use for the HTTP server started to serve the - `http_directory`. Since Packer often runs in parallel, a randomly - available port in this range will be repeatedly chosen until an - available port is found. To force the HTTP server to use a specific - port, set an identical value for `http_port_min` and `http_port_max`. - By default the values are 8000 and 9000, respectively. - - `mac_address` (string) - 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". @@ -267,41 +221,27 @@ builder. supported by various exotic operating systems, but this emulation requires additional overhead and should only be used if absolutely necessary. -## Boot Command +## Http directory configuration reference + +<%= partial "partials/common/HTTPConfig" %> +### Optional: + +<%= partial "partials/common/HTTPConfig-not-required" %> -The `boot_command` configuration is very important: it specifies the keys to -type when the virtual machine is first booted in order to start the OS -installer. This command is typed after `boot_wait`, which gives the virtual -machine some time to actually load the ISO. +## Floppy configuration reference -As documented above, the `boot_command` is an array of strings. The strings -are all typed in sequence. It is an array only to improve readability within -the template. +<%= partial "partials/common/FloppyConfig" %> -The boot command is "typed" character for character over the virtual keyboard -to the machine, simulating a human actually typing the keyboard. +### Optional: -<%= partial "partials/builders/boot-command" %> +<%= partial "partials/common/FloppyConfig-not-required" %> -The example shown below is a working boot command used to start an Ubuntu -12.04 installer: +## Boot Configuration Reference -``` json -[ - "", - "/install/vmlinuz noapic ", - "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", - "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", - "hostname={{ .Name }} ", - "fb=false debconf/frontend=noninteractive ", - "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", - "keyboard-configuration/variant=USA console-setup/ask_detect=false ", - "initrd=/install/initrd.gz -- " -] -``` +<%= partial "partials/common/bootcommand/BootConfig" %> -For more examples of various boot commands, see the sample projects from our -[community templates page](/community-tools.html#templates). +### Optional: +<%= partial "partials/common/bootcommand/BootConfig-not-required" %> ## Integration Services diff --git a/website/source/partials/common/bootcommand/_BootConfig.html.md b/website/source/partials/common/bootcommand/_BootConfig.html.md index 8ce26b472..fec7504e9 100644 --- a/website/source/partials/common/bootcommand/_BootConfig.html.md +++ b/website/source/partials/common/bootcommand/_BootConfig.html.md @@ -76,5 +76,22 @@ CentOS 6.4 installer: " ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg" ] ``` + +The example shown below is a working boot command used to start an Ubuntu +12.04 installer: + +``` json +[ + "", + "/install/vmlinuz noapic ", + "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", + "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", + "hostname={{ .Name }} ", + "fb=false debconf/frontend=noninteractive ", + "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", + "keyboard-configuration/variant=USA console-setup/ask_detect=false ", + "initrd=/install/initrd.gz -- " +] +``` For more examples of various boot commands, see the sample projects from our [community templates page](/community-tools.html#templates).