Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when cloning from template #1059

Closed
fsedano opened this issue Apr 28, 2020 · 2 comments · Fixed by #1067
Closed

Crash when cloning from template #1059

fsedano opened this issue Apr 28, 2020 · 2 comments · Fixed by #1067
Labels
bug Type: Bug crash Impact: Crash

Comments

@fsedano
Copy link

fsedano commented Apr 28, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.24

vSphere Provider Version

v1.17.3_x4

Affected Resource(s)

  • 'vsphere_network'

Terraform Configuration Files

variable "vcenter_host" {}
variable "vcenter_user" {}
variable "vcenter_password" {}
variable "vcenter_dc" {}
variable "ds_name" {}
variable "routable_pg" {}
variable "trunk_pg" {}
variable "template" {}
variable "datastore_name" {}
variable "resource_pool" {}

provider "vsphere" {

  # If you have a self-signed cert
  allow_unverified_ssl = true
  user = var.vcenter_user
  password = var.vcenter_password
  vsphere_server = var.vcenter_host

}

data "vsphere_datacenter" "dc" {
  name = var.vcenter_dc
}

data "vsphere_datastore" "datastore" {
  name          = var.datastore_name
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_resource_pool" "pool" {
  name          = var.resource_pool
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_network" "network" {
  name          = var.routable_pg
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_network" "trunk" {
  name          = var.trunk_pg
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_virtual_machine" "template" {
  name          = var.template
  datacenter_id = data.vsphere_datacenter.dc.id
}

data "vsphere_distributed_virtual_switch" "dvs" {
  name          = var.ds_name
  datacenter_id = data.vsphere_datacenter.dc.id
}



resource "vsphere_virtual_machine" "vwlc-terraform" {
  name             = "vwlc-terraform"
  count = 1
  nested_hv_enabled = true
  resource_pool_id = data.vsphere_resource_pool.pool.id
  datastore_id     = data.vsphere_datastore.datastore.id
  folder = "Lab infra testing VMs/Autodeployed vWLCs"
  num_cpus = 4
  memory   = 8192
  guest_id = "ubuntu64Guest"


clone {
    template_uuid = data.vsphere_virtual_machine.template.id
    linked_clone = true
    customize {
      linux_options {
        host_name = "vwlc-terraform"
        domain    = "cisco.com"
      }

      network_interface {
      }

    }
}

  network_interface {
    network_id = data.vsphere_network.network.id
  }

  disk {
    label = "disk0"
    size  = 160
  }
}

Debug Output

https://gist.github.com/fsedano/c8048cf4f8a19ac4d4318353a12cdeb9

Panic Output

https://gist.github.com/fsedano/08b4f0db638124bb24cc182f7bdb24c1

Expected Behavior

Create the VM

Actual Behavior

Crash

Steps to Reproduce

  1. terraform apply

Important Factoids

Not sure if it makes a difference, but I'm cloning a VM not a template, due to a VCenter issue.

References

  • #0000
@fsedano fsedano added the bug Type: Bug label Apr 28, 2020
@aareet aareet added the crash Impact: Crash label Apr 28, 2020
@bill-rich
Copy link
Contributor

A fix is in for this in #1067. It should be in the new release next week.

@ghost
Copy link

ghost commented Jun 6, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug crash Impact: Crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants