clean up documentation for new NIC and storage params

adding examples, updating .gitattributes so *.mdx files have LF endings for windows
This commit is contained in:
Joshua Foster 2020-04-13 14:28:50 -04:00
parent a1d14c75f4
commit 7f0dbdebb2
6 changed files with 78 additions and 7 deletions

1
.gitattributes vendored
View File

@ -3,6 +3,7 @@
*.sh text eol=lf
*.json text eol=lf
*.md text eol=lf
*.mdx text eol=lf
*.ps1 text eol=lf
*.hcl text eol=lf
go.mod text eol=lf

View File

@ -13,6 +13,22 @@ import (
"github.com/hashicorp/packer/packer"
)
// Defines a Network Adapter
//
// Example that creates two network adapters:
//
// ```json
// "network_adapters": [
// {
// "network": "VM Network",
// "network_card": "vmxnet3"
// },
// {
// "network": "OtherNetwork",
// "network_card": "vmxnet3"
// }
// ],
// ```
type NIC struct {
// Set network VM will be connected to.
Network string `mapstructure:"network"`
@ -24,8 +40,23 @@ type NIC struct {
Passthrough *bool `mapstructure:"passthrough"`
}
// Defines the disk storage for a VM.
//
// Example that will create a 15GB and a 20GB disk on the VM. The second disk will be thin provisioned:
//
// ```json
// "storage": [
// {
// "disk_size": 15000,
// },
// {
// "disk_size": 20000,
// "disk_thin_provisioned": true
// }
// ],
// ```
type DiskConfig struct {
// Set the size of the disk
// The size of the disk in MB.
DiskSize int64 `mapstructure:"disk_size" required:"true"`
// Enable VMDK thin provisioning for VM. Defaults to `false`.
DiskThinProvisioned bool `mapstructure:"disk_thin_provisioned"`

View File

@ -105,12 +105,22 @@ from the datastore. Example:
### Network Adapter Configuration
@include 'builder/vsphere/iso/NIC.mdx'
@include 'builder/vsphere/iso/NIC-required.mdx'
#### Optional
@include 'builder/vsphere/iso/NIC-not-required.mdx'
### Storage Configuration
@include 'builder/vsphere/iso/DiskConfig.mdx'
@include 'builder/vsphere/iso/DiskConfig-required.mdx'
#### Optional
@include 'builder/vsphere/iso/DiskConfig-not-required.mdx'
### Floppy Configuration
@ -121,7 +131,7 @@ from the datastore. Example:
@include 'builder/vsphere/common/ExportConfig.mdx'
### Optional:
#### Optional:
@include 'builder/vsphere/common/ExportConfig-not-required.mdx'
@ -139,10 +149,6 @@ from the datastore. Example:
@include 'helper/communicator/Config-not-required.mdx'
#### Optional Network Adapter fields:
@include 'builder/vsphere/iso/NIC-not-required.mdx'
#### Optional SSH fields:
@include 'helper/communicator/SSH-not-required.mdx'

View File

@ -1,4 +1,4 @@
<!-- Code generated from the comments of the DiskConfig struct in builder/vsphere/iso/step_create.go; DO NOT EDIT MANUALLY -->
- `disk_size` (int64) - Set the size of the disk
- `disk_size` (int64) - The size of the disk in MB.

View File

@ -0,0 +1,16 @@
<!-- Code generated from the comments of the DiskConfig struct in builder/vsphere/iso/step_create.go; DO NOT EDIT MANUALLY -->
Defines the disk storage for a VM.
Example that will create a 15GB and a 20GB disk on the VM. The second disk will be thin provisioned:
```json
"storage": [
{
"disk_size": 15000,
},
{
"disk_size": 20000,
"disk_thin_provisioned": true
}
],
```

View File

@ -0,0 +1,17 @@
<!-- Code generated from the comments of the NIC struct in builder/vsphere/iso/step_create.go; DO NOT EDIT MANUALLY -->
Defines a Network Adapter
Example that creates two network adapters:
```json
"network_adapters": [
{
"network": "VM Network",
"network_card": "vmxnet3"
},
{
"network": "OtherNetwork",
"network_card": "vmxnet3"
}
],
```