From 1a7804221e673407b7f87747b4d4efc312fa20b9 Mon Sep 17 00:00:00 2001 From: DanHam Date: Thu, 19 Jul 2018 23:38:33 +0100 Subject: [PATCH] Minor fixes, changes and improvements to Hyper-V VMCX docs --- .../docs/builders/hyperv-vmcx.html.md.erb | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/website/source/docs/builders/hyperv-vmcx.html.md.erb b/website/source/docs/builders/hyperv-vmcx.html.md.erb index f509463c4..040f86217 100644 --- a/website/source/docs/builders/hyperv-vmcx.html.md.erb +++ b/website/source/docs/builders/hyperv-vmcx.html.md.erb @@ -22,18 +22,18 @@ boots it, provisions software within the OS, and then shuts it down. The result of the Hyper-V builder is a directory containing all the files necessary to run the virtual machine portably. -## Basic Example +## Basic Examples -Here is a basic example. This example is not functional. It will start the OS -installer but then fail because we don't provide the preseed file for Ubuntu -to self-install. Still, the example serves to show the basic configuration: +Here are some basic examples. Neither example would really do anything more +than producing a copy of the source virtual machine. However, the examples +could be used as a starting point for more advanced templates. Import from folder: ``` json { "type": "hyperv-vmcx", - "clone_from_vmcx_path": "c:\\virtual machines\\ubuntu-12.04.5-server-amd64", + "clone_from_vmcx_path": "c:/virtual machines/ubuntu-12.04.5-server-amd64", "ssh_username": "packer", "ssh_password": "packer", "shutdown_command": "echo 'packer' | sudo -S shutdown -P now" @@ -71,12 +71,14 @@ builder. ### Required for virtual machine import: -- `clone_from_vmcx_path` (string) - The path to the exported virtual machine - folder. +- `clone_from_vmcx_path` (string) - The path to a directory containing a + previously exported virtual machine. The exported machine will be used + as the source for new VM. + ### Required for virtual machine clone: -- `clone_from_vm_name` (string) - The name of the vm to clone from. Ideally +- `clone_from_vm_name` (string) - The name of the VM to clone from. Ideally the machine to clone from should be shutdown. ### Optional: @@ -94,11 +96,25 @@ builder. Packer to wait for 1 minute 30 seconds before typing the boot command. The default duration is "10s" (10 seconds). -- `clone_all_snapshots` (boolean) - If set to `true` all snapshots will be - cloned when the machine is cloned. +- `clone_all_snapshots` (boolean) - If set to `true` all snapshots + present in the source machine will be copied when the machine is + cloned. The final result of the build will be an exported virtual + machine that contains all the snapshots of the parent. + + If `clone_from_vmcx_path` is set, this setting has no effect and any + snapshots associated with the source VM will also be present in the + resultant VM. + + If `clone_from_snapshot_name` is configured, this setting has no + effect and the resultant machine will not contain any snapshots. + +- `clone_from_snapshot_name` (string) - The name of a snapshot in the + source machine to use as a starting point for the clone. If the value + given is an empty string, the last snapshot present in the source will + be chosen as the starting point for the new VM. -- `clone_from_snapshot_name` (string) - The name of the snapshot to clone - from. + This setting only has an effect if using `clone_from_vm_name` and is + ignored otherwise. - `cpu` (number) - The number of CPUs the virtual machine should use. If this isn't specified, the default is 1 CPU.