Skip to content
New issue

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

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

Already on GitHub? # to your account

Terraform Panic with Vsphere Provider #222

Closed
wnhtr opened this issue Oct 24, 2017 · 4 comments
Closed

Terraform Panic with Vsphere Provider #222

wnhtr opened this issue Oct 24, 2017 · 4 comments
Labels
bug Type: Bug crash Impact: Crash

Comments

@wnhtr
Copy link

wnhtr commented Oct 24, 2017

Terraform Version

terraform -v
Terraform v0.10.7

vSphere Provider Version

0.4.2

Affected Resource(s)

terraform-provider-vsphere

Terraform Configuration Files

cat main.tf 
provider "vsphere" {
    user                  = "${var.vsphere_user}"
    password              = "${var.vsphere_password}"
    vsphere_server        = "${var.vsphere_server}"
    allow_unverified_ssl  = "${var.allow_unverified_ssl}"
}
/*
module "deployer" {
  source = "terraform_modules/vmware_simple_vm_v2"

  default           = "${merge(var.default, var.deployer_overrides)}"
  vms               = "${var.deployer_vms}"
}

module "master" {
  source = "terraform_modules/vmware_adddisk_vm_v2"
  
  default           = "${merge(var.default, var.master_overrides)}"
  vms               = "${var.master_vms}"
}

module "node" {
  source = "terraform_modules/vmware_adddisk_vm_v2"
  
  default           = "${merge(var.default, var.node_overrides)}"
  vms               = "${var.node_vms}"
}

module "lb" {
  source = "terraform_modules/vmware_adddisk_vm_v2"
  
  default           = "${merge(var.default, var.lb_overrides)}"
  vms               = "${var.lb_vms}"
}


module "db" {
  source = "terraform_modules/vmware_adddisk_vm_v2"

  default           = "${merge(var.default, var.db_overrides)}"
  vms               = "${var.db_vms}"
}

module "ipvs" {
  source = "terraform_modules/vmware_simple_vm_v2"

  default           = "${merge(var.default, var.ipvs_overrides)}"
  vms               = "${var.ipvs_vms}"
}

module "jitp" {
  source = "terraform_modules/vmware_simple_vm_v2"

  default           = "${merge(var.default, var.jitp_overrides)}"
  vms               = "${var.jitp_vms}"
}*/

module "pkg" {
  source = "terraform_modules/vmware_simple_vm_v2"

  default           = "${merge(var.default, var.pkg_overrides)}"
  vms               = "${var.pkg_vms}"
}

/*module "tst" {
  source = "terraform_modules/cdvr_2disk"

  default           = "${merge(var.default, var.tst_overrides)}"
  vms               = "${var.tst_vms}"
}*/

cat pre-stage.tfvars 
vsphere_server = "10.100.181.4"
vsphere_user = "*******"

default = {
    project = "****",
    cpu = 2,
    memory = 4096,
    prefix = "*****",
    suffix = "",
    vm-initial_password = "*****",
    vm-initial_user = "root",
    datacenter = "Lab",
    cluster = "LabCluster1",
    folder = "****",
    disk-type = "thin",
    template = "CSCOlxplat",
    net_label = "front-end 10.100.181.0"
    gateway = "10.100.181.1",
    ipv6_gateway = "2001:1998:860:6010::1:1"
    dns_servers = "10.100.181.12",
    dns_suffixes = "*******",
    domain = "********",
    add_disk_size = "50",
    add_disk_suffix = "disk01",
    add_disk_type = "thin",
    add_disk_controller_type = "scsi",
    net_prefix = "26",
    ipv6_prefix_length = "112" 
}

deployer_overrides = {
  prefix = "dply",
  cpu = 4,
  memory = 8192,
  template = "Deployer",
  datastore = "shared2",
}
deployer_vms = [
  { ip = "10.100.181.48", hostname = "dply", ip6 = "2001:1998:860:6010::1:fa27" },
]

master_overrides = {
  prefix = "k8mstr",
  cpu = 4,
  memory = 8192,
  template = "CSCOlxplat",
  datastore = "shared3",
}
master_vms = [
  { ip = "10.100.181.30", hostname = "k8mstr01", ip6 = "2001:1998:860:6010::1:fa15" },
  { ip = "10.100.181.31", hostname = "k8mstr02", ip6 = "2001:1998:860:6010::1:fa16" },
  { ip = "10.100.181.32", hostname = "k8mstr03", ip6 = "2001:1998:860:6010::1:fa17" },
]

node_overrides = {
  prefix = "k8min",
  cpu = 8,
  memory = 65536,
  template = "CSCOlxplat",
  add_disk_size = "128",
  datastore = "shared2",
}
node_vms = [
  { ip = "10.100.181.33", hostname = "k8min01", ip6 = "2001:1998:860:6010::1:fa18" },
  { ip = "10.100.181.34", hostname = "k8min02", ip6 = "2001:1998:860:6010::1:fa19" },
  { ip = "10.100.181.35", hostname = "k8min03", ip6 = "2001:1998:860:6010::1:fa1a" },
  { ip = "10.100.181.36", hostname = "k8min04", ip6 = "2001:1998:860:6010::1:fa1b" },
]

lb_overrides = {
  prefix = "k8lb",
  cpu = 4,
  memory = 8192,
  template = "CSCOlxplat",
  datastore = "shared2",
}
lb_vms = [
  { ip = "10.100.181.27", hostname = "k8lb01", ip6 = "2001:1998:860:6010::1:fa12"  },
  { ip = "10.100.181.28", hostname = "k8lb02", ip6 = "2001:1998:860:6010::1:fa13" },
]

db_overrides = {
  prefix= "msql",
  cpu = 4,
  memory = 8192,
  template = "CSCOlxplat",
  datastore = "shared2",
}
db_vms = [
  { ip = "10.100.181.49", hostname = "msql01", ip6 = "2001:1998:860:6010::1:fa28" },
  { ip = "10.100.181.50", hostname = "msql02", ip6 = "2001:1998:860:6010::1:fa29" },
  { ip = "10.100.181.51", hostname = "msql03", ip6 = "2001:1998:860:6010::1:fa2a" },
]

ipvs_overrides = {
prefix= "ipvs",
  cpu = 4,
  memory = 8192,
  template = "centos_72_64_new",
  vm-initial_password = "",
  vm-initial_user = "silver",
  datastore = "shared3",
}
ipvs_vms = [
  { ip = "10.100.181.42", hostname = "ipvs01", ip6 = "2001:1998:860:6010::1:fa21" },
  { ip = "10.100.181.43", hostname = "ipvs02", ip6 = "2001:1998:860:6010::1:fa22" },
]

jitp_overrides = {
prefix = "jitp",
  cpu = 4,
  memory = 8192,
  template = "centos_72_64_new",
  vm-initial_password = ",
  vm-initial_user = "silver",
  datastore = "shared3",
}
jitp_vms = [
  { ip = "10.100.181.39", hostname = "jitp01", ip6 = "2001:1998:860:6010::1:fa1e" },
  { ip = "10.100.181.40", hostname = "jitp02", ip6 = "2001:1998:860:6010::1:fa1f" },
]

pkg_overrides = {
prefix = "pkg",
  cpu = 2,
  memory = 8192,
  template = "centos_72_64_new",
  vm-initial_password = "",
  vm-initial_user = "silver",
  datastore = "shared3",
}
pkg_vms = [
  { ip = "10.100.181.52", hostname = "pkg01", ip6 = "2001:1998:860:6010::1:fa2b" },
  { ip = "10.100.181.53", hostname = "pkg02", ip6 = "2001:1998:860:6010::1:fa2c" },
]

tst_overrides = {
prefix = "tst",
  cpu = 2,
  memory = 8192,
  cluster = "LabCluster2"
  template = "centos_72_64_new",
  vm-initial_password = "",
  vm-initial_user = "silver",
  datastore = "pod2_shared1",
}
tst_vms = [
  { ip = "10.100.181.57", hostname = "tst01", ip6 = "2001:1998:860:6010::1:fa30" },
]

Debug Output

https://gist.github.com/wnhtr/45eb792cfd73c8832894119d295cff28

Panic Output

https://gist.github.com/wnhtr/49e2cbab05ddbde7eb957e68a8de51b9

Expected Behavior

terraform refresh should not panic

Actual Behavior

terraform panic

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform refresh -var-file=pre-stage.tfvars

Important Factoids

This configuration has been working for weeks, then just all of the sudden stopped working. I can access vsphere just fine, and govc works as well.

References

none

@vancluever vancluever added bug Type: Bug crash Impact: Crash labels Oct 24, 2017
@vancluever
Copy link
Contributor

Hey @wnhtr, thanks for submitting the issue and sorry you are having trouble.

I think this is related to #215, can you review that issue and tell me if you have any inparticular gotcha in your system that would be causing an issue with grabbing the IP address info so deep in the structure?

In other news, we are currently in the process of refactoring this resource - part of the work will be an overhaul of how we treat guest network information read in from VMware tools so that there's not nearly as much risk of these kinds of panics happening.

Thanks!

@wnhtr
Copy link
Author

wnhtr commented Oct 24, 2017

I can't think of anything in our system that would be related to this. Each time I run terraform there is a different number of errors, but every single time there is a panic.

If I run terraform with '-target' to target just a few resources, then terraform runs just find with no panic.

@wnhtr wnhtr closed this as completed Oct 24, 2017
@wnhtr
Copy link
Author

wnhtr commented Oct 24, 2017

Sorry, I didn't mean to close this issue.

@wnhtr wnhtr reopened this Oct 24, 2017
@vancluever
Copy link
Contributor

This is more than likely an old, pre 1.x issue and was probably fixed with the re-write in #244.

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

No branches or pull requests

2 participants