Skip to content

Commit

Permalink
docs: update disk configuration (#225)
Browse files Browse the repository at this point in the history
Updates the disk configuration documentation for clarity and readability.

Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
  • Loading branch information
tenthirtyam authored Jul 17, 2024
1 parent 7fa57d8 commit 087d9a9
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 120 deletions.
61 changes: 29 additions & 32 deletions .web-docs/components/builder/iso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,49 +129,46 @@ necessary for this build to succeed and can be found further down the page.

<!-- Code generated from the comments of the DiskConfig struct in builder/vmware/common/disk_config.go; DO NOT EDIT MANUALLY -->

- `disk_additional_size` ([]uint) - The size(s) of any additional
hard disks for the VM in megabytes. If this is not specified then the VM
will only contain a primary hard disk. The builder uses expandable, not
fixed-size virtual hard disks, so the actual file representing the disk will
not use the full size unless it is full.

- `disk_adapter_type` (string) - The adapter type of the VMware virtual disk to create. This option is
for advanced usage, modify only if you know what you're doing. Some of
the options you can specify are `ide`, `sata`, `nvme` or `scsi` (which
uses the "lsilogic" scsi interface by default). If you specify another
option, Packer will assume that you're specifying a `scsi` interface of
that specified type. For more information, please consult [Virtual Disk
Manager User's Guide](http://www.vmware.com/pdf/VirtualDiskManager.pdf)
for desktop VMware clients. For ESXi, refer to the proper ESXi
documentation.

- `vmdk_name` (string) - The filename of the virtual disk that'll be created,
without the extension. This defaults to "disk".

- `disk_type_id` (string) - The type of VMware virtual disk to create. This
option is for advanced usage.

For desktop VMware clients:
- `disk_additional_size` ([]uint) - The size(s) of additional virtual hard disks in MB. If not specified,
the virtual machine will contain only a primary hard disk.

- `disk_adapter_type` (string) - The adapter type for additional virtual disk(s). Available options
are `ide`, `sata`, `nvme`, or `scsi`.

~> **Note:** When specifying `scsi` as the adapter type, the default
adapter type is set to `lsilogic`. If another option is specified, the
plugin will assume it is a `scsi` interface of that specified type.

~> **Note:** This option is intended for advanced users.

- `vmdk_name` (string) - The filename for the virtual disk to create _without_ the `.vmdk`
extension. Defaults to `disk`.

- `disk_type_id` (string) - The type of virtual disk to create.

For local desktop hypervisors, the available options are:

Type ID | Description
------- | ---
`0` | Growable virtual disk contained in a single file (monolithic sparse).
`1` | Growable virtual disk split into 2GB files (split sparse).
`2` | Preallocated virtual disk contained in a single file (monolithic flat).
`3` | Preallocated virtual disk split into 2GB files (split flat).
`4` | Preallocated virtual disk compatible with ESX server (VMFS flat).
`4` | Preallocated virtual disk compatible with ESXi (VMFS flat).
`5` | Compressed disk optimized for streaming.

The default is `1`.
Defaults to `1`.

For remote hypervisors, the available options are: `zeroedthick`,
`eagerzeroedthick`, and `thin`. Defaults to `zeroedthick`.

~> **Note:** The `rdm:dev`, `rdmp:dev`, and `2gbsparse` types are not
supported for remote hypervisors.

For ESXi, this defaults to `zeroedthick`. The available options for ESXi
are: `zeroedthick`, `eagerzeroedthick`, `thin`. `rdm:dev`, `rdmp:dev`,
`2gbsparse` are not supported. Due to default disk compaction, when using
`zeroedthick` or `eagerzeroedthick` set `skip_compaction` to `true`.
~> **Note:** Set `skip_compaction` to `true` when using `zeroedthick`
or `eagerzeroedthick` due to default disk compaction behavior.

For more information, please consult the [Virtual Disk Manager User's
Guide](https://www.vmware.com/pdf/VirtualDiskManager.pdf) for desktop
VMware clients. For ESXi, refer to the proper ESXi documentation.
~> **Note:** This option is intended for advanced users.

<!-- End of code generated from the comments of the DiskConfig struct in builder/vmware/common/disk_config.go; -->

Expand Down
59 changes: 28 additions & 31 deletions .web-docs/components/builder/vmx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,49 +121,46 @@ necessary for this build to succeed and can be found further down the page.

<!-- Code generated from the comments of the DiskConfig struct in builder/vmware/common/disk_config.go; DO NOT EDIT MANUALLY -->

- `disk_additional_size` ([]uint) - The size(s) of any additional
hard disks for the VM in megabytes. If this is not specified then the VM
will only contain a primary hard disk. The builder uses expandable, not
fixed-size virtual hard disks, so the actual file representing the disk will
not use the full size unless it is full.

- `disk_adapter_type` (string) - The adapter type of the VMware virtual disk to create. This option is
for advanced usage, modify only if you know what you're doing. Some of
the options you can specify are `ide`, `sata`, `nvme` or `scsi` (which
uses the "lsilogic" scsi interface by default). If you specify another
option, Packer will assume that you're specifying a `scsi` interface of
that specified type. For more information, please consult [Virtual Disk
Manager User's Guide](http://www.vmware.com/pdf/VirtualDiskManager.pdf)
for desktop VMware clients. For ESXi, refer to the proper ESXi
documentation.

- `vmdk_name` (string) - The filename of the virtual disk that'll be created,
without the extension. This defaults to "disk".

- `disk_type_id` (string) - The type of VMware virtual disk to create. This
option is for advanced usage.
- `disk_additional_size` ([]uint) - The size(s) of additional virtual hard disks in MB. If not specified,
the virtual machine will contain only a primary hard disk.

- `disk_adapter_type` (string) - The adapter type for additional virtual disk(s). Available options
are `ide`, `sata`, `nvme`, or `scsi`.

~> **Note:** When specifying `scsi` as the adapter type, the default
adapter type is set to `lsilogic`. If another option is specified, the
plugin will assume it is a `scsi` interface of that specified type.

For desktop VMware clients:
~> **Note:** This option is intended for advanced users.

- `vmdk_name` (string) - The filename for the virtual disk to create _without_ the `.vmdk`
extension. Defaults to `disk`.

- `disk_type_id` (string) - The type of virtual disk to create.

For local desktop hypervisors, the available options are:

Type ID | Description
------- | ---
`0` | Growable virtual disk contained in a single file (monolithic sparse).
`1` | Growable virtual disk split into 2GB files (split sparse).
`2` | Preallocated virtual disk contained in a single file (monolithic flat).
`3` | Preallocated virtual disk split into 2GB files (split flat).
`4` | Preallocated virtual disk compatible with ESX server (VMFS flat).
`4` | Preallocated virtual disk compatible with ESXi (VMFS flat).
`5` | Compressed disk optimized for streaming.

The default is `1`.
Defaults to `1`.

For remote hypervisors, the available options are: `zeroedthick`,
`eagerzeroedthick`, and `thin`. Defaults to `zeroedthick`.

~> **Note:** The `rdm:dev`, `rdmp:dev`, and `2gbsparse` types are not
supported for remote hypervisors.

For ESXi, this defaults to `zeroedthick`. The available options for ESXi
are: `zeroedthick`, `eagerzeroedthick`, `thin`. `rdm:dev`, `rdmp:dev`,
`2gbsparse` are not supported. Due to default disk compaction, when using
`zeroedthick` or `eagerzeroedthick` set `skip_compaction` to `true`.
~> **Note:** Set `skip_compaction` to `true` when using `zeroedthick`
or `eagerzeroedthick` due to default disk compaction behavior.

For more information, please consult the [Virtual Disk Manager User's
Guide](https://www.vmware.com/pdf/VirtualDiskManager.pdf) for desktop
VMware clients. For ESXi, refer to the proper ESXi documentation.
~> **Note:** This option is intended for advanced users.

<!-- End of code generated from the comments of the DiskConfig struct in builder/vmware/common/disk_config.go; -->

Expand Down
54 changes: 25 additions & 29 deletions builder/vmware/common/disk_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,46 @@ import (
)

type DiskConfig struct {
// The size(s) of any additional
// hard disks for the VM in megabytes. If this is not specified then the VM
// will only contain a primary hard disk. The builder uses expandable, not
// fixed-size virtual hard disks, so the actual file representing the disk will
// not use the full size unless it is full.
// The size(s) of additional virtual hard disks in MB. If not specified,
// the virtual machine will contain only a primary hard disk.
AdditionalDiskSize []uint `mapstructure:"disk_additional_size" required:"false"`
// The adapter type of the VMware virtual disk to create. This option is
// for advanced usage, modify only if you know what you're doing. Some of
// the options you can specify are `ide`, `sata`, `nvme` or `scsi` (which
// uses the "lsilogic" scsi interface by default). If you specify another
// option, Packer will assume that you're specifying a `scsi` interface of
// that specified type. For more information, please consult [Virtual Disk
// Manager User's Guide](http://www.vmware.com/pdf/VirtualDiskManager.pdf)
// for desktop VMware clients. For ESXi, refer to the proper ESXi
// documentation.
// The adapter type for additional virtual disk(s). Available options
// are `ide`, `sata`, `nvme`, or `scsi`.
//
// ~> **Note:** When specifying `scsi` as the adapter type, the default
// adapter type is set to `lsilogic`. If another option is specified, the
// plugin will assume it is a `scsi` interface of that specified type.
//
// ~> **Note:** This option is intended for advanced users.
DiskAdapterType string `mapstructure:"disk_adapter_type" required:"false"`
// The filename of the virtual disk that'll be created,
// without the extension. This defaults to "disk".
// The filename for the virtual disk to create _without_ the `.vmdk`
// extension. Defaults to `disk`.
DiskName string `mapstructure:"vmdk_name" required:"false"`
// The type of VMware virtual disk to create. This
// option is for advanced usage.
// The type of virtual disk to create.
//
// For desktop VMware clients:
// For local desktop hypervisors, the available options are:
//
// Type ID | Description
// ------- | ---
// `0` | Growable virtual disk contained in a single file (monolithic sparse).
// `1` | Growable virtual disk split into 2GB files (split sparse).
// `2` | Preallocated virtual disk contained in a single file (monolithic flat).
// `3` | Preallocated virtual disk split into 2GB files (split flat).
// `4` | Preallocated virtual disk compatible with ESX server (VMFS flat).
// `4` | Preallocated virtual disk compatible with ESXi (VMFS flat).
// `5` | Compressed disk optimized for streaming.
//
// The default is `1`.
// Defaults to `1`.
//
// For remote hypervisors, the available options are: `zeroedthick`,
// `eagerzeroedthick`, and `thin`. Defaults to `zeroedthick`.
//
// ~> **Note:** The `rdm:dev`, `rdmp:dev`, and `2gbsparse` types are not
// supported for remote hypervisors.
//
// For ESXi, this defaults to `zeroedthick`. The available options for ESXi
// are: `zeroedthick`, `eagerzeroedthick`, `thin`. `rdm:dev`, `rdmp:dev`,
// `2gbsparse` are not supported. Due to default disk compaction, when using
// `zeroedthick` or `eagerzeroedthick` set `skip_compaction` to `true`.
// ~> **Note:** Set `skip_compaction` to `true` when using `zeroedthick`
// or `eagerzeroedthick` due to default disk compaction behavior.
//
// For more information, please consult the [Virtual Disk Manager User's
// Guide](https://www.vmware.com/pdf/VirtualDiskManager.pdf) for desktop
// VMware clients. For ESXi, refer to the proper ESXi documentation.
// ~> **Note:** This option is intended for advanced users.
DiskTypeId string `mapstructure:"disk_type_id" required:"false"`
}

Expand All @@ -64,7 +61,6 @@ func (c *DiskConfig) Prepare(ctx *interpolate.Context) []error {
}

if c.DiskAdapterType == "" {
// Default is lsilogic
c.DiskAdapterType = "lsilogic"
}

Expand Down
53 changes: 25 additions & 28 deletions docs-partials/builder/vmware/common/DiskConfig-not-required.mdx
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
<!-- Code generated from the comments of the DiskConfig struct in builder/vmware/common/disk_config.go; DO NOT EDIT MANUALLY -->

- `disk_additional_size` ([]uint) - The size(s) of any additional
hard disks for the VM in megabytes. If this is not specified then the VM
will only contain a primary hard disk. The builder uses expandable, not
fixed-size virtual hard disks, so the actual file representing the disk will
not use the full size unless it is full.
- `disk_additional_size` ([]uint) - The size(s) of additional virtual hard disks in MB. If not specified,
the virtual machine will contain only a primary hard disk.

- `disk_adapter_type` (string) - The adapter type of the VMware virtual disk to create. This option is
for advanced usage, modify only if you know what you're doing. Some of
the options you can specify are `ide`, `sata`, `nvme` or `scsi` (which
uses the "lsilogic" scsi interface by default). If you specify another
option, Packer will assume that you're specifying a `scsi` interface of
that specified type. For more information, please consult [Virtual Disk
Manager User's Guide](http://www.vmware.com/pdf/VirtualDiskManager.pdf)
for desktop VMware clients. For ESXi, refer to the proper ESXi
documentation.
- `disk_adapter_type` (string) - The adapter type for additional virtual disk(s). Available options
are `ide`, `sata`, `nvme`, or `scsi`.

~> **Note:** When specifying `scsi` as the adapter type, the default
adapter type is set to `lsilogic`. If another option is specified, the
plugin will assume it is a `scsi` interface of that specified type.

~> **Note:** This option is intended for advanced users.

- `vmdk_name` (string) - The filename of the virtual disk that'll be created,
without the extension. This defaults to "disk".
- `vmdk_name` (string) - The filename for the virtual disk to create _without_ the `.vmdk`
extension. Defaults to `disk`.

- `disk_type_id` (string) - The type of VMware virtual disk to create. This
option is for advanced usage.
- `disk_type_id` (string) - The type of virtual disk to create.

For desktop VMware clients:
For local desktop hypervisors, the available options are:

Type ID | Description
------- | ---
`0` | Growable virtual disk contained in a single file (monolithic sparse).
`1` | Growable virtual disk split into 2GB files (split sparse).
`2` | Preallocated virtual disk contained in a single file (monolithic flat).
`3` | Preallocated virtual disk split into 2GB files (split flat).
`4` | Preallocated virtual disk compatible with ESX server (VMFS flat).
`4` | Preallocated virtual disk compatible with ESXi (VMFS flat).
`5` | Compressed disk optimized for streaming.

The default is `1`.
Defaults to `1`.

For remote hypervisors, the available options are: `zeroedthick`,
`eagerzeroedthick`, and `thin`. Defaults to `zeroedthick`.

~> **Note:** The `rdm:dev`, `rdmp:dev`, and `2gbsparse` types are not
supported for remote hypervisors.

For ESXi, this defaults to `zeroedthick`. The available options for ESXi
are: `zeroedthick`, `eagerzeroedthick`, `thin`. `rdm:dev`, `rdmp:dev`,
`2gbsparse` are not supported. Due to default disk compaction, when using
`zeroedthick` or `eagerzeroedthick` set `skip_compaction` to `true`.
~> **Note:** Set `skip_compaction` to `true` when using `zeroedthick`
or `eagerzeroedthick` due to default disk compaction behavior.

For more information, please consult the [Virtual Disk Manager User's
Guide](https://www.vmware.com/pdf/VirtualDiskManager.pdf) for desktop
VMware clients. For ESXi, refer to the proper ESXi documentation.
~> **Note:** This option is intended for advanced users.

<!-- End of code generated from the comments of the DiskConfig struct in builder/vmware/common/disk_config.go; -->

0 comments on commit 087d9a9

Please sign in to comment.