After writing initial Terraform code to clone VMware Virtual Machine template Using terraform to clone a virtual machine on VMware vSphere infrastructure, There was a requirement to clone Linux and Windows Virtual Machines using the single TF file and it must create multiple VMs from map hash table list. To achieve this task I converted my existing earlier written script to Module format.
Below are my Terraform files and folders tree structure. Here you need to make changes to root the folder's files - credentials.tf and main.tf.
Add vCenter server IP/FQDN, authentication information UserName and Password in credentials.tf file. In main.tf file add datacenter, cluster, network, datastore, vm template image names. Add new vm information such as new name, cpu, memory and os in map hash table.
Download Terraform_Module_Clone_VMs_Linux_Windows.zip script here or it is also available github.com/janviudapi.
#Login authentication information for vCenter server #Root folder: credentials.tf Changes required with red variable "vCenter_user" { description = "Username to connect to vCenter Server" type = string default = "[email protected]" } variable "vCenter_password" { description = "Password to connect to vCenter Server" type = string default = "Computer@123" } variable "vCenter_server" { description = "IP or DNS name to connect to vCenter server" type = string default = "192.168.34.20" } #Terraform vSphere plugin provider and login to vCenter Server #Root folder: credentials.tf No changes are required terraform { required_providers { vsphere = { source = "hashicorp/vsphere" #version = ">= x.y.z" } } #required_version = ">= 0.13" } provider "vsphere" { user = var.vCenter_user password = var.vCenter_password vsphere_server = var.vCenter_server allow_unverified_ssl = true } #vSphere Environment information for new VMs and Templates #Root folder: credentials.tf Changes required with red #main.tf New VM and existing environment information. variable "vminfo" { type = map(object({ os = string vmname = string cpu = string memory = string })) default = { "server01" = { os = "linux" vmname = "os-linux1" cpu = "1" memory = "1024" } "server02" = { os = "windows" vmname = "os-windows" cpu = "2" memory = "2048" } } } module "virtual_machine" { source = "./modules/vsphere_vm" for_each = var.vminfo datacenter = "Asgard" cluster = "Bifrost" network = "VM Network" datastore = "StarLord_Datastore01" template = each.value.os == "linux" ? "Wakanda_Ubuntu_01" : "Wakanda_Windows_01" #["", ""] "" os = each.value.os vmname = each.value.vmname cpu = each.value.cpu memory = each.value.memory }
There are two files main.tf and variable.tf inside folder ./modules/vsphere_vm, these are main vsphere code do not make any changes to them. It will deploy either Linux or Windows VM based on the input.
# Module file for variable # ./modules/vsphere_vm : variable.tf No changes are required variable "datacenter" { description = "Virtual Datacenter name where VM will be placed" type = string } variable "cluster" { description = "Password to connect to vCenter Server" type = string } variable "network" { description = "IP or DNS name to connect to vCenter server" type = string } variable "datastore" { description = "IP or DNS name to connect to vCenter server" type = string #default = "StarLord_Datastore01" } variable "template" { description = "IP or DNS name to connect to vCenter server" type = string } variable "os" { description = "Operating system of new VM" type = string } variable "vmname" { description = "Provide New virtual machine name" type = string } variable "cpu" { description = "Provide New virtual machine cpu count" type = string } variable "memory" { description = "Provide New virtual machine memory" type = string } #variables vm folders data "vsphere_datacenter" "datacenter" { name = var.datacenter } # Module file to deploy terraform vSphere resources # ./modules/vsphere_vm : main.tf No changes are required data "vsphere_compute_cluster" "cluster" { name = var.cluster datacenter_id = data.vsphere_datacenter.datacenter.id } data "vsphere_network" "network" { name = var.network datacenter_id = data.vsphere_datacenter.datacenter.id } data "vsphere_datastore" "datastore" { name = var.datastore datacenter_id = data.vsphere_datacenter.datacenter.id } data "vsphere_virtual_machine" "template" { name = var.template datacenter_id = data.vsphere_datacenter.datacenter.id } # output "test" { # value = data.vsphere_virtual_machine.template # } resource "vsphere_virtual_machine" "linuxvm" { #for_each = var.vminfo count = var.os == "linux" ? 1 : 0 name = var.vmname resource_pool_id = data.vsphere_compute_cluster.cluster.resource_pool_id datastore_id = data.vsphere_datastore.datastore.id num_cpus = var.cpu memory = var.memory guest_id = data.vsphere_virtual_machine.template.guest_id scsi_type = data.vsphere_virtual_machine.template.scsi_type network_interface { network_id = data.vsphere_network.network.id adapter_type = data.vsphere_virtual_machine.template.network_interface_types[0] } disk { label = "${var.vmname}-disk0" size = data.vsphere_virtual_machine.template.disks.0.size #thin_provisioned = data.vsphere_virtual_machine.template.disks.0.thin_provisioned } clone { template_uuid = data.vsphere_virtual_machine.template.id customize { linux_options { host_name = var.vmname domain = "example.com" } network_interface { # ipv4_address = "172.16.11.10" # ipv4_netmask = 24 } #ipv4_gateway = "172.16.11.1" } } } resource "vsphere_virtual_machine" "windowsvm" { #for_each = var.vminfo count = var.os == "windows" ? 1 : 0 name = var.vmname resource_pool_id = data.vsphere_compute_cluster.cluster.resource_pool_id datastore_id = data.vsphere_datastore.datastore.id num_cpus = var.cpu memory = var.memory guest_id = data.vsphere_virtual_machine.template.guest_id scsi_type = data.vsphere_virtual_machine.template.scsi_type firmware = "efi" network_interface { network_id = data.vsphere_network.network.id adapter_type = data.vsphere_virtual_machine.template.network_interface_types[0] } disk { label = "${var.vmname}-disk0" size = data.vsphere_virtual_machine.template.disks.0.size thin_provisioned = data.vsphere_virtual_machine.template.disks.0.thin_provisioned } clone { template_uuid = data.vsphere_virtual_machine.template.id customize { windows_options { computer_name = var.vmname workgroup = "workgroup" } network_interface { # ipv4_address = "172.16.11.10" # ipv4_netmask = 24 } #ipv4_gateway = "172.16.11.1" } } }
For terraform errors check: Terraform VMware vSphere Virtual Machine cloning Operating system not found and Terraform VMware vSphere Virtual Machine customization clone failed on Windows
Once you put all files in place with adding infrastructure information, Start cloning VMs using command terraform init and terraform apply.
Note: While using template to clone with terraform make sure template image is not sysprepped. Terraform customization will perform the sysprep. (Sysprep image and Terraform vSphere cause will always run into error )
PS E:\Scripts\Terraform\ritesh\vm_creation> terraform apply --auto-approve module.virtual_machine["server01"].data.vsphere_datacenter.datacenter: Reading... module.virtual_machine["server02"].data.vsphere_datacenter.datacenter: Reading... module.virtual_machine["server01"].data.vsphere_datacenter.datacenter: Read complete after 0s [id=datacenter-3] module.virtual_machine["server02"].data.vsphere_datacenter.datacenter: Read complete after 0s [id=datacenter-3] module.virtual_machine["server02"].data.vsphere_virtual_machine.template: Reading... module.virtual_machine["server01"].data.vsphere_virtual_machine.template: Reading... module.virtual_machine["server02"].data.vsphere_datastore.datastore: Reading... module.virtual_machine["server01"].data.vsphere_datastore.datastore: Reading... module.virtual_machine["server01"].data.vsphere_network.network: Reading... module.virtual_machine["server02"].data.vsphere_compute_cluster.cluster: Reading... module.virtual_machine["server02"].data.vsphere_network.network: Reading... module.virtual_machine["server01"].data.vsphere_compute_cluster.cluster: Reading... module.virtual_machine["server01"].data.vsphere_network.network: Read complete after 0s [id=network-12] module.virtual_machine["server02"].data.vsphere_network.network: Read complete after 0s [id=network-12] module.virtual_machine["server02"].data.vsphere_datastore.datastore: Read complete after 0s [id=datastore-11] module.virtual_machine["server01"].data.vsphere_datastore.datastore: Read complete after 0s [id=datastore-11] module.virtual_machine["server02"].data.vsphere_compute_cluster.cluster: Read complete after 0s [id=domain-c13001] module.virtual_machine["server01"].data.vsphere_compute_cluster.cluster: Read complete after 0s [id=domain-c13001] module.virtual_machine["server01"].data.vsphere_virtual_machine.template: Read complete after 0s [id=422a010e-6459-05cb-38fb-6360bbda149b] module.virtual_machine["server02"].data.vsphere_virtual_machine.template: Read complete after 0s [id=42021d4d-1247-c689-23c8-7c4a2aaa7aed] Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create Terraform will perform the following actions: # module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0] will be created + resource "vsphere_virtual_machine" "linuxvm" { + annotation = (known after apply) + boot_retry_delay = 10000 + change_version = (known after apply) + cpu_limit = -1 + cpu_share_count = (known after apply) + cpu_share_level = "normal" + datastore_id = "datastore-11" + default_ip_address = (known after apply) + ept_rvi_mode = "automatic" + firmware = "bios" + force_power_off = true + guest_id = "ubuntu64Guest" + guest_ip_addresses = (known after apply) + hardware_version = (known after apply) + host_system_id = (known after apply) + hv_mode = "hvAuto" + id = (known after apply) + ide_controller_count = 2 + imported = (known after apply) + latency_sensitivity = "normal" + memory = 1024 + memory_limit = -1 + memory_share_count = (known after apply) + memory_share_level = "normal" + migrate_wait_timeout = 30 + moid = (known after apply) + name = "os-linux1" + num_cores_per_socket = 1 + num_cpus = 1 + power_state = (known after apply) + poweron_timeout = 300 + reboot_required = (known after apply) + resource_pool_id = "resgroup-13002" + run_tools_scripts_after_power_on = true + run_tools_scripts_after_resume = true + run_tools_scripts_before_guest_shutdown = true + run_tools_scripts_before_guest_standby = true + sata_controller_count = 0 + scsi_bus_sharing = "noSharing" + scsi_controller_count = 1 + scsi_type = "lsilogic" + shutdown_wait_timeout = 3 + storage_policy_id = (known after apply) + swap_placement_policy = "inherit" + tools_upgrade_policy = "manual" + uuid = (known after apply) + vapp_transport = (known after apply) + vmware_tools_status = (known after apply) + vmx_path = (known after apply) + wait_for_guest_ip_timeout = 0 + wait_for_guest_net_routable = true + wait_for_guest_net_timeout = 5 + clone { + template_uuid = "422a010e-6459-05cb-38fb-6360bbda149b" + timeout = 30 + customize { + timeout = 10 + linux_options { + domain = "example.com" + host_name = "os-linux1" + hw_clock_utc = true } + network_interface {} } } + disk { + attach = false + controller_type = "scsi" + datastore_id = "" + device_address = (known after apply) + disk_mode = "persistent" + disk_sharing = "sharingNone" + eagerly_scrub = false + io_limit = -1 + io_reservation = 0 + io_share_count = 0 + io_share_level = "normal" + keep_on_remove = false + key = 0 + label = "os-linux1-disk0" + path = (known after apply) + size = 100 + storage_policy_id = (known after apply) + thin_provisioned = true + unit_number = 0 + uuid = (known after apply) + write_through = false } + network_interface { + adapter_type = "e1000" + bandwidth_limit = -1 + bandwidth_reservation = 0 + bandwidth_share_count = (known after apply) + bandwidth_share_level = "normal" + device_address = (known after apply) + key = (known after apply) + mac_address = (known after apply) + network_id = "network-12" } } # module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0] will be created + resource "vsphere_virtual_machine" "windowsvm" { + annotation = (known after apply) + boot_retry_delay = 10000 + change_version = (known after apply) + cpu_limit = -1 + cpu_share_count = (known after apply) + cpu_share_level = "normal" + datastore_id = "datastore-11" + default_ip_address = (known after apply) + ept_rvi_mode = "automatic" + firmware = "efi" + force_power_off = true + guest_id = "windows2019srvNext_64Guest" + guest_ip_addresses = (known after apply) + hardware_version = (known after apply) + host_system_id = (known after apply) + hv_mode = "hvAuto" + id = (known after apply) + ide_controller_count = 2 + imported = (known after apply) + latency_sensitivity = "normal" + memory = 2048 + memory_limit = -1 + memory_share_count = (known after apply) + memory_share_level = "normal" + migrate_wait_timeout = 30 + moid = (known after apply) + name = "os-windows" + num_cores_per_socket = 1 + num_cpus = 2 + power_state = (known after apply) + poweron_timeout = 300 + reboot_required = (known after apply) + resource_pool_id = "resgroup-13002" + run_tools_scripts_after_power_on = true + run_tools_scripts_after_resume = true + run_tools_scripts_before_guest_shutdown = true + run_tools_scripts_before_guest_standby = true + sata_controller_count = 0 + scsi_bus_sharing = "noSharing" + scsi_controller_count = 1 + scsi_type = "lsilogic-sas" + shutdown_wait_timeout = 3 + storage_policy_id = (known after apply) + swap_placement_policy = "inherit" + tools_upgrade_policy = "manual" + uuid = (known after apply) + vapp_transport = (known after apply) + vmware_tools_status = (known after apply) + vmx_path = (known after apply) + wait_for_guest_ip_timeout = 0 + wait_for_guest_net_routable = true + wait_for_guest_net_timeout = 5 + clone { + template_uuid = "42021d4d-1247-c689-23c8-7c4a2aaa7aed" + timeout = 30 + customize { + timeout = 10 + network_interface {} + windows_options { + auto_logon_count = 1 + computer_name = "os-windows" + full_name = "Administrator" + organization_name = "Managed by Terraform" + time_zone = 85 + workgroup = "workgroup" } } } + disk { + attach = false + controller_type = "scsi" + datastore_id = "" + device_address = (known after apply) + disk_mode = "persistent" + disk_sharing = "sharingNone" + eagerly_scrub = false + io_limit = -1 + io_reservation = 0 + io_share_count = 0 + io_share_level = "normal" + keep_on_remove = false + key = 0 + label = "os-windows-disk0" + path = (known after apply) + size = 90 + storage_policy_id = (known after apply) + thin_provisioned = false + unit_number = 0 + uuid = (known after apply) + write_through = false } + network_interface { + adapter_type = "e1000e" + bandwidth_limit = -1 + bandwidth_reservation = 0 + bandwidth_share_count = (known after apply) + bandwidth_share_level = "normal" + device_address = (known after apply) + key = (known after apply) + mac_address = (known after apply) + network_id = "network-12" } } Plan: 2 to add, 0 to change, 0 to destroy. module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Creating... module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Creating... module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [10s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [20s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [30s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [40s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [50s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [1m0s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [1m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [1m10s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [1m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [1m20s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [1m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [1m30s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [1m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [1m40s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [1m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [1m50s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [1m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [2m0s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [2m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [2m10s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [2m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [2m20s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [2m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [2m30s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [2m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [2m40s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [2m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [2m50s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [2m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [3m0s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [3m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [3m10s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [3m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [3m20s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [3m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [3m30s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [3m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [3m40s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [3m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [3m50s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [3m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [4m0s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [4m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [4m10s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [4m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [4m20s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [4m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [4m30s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [4m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [4m40s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [4m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [4m50s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [4m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [5m0s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [5m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [5m10s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [5m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [5m20s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [5m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [5m30s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [5m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [5m40s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [5m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [5m50s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [5m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [6m0s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [6m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [6m10s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [6m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [6m20s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [6m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [6m30s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Still creating... [6m30s elapsed] module.virtual_machine["server01"].vsphere_virtual_machine.linuxvm[0]: Creation complete after 6m37s [id=420293cc-6a22-fed8-c5ba-adcdb5ea6c45] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [6m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [6m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [7m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [7m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [7m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [7m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [7m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [7m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [8m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [8m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [8m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [8m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [8m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [8m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [9m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [9m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [9m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [9m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [9m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [9m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [10m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [10m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [10m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [10m30s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [10m40s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [10m50s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [11m0s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [11m10s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Still creating... [11m20s elapsed] module.virtual_machine["server02"].vsphere_virtual_machine.windowsvm[0]: Creation complete after 11m28s [id=42023540-a6fc-2232-a896-275577cd232b] Apply complete! Resources: 2 added, 0 changed, 0 destroyed. PS E:\Scripts\Terraform\ritesh\vm_creation>
Useful Articles
VMWARE VSPHERE UPDATE MANAGER (VUM) - IMPORTING ESXI ISO AND CREATE UPGRADE BASELINE
VMWARE VSPHERE UPDATE MANAGER (VUM) - UPGRADE ESXI OS
ESXi 6.0 update offline bundle via esxcli commandline: DependencyError VIB bootbank requires VSAN ImageProfile
ESXi 6.5 upgrade bundle via command line: No Space Left On Device Error
Registering HPE ILO amplifier pack (Hardware support manager) with vCenter 7 Lifecycle manager
VMware LifeCycle Manager import updates bundle and patch ESXi server
How to update a patch on an ESXi host via command line
Add a Trusted Root Certificate to the Certificate Store VMware Photon OS
Patching update VMware vCenter Server Appliance from a zipped update bundle Web server
Powershell GUI VMware ESXi custom patch bundle builder
Create a custom TCPIP stack on ESXi server - VMware PowerCLI GUI