terraform-provider-vsphere icon indicating copy to clipboard operation
terraform-provider-vsphere copied to clipboard

Storage Policy ID and Replication Group ID

Open barracksbuilder opened this issue 5 years ago • 3 comments
trafficstars

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue trackers reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v0.12.14

vSphere Provider Version

  • provider.local v1.4.0
  • provider.vsphere v1.16.2

Affected Resource(s)

Please list the resources as a list, for example:

  • vsphere_virtual_machine

Terraform Configuration Files

resource "vsphere_virtual_machine" "vm" {
  # VMware 5.5 bug tries to change disk sharing each time
  # If you have more than 5 drives add to this list
  # lifecycle {
  #   ignore_changes = [
  #     "disk.0.disk_sharing",
  #     "disk.1.disk_sharing",
  #     "disk.2.disk_sharing",
  #     "disk.3.disk_sharing",
  #     "disk.4.disk_sharing",
  #     "disk.5.disk_sharing"
  #   ]
  # }
  # VM placement
  name = var.vmName

  folder           = var.vmFolder
  resource_pool_id = var.resource_pool_id
  datastore_id     = var.datastore_id
  storage_policy_id = var.storage_policy_id
  guest_id         = var.guest_id
  scsi_type = var.template_scsi

  # VM resources
  num_cpus = var.cpu
  memory   = var.memory

  network_interface {
    network_id = var.network_id
  }

  disk {
    label            = "disk0"
    size             = var.disk_size
    thin_provisioned = var.thin_provisioned
    eagerly_scrub    = var.eagerly_scrub
    storage_policy_id = var.storage_policy_id
  }

  tags = var.tags


  clone {
    template_uuid = var.template_uuid

    customize {
      windows_options {
        computer_name = var.vmName
        admin_password = var.admin_password
        join_domain = var.networkDomain
        domain_admin_user = var.domain_admin_user
        domain_admin_password = var.domain_admin_password
        product_key = var.productKey
        time_zone = 20
      }

      # linux_options {
      #   host_name = var.vmName
      #   domain    = var.networkDomain
      # }

      network_interface {
        ipv4_address    = var.ipv4_address
        ipv4_netmask    = var.ipv4_netmask
        dns_server_list = var.dns_server_list
      }

      ipv4_gateway    = var.ipv4_gateway
      dns_server_list = var.dns_server_list
    }
  }

  provisioner "chef" {
    server_url              = var.chef_var["server_url"]
    user_name               = var.chef_var["user_name"]
    user_key                = var.user_key
    node_name               = var.vmName
    environment             = var.chef_environment
    run_list                = var.chef_runlist
    recreate_client         = var.chef_var["recreate_client"]
    on_failure              = continue
    ssl_verify_mode         = var.chef_var["ssl_verify_mode_setting"]
    ohai_hints              = ["windows", "vmware"]
    version                 = "14"
    fetch_chef_certificates = true
    log_to_file = true
    client_options = [
      "chef_license 'accept'"
    ]

    connection {
      type     = var.windows_var["connection_type"]
      user     = var.windows_var["user"]
      password = var.windows_var["password"]
      host = var.ipv4_address
      insecure = true
    }
  }

Debug Output

Error: error cloning virtual machine: A general system error occurred: PBM error occurred during PreCloneCheckCallback: pbm.fault.PBMFault; Missing or empty replication spec information in policy

Panic Output

None

Expected Behavior

Clone template to vm using storage policy.

Actual Behavior

Error: error cloning virtual machine: A general system error occurred: PBM error occurred during PreCloneCheckCallback: pbm.fault.PBMFault; Missing or empty replication spec information in policy

Steps to Reproduce

  1. terraform apply

Important Factoids

This is trying to clone into a virtual volume which has a Replication policy that needs to be set. I have not found a way to set the replication policy ID. The template is also stored on the virtual volume if this matters.

References

barracksbuilder avatar Mar 11 '20 16:03 barracksbuilder

Could someone please guide me on this? I am having a similar issue while deploying VMs on virtual volumes and unable to select replication group for the defined storage policy.

neogen19 avatar Apr 16 '21 17:04 neogen19

@bill-rich : sorry I am not sure whom to redirect the question. Any direction you could provide will be greatly appreciated.

neogen19 avatar Apr 16 '21 17:04 neogen19