resource "vsphere_virtual_machine" "TF-Windows2019" { name = "TF-Windows2019" resource_pool_id = data.vsphere_resource_pool.pool.id datastore_id = data.vsphere_datastore.vmdatastore.id folder = var.vsphere_vmfolder num_cpus = 2 memory = 4096 network_interface { network_id = data.vsphere_network.network.id } disk { label = "disk0" unit_number = 0 size = 150 thin_provisioned = true } disk { label = "disk1" unit_number = 1 size = 225 thin_provisioned = true } vapp { properties = { "guestinfo.hostname" = "<>" "guestinfo.ipaddress" = "<>" "guestinfo.netmask" = "<>" "guestinfo.gateway" = "<>" "guestinfo.dns" = "<>" "guestinfo.domain_name" = "<>" "guestinfo.ntp" = "<>" "guestinfo.enable_domain_join" = "<>" "guestinfo.domain_short_name" = "<>" "guestinfo.domain_join_user" = "<>" "guestinfo.domain_join_password" = "<>" "guestinfo.domain_controller" = "<>" "guestinfo.viadmin_password" = "<>" "guestinfo.viuser_password" = "<>" "guestinfo.viservice_password" = "<>" "guestinfo.project_name" = "<>" "guestinfo.monitor_server" = "<>" } } clone { template_uuid = vsphere_content_library_item.Server2019.id } # # This does not actually achieve protection from destruction, see https://github.com/hashicorp/terraform/issues/17599 # lifecycle { # prevent_destroy = true # } }