0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +00:00

chore(docs)!: clarify disk behaviour in clone operation (#1850)

This is a "meta" PR to bump the minor version due potentially breaking changes from #1840.

See documentation for more details.

> When cloning an existing virtual machine, whether it's a template or not, the
> resource will inherit the disks and other configuration from the source VM.
>
> *If* you modify any attributes of an existing disk in the clone, you also need to
> explicitly provide values for any other attributes that differ from the schema defaults
> in the source (e.g., `size`, `discard`, `cache`, `aio`).
> Otherwise, the schema defaults will take effect and override the source values.

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2025-03-26 14:48:13 -04:00 committed by GitHub
parent 09d3e97d02
commit 75281b2652
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -636,8 +636,12 @@ If you do not have `local-lvm` configured in your environment, you may need to e
### Cloning
When cloning an existing virtual machine, whether it's a template or not, the
resource will only detect changes to the arguments which are not set to their
default values.
resource will inherit the disks and other configuration from the source VM.
*If* you modify any attributes of an existing disk in the clone, you also need to
explicitly provide values for any other attributes that differ from the schema defaults
in the source (e.g., `size`, `discard`, `cache`, `aio`).
Otherwise, the schema defaults will take effect and override the source values.
Furthermore, when cloning from one node to a different one, the behavior changes
depening on the datastores of the source VM. If at least one non-shared
@ -645,7 +649,7 @@ datastore is used, the VM is first cloned to the source node before being
migrated to the target node. This circumvents a limitation in the Proxmox clone
API.
**Note:** Because the migration step after the clone tries to preserve the used
Because the migration step after the clone tries to preserve the used
datastores by their name, it may fail if a datastore used in the source VM is
not available on the target node (e.g. `local-lvm` is used on the source node in
the VM but no `local-lvm` datastore is available on the target node). In this

View File

@ -372,7 +372,6 @@ func (d *CustomStorageDevice) UnmarshalJSON(b []byte) error {
// - FileID
// - FileVolume
// - Format
// - Size
//
// It will return true if any attribute of the current CustomStorageDevice was changed.
func (d *CustomStorageDevice) MergeWith(m CustomStorageDevice) bool {