forked from hashicorp/packer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add vsphere postprocessor example in json and hcl (hashicorp#9669)
* add vsphere postprocessor example in json and hcl * Update website/pages/docs/post-processors/vsphere.mdx Co-authored-by: Adrien Delorme <[email protected]>
- Loading branch information
1 parent
568b3c1
commit 5b26f1b
Showing
1 changed file
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,9 @@ each category, the available configuration keys are alphabetized. | |
|
||
Required: | ||
|
||
- `cluster` (string) - The cluster to upload the VM to. If you do not have a | ||
cluster defined, you can instead provide the IP address of the esx host | ||
that you want to upload to. | ||
- `cluster` (string) - The cluster or host to upload the VM to. This can be | ||
either the name of the cluster, or the IP address of the esx host that you | ||
want to upload to. | ||
|
||
- `datacenter` (string) - The name of the datacenter within vSphere to add | ||
the VM to. | ||
|
@@ -71,3 +71,81 @@ Optional: | |
|
||
- `options` (array of strings) - Custom options to add in ovftool. See | ||
`ovftool --help` to list all the options | ||
|
||
# Example | ||
|
||
The following is an example of the vSphere post-processor being used in | ||
conjunction with the null builder and artifice post-processor to upload a vmx | ||
to a vSphere cluster. | ||
|
||
You can also use this post-processor with the vmx artifact from a vmware build. | ||
|
||
<Tabs> | ||
<Tab heading="JSON"> | ||
|
||
``` json | ||
{ | ||
"builders": [ | ||
{ | ||
"type": "null", | ||
"communicator": "none" | ||
} | ||
], | ||
"post-processors": [ | ||
[ | ||
{ | ||
"type": "artifice", | ||
"files":["output-vmware-iso/packer-vmware-iso.vmx"] | ||
}, | ||
{ | ||
"type": "vsphere", | ||
"keep_input_artifact": true, | ||
"vm_name": "packerparty", | ||
"vm_network": "VM Network", | ||
"cluster": "123.45.678.1", | ||
"datacenter": "PackerDatacenter", | ||
"datastore": "datastore1", | ||
"host": "123.45.678.9", | ||
"password": "SuperSecretPassword", | ||
"username": "[email protected]" | ||
} | ||
] | ||
] | ||
} | ||
``` | ||
|
||
</Tab> | ||
<Tab heading="HCL2"> | ||
|
||
```hcl | ||
source "null" "example" { | ||
communicator = "none" | ||
} | ||
build { | ||
sources = [ | ||
"source.null.example" | ||
] | ||
post-processors{ | ||
post-processor "artifice"{ | ||
files = ["output-vmware-iso/packer-vmware-iso.vmx"] | ||
} | ||
post-processor "vsphere"{ | ||
keep_input_artifact = true | ||
vm_name = "packerparty" | ||
vm_network = "VM Network" | ||
cluster = "123.45.678.1" | ||
datacenter = "PackerDatacenter" | ||
datastore = "datastore1" | ||
host = "123.45.678.9" | ||
password = "SuperSecretPassword" | ||
username = "[email protected]" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
</Tab> | ||
</Tabs> |