Skip to content

Commit

Permalink
docs: vsphere_virtual_machine updated disks info
Browse files Browse the repository at this point in the history
`resource/vsphere_virtual_machine`: Updates to fix examples of `disk0` to reflect that during import the disk get set back to default like `Hard Disk 1`.

Signed-off-by: Jared Burns <[email protected]>
  • Loading branch information
burnsjared0415 authored and tenthirtyam committed Oct 8, 2024
1 parent c734c4d commit 9d2f92a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ DOCUMENTATION:
- `resource/vsphere_resource_pool`: Updates to include steps to create resource pool on standalone ESXi hosts.
([#2264](https://github.com/hashicorp/terraform-provider-vsphere/pull/2264))

- `resource/vsphere_virtual_machine`: Updates to fix examples of `disk0` to reflect that during import the disk get set back to default like `Hard Disk 1`.
[#2272](https://github.com/hashicorp/terraform-provider-vsphere/pull/2272)

## 2.9.2 (September 16, 2024)

BUG FIX:
Expand Down
20 changes: 11 additions & 9 deletions website/docs/r/virtual_machine.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ resource "vsphere_virtual_machine" "vm" {
network_id = data.vsphere_network.network.id
}
disk {
label = "disk0"
label = "Hard Disk 1"
size = 20
}
}
Expand Down Expand Up @@ -160,7 +160,7 @@ resource "vsphere_virtual_machine" "vm" {
adapter_type = data.vsphere_virtual_machine.template.network_interface_types[0]
}
disk {
label = "disk0"
label = "Hard Disk 1"
size = data.vsphere_virtual_machine.template.disks.0.size
thin_provisioned = data.vsphere_virtual_machine.template.disks.0.thin_provisioned
}
Expand Down Expand Up @@ -541,7 +541,7 @@ resource "vsphere_virtual_machine" "vm" {
adapter_type = data.vsphere_virtual_machine.template.network_interface_types[0]
}
disk {
name = "disk0"
name = "Hard Disk 1"
size = data.vsphere_virtual_machine.template_from_ovf.disks.0.size
thin_provisioned = data.vsphere_virtual_machine.template_from_ovf.disks.0.thin_provisioned
}
Expand Down Expand Up @@ -610,7 +610,7 @@ resource "vsphere_virtual_machine" "vm" {
network_id = data.vsphere_network.network.id
}
disk {
label = "disk0"
label = "Hard Disk 1"
size = 20
}
}
Expand Down Expand Up @@ -862,11 +862,11 @@ The following example demonstrates and abridged multi-disk configuration:
resource "vsphere_virtual_machine" "vm" {
# ... other configuration ...
disk {
label = "disk0"
label = "Hard Disk 1"
size = "10"
}
disk {
label = "disk1"
label = "Hard Disk 2"
size = "100"
unit_number = 1
}
Expand Down Expand Up @@ -1545,12 +1545,12 @@ resource "vsphere_virtual_machine" "vm" {
# ... other configuration ...
datastore_id = data.vsphere_datastore.vm_datastore.id
disk {
label = "disk0"
label = "Hard Disk 1"
size = 10
}
disk {
datastore_id = data.vsphere_datastore.pinned_datastore.id
label = "disk1"
label = "Hard Disk 2"
size = 100
unit_number = 1
}
Expand Down Expand Up @@ -1661,7 +1661,9 @@ Many of the requirements for [cloning](#additional-requirements-and-notes-for-cl

The following requirements apply to import:

* The disks must have a [`label`](#label) argument assigned in a convention matching `diskN`, starting with disk number 0, based on each virtual disk order on the SCSI bus. As an example, a disk on SCSI controller `0` with a unit number of `0` would be labeled as `disk0`, a disk on the same controller with a unit number of `1` would be `disk1`, but the next disk, which is on SCSI controller `1` with a unit number of `0`, still becomes `disk2`.
* The disks must have a [`label`](#label) argument assigned in a convention matching `Hard Disk`, starting with disk number 0, based on each virtual disk order on the SCSI bus. As an example, a disk on SCSI controller `0` with a unit number of `0` would be labeled as `Hard Disk 0`, a disk on the same controller with a unit number of `1` would be `Hard Disk 1`, but the next disk, which is on SCSI controller `1` with a unit number of `0`, still becomes `Hard Disk 2`.

~> **NOTE:** Any custom `label` set at deployment of machine through Terraform, on import will not have the custom `label` and will default to `Hard Disk _x_`.

* Disks are always imported with [`keep_on_remove`](#keep_on_remove) enabled until the first `terraform apply` run which will remove the setting for known disks. This process safeguards against naming or accounting mistakes in the disk configuration.

Expand Down

0 comments on commit 9d2f92a

Please sign in to comment.