Adding vsphere hosts to vCenter

hey all,

I’m trying to create some automation to manage the underlining cluster, I’ve gotten to a point where each run, the fingerprints seem to change, and it wants to re-add the hosts, and because vmotion is not yet setup, hosts can’t placed into maintenance node and VMs evacuated.

code looks like this so far;

data "vsphere_host_thumbprint" "thumbprint" {
  for_each = var.hosts
    address  = each.key
    insecure = true
}

resource "vsphere_host" "hosts" {
  for_each = var.hosts
    hostname = each.key
    username = var.vsphere_username
    password = var.vsphere_password
    cluster = vsphere_compute_cluster.compute_cluster.id
    thumbprint = data.vsphere_host_thumbprint.thumbprint[each.key].id
    #license   = var.vsphere_host_license
    depends_on = [vsphere_compute_cluster.compute_cluster]
}