diff --git a/builder/vmware/iso/step_create_vmx.go b/builder/vmware/iso/step_create_vmx.go index 0261123a6..207d38caa 100644 --- a/builder/vmware/iso/step_create_vmx.go +++ b/builder/vmware/iso/step_create_vmx.go @@ -196,6 +196,9 @@ func unformat_serial(config string) (*serialUnion, error) { return &serialUnion{serialType: res, auto: res}, nil + case "NONE": + return &serialUnion{serialType: nil}, nil + default: return nil, fmt.Errorf("Unknown serial type : %s : %s", strings.ToUpper(formatType), config) } @@ -270,7 +273,11 @@ func unformat_parallel(config string) (*parallelUnion, error) { return nil, fmt.Errorf("Unknown parallel port direction : %s : %s", strings.ToUpper(formatOptions), config) } return ¶llelUnion{parallelType: res, auto: res}, nil + + case "NONE": + return ¶llelUnion{parallelType: nil}, nil } + return nil, fmt.Errorf("Unexpected format for parallel port: %s", config) } @@ -431,6 +438,8 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist templateData.Serial_Filename = filepath.FromSlash(serial.auto.devicename) templateData.Serial_Yield = serial.auto.yield templateData.Serial_Auto = "TRUE" + case nil: + break default: err := fmt.Errorf("Error procesing VMX template: %v", serial) @@ -463,6 +472,9 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist templateData.Parallel_Present = "TRUE" templateData.Parallel_Auto = "TRUE" templateData.Parallel_Bidirectional = parallel.auto.bidirectional + case nil: + break + default: err := fmt.Errorf("Error procesing VMX template: %v", parallel) state.Put("error", err) diff --git a/website/source/docs/builders/vmware-iso.html.md b/website/source/docs/builders/vmware-iso.html.md index 44285a850..95ab31bef 100644 --- a/website/source/docs/builders/vmware-iso.html.md +++ b/website/source/docs/builders/vmware-iso.html.md @@ -207,7 +207,7 @@ builder. - `parallel` (string) - This specifies a parallel port to add to the VM. It has the format of `Type:option1,option2,...`. Type can be one of the - following values: "FILE", "DEVICE", or "AUTO". + following values: "FILE", "DEVICE", "AUTO", or "NONE". * `FILE:path` - Specifies the path to the local file to be used for the parallel port. @@ -217,6 +217,7 @@ builder. parallel port. Direction can be `BI` to specify bidirectional communication or `UNI` to specify unidirectional communication. + * `NONE` - Specifies to not use a parallel port. (default) - `remote_cache_datastore` (string) - The path to the datastore where supporting files will be stored during the build on the remote machine. By @@ -254,7 +255,7 @@ builder. - `serial` (string) - This specifies a serial port to add to the VM. It has a format of `Type:option1,option2,...`. The field `Type` can be one - of the following values: `FILE`, `DEVICE`, `PIPE`, or `AUTO`. + of the following values: `FILE`, `DEVICE`, `PIPE`, `AUTO`, or `NONE`. * `FILE:path(,yield)` - Specifies the path to the local file to be used as the serial port. @@ -285,6 +286,7 @@ builder. * `yield` (bool) - This is an optional boolean that specifies whether the vm should yield the cpu when polling the port. By default, the builder will assume this as `FALSE`. + * `NONE` - Specifies to not use a serial port. (default) - `shutdown_command` (string) - The command to use to gracefully shut down the machine once all the provisioning is done. By default this is an empty