josenk / terraform-provider-esxi

Terraform-provider-esxi plugin
GNU General Public License v3.0
538 stars 154 forks source link

Clone all disk not cloned #179

Closed Demonium closed 1 year ago

Demonium commented 2 years ago

Describe the bug When cloning a system with multiple hard disk only the first one is cloned.

To Reproduce Steps to reproduce the behavior:

  1. terraform plan/apply/
  2. no error

Expected behavior A full copy of the original system (all disks)

Terraform files resource "esxi_guest" "vmtest02" { guest_name = "vmtest02" disk_store = "datastore1" guestos = "centos-64"

memsize = "2048" numvcpus = "2" resource_pool_name = "/" power = "on"

clone_from_vm = "centos7"

network_interfaces { virtual_network = "VM Network" } guest_startup_timeout = 45 guest_shutdown_timeout = 30 }

Desktop (please complete the following information):

Additional context none

Demonium commented 2 years ago

Hello, Additionnal information: during the cloning phase the disk contains the good size in the parameters, once the clone is finish the disk hasn't got the good size and the second disk is not displayed

josenk commented 2 years ago

This is expected behavior. This terraform provider manages the vm and is also able to manage all the additional disks. If a disk was unexpectedly copied during a clone, terraform considers this as something created outside it's management and would 'make it right' by deleting it, or overwritting it. It would be a nightmare to trying to support a use-case like this.

Demonium commented 2 years ago

Si if i understand I have to request terraform to add New disk instead of cloning it I’m right ?

josenk commented 2 years ago

correct.