Closed n1603 closed 1 year ago
Can you provide a minimal main.tf file that shows your problem...
Do you actually have a resource pool called "Resources"??? If not, you must create it.
@josenk, thank you for response. I don't have access to ESXi to create this pool by name Resources. There is a resource pool by name ha-root-pool. i will share main.tf.
@josenk below is main.tf. If I add a Resources pool section, i get a error message : "Access to resource settings on the host is restricted..."
provider "esxi" {
esxi_hostname = var.esxi_hostname esxi_hostport = var.esxi_hostport esxi_hostssl = var.esxi_hostssl esxi_username = var.esxi_username esxi_password = var.esxi_password } resource "esxi_resource_pool" "Resources" { resource_pool_name = "Resources" cpu_min = "10" cpu_min_expandable = "true" cpu_max = "11" cpu_shares = "normal" mem_min = "200" mem_min_expandable = "false" mem_max = "8192" mem_shares = "normal" }
resource "esxi_guest" "vm-test-1" { guest_name = var.vm_hostname disk_store = var.disk_store boot_disk_type = "thin" power = "on" memsize = "4096" numvcpus = "2"
resource_pool_name = "Resources"
network_interfaces { virtual_network = var.virtual_network } ovf_source = var.ovf_file
}
Is your user/password to esxi root? Do you actually have a resource pool call 'Resources', or are you expecting Terraform to create it for you?
Do you still need help with this?
abandoned
Describe the bug
For my test I am seeing that terraform esxi provider does not proceed forward when value resource_pool_name is provided as empty string, "/" or Resources etc. It gets stuck at "Still creating... [10s elapsed]"
from the code it looks like it maps Resources to ha-root-pool, but for me when I put : resource_pool_name = "Resources" in main.tf, it still remain stuck same place... https://github.com/josenk/terraform-provider-esxi/blob/master/esxi/resource-pool_functions.go#L17
one note, When I use ovftool with option : vi://XXXX:YYYY@ip:443/, it works fine.
Not sure what I am missing here to get it working.
To Reproduce
set resource_pool_name to "Resources" or to "" or "/" for "/", I see vi://XXXX:YYYY@ip:443//
Expected behavior The error logged on what is missing or pass
Desktop (please complete the following information):
Logs
please see the logs below :- `2022-02-12T12:27:55.281-0500 [INFO] backend/local: apply calling Apply 2022-02-12T12:27:55.281-0500 [DEBUG] Building and walking apply graph for NormalMode plan 2022-02-12T12:27:55.281-0500 [DEBUG] Resource state not found for node "esxi_guest.micro-svc-test-1", instance esxi_guest.micro-svc-test-1 2022-02-12T12:27:55.281-0500 [DEBUG] ProviderTransformer: "esxi_guest.micro-svc-test-1 (expand)" (terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/josenk/esxi"] 2022-02-12T12:27:55.281-0500 [DEBUG] ProviderTransformer: "esxi_guest.micro-svc-test-1" (terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/josenk/esxi"] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.vm_hostname" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.esxi_hostname" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.disk_store" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.esxi_hostport" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.esxi_username" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.esxi_password" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.virtual_network" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.ovf_file" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/josenk/esxi\"]" references: [var.esxi_password var.esxi_username var.esxi_hostname var.esxi_hostport var.esxi_hostssl] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "esxi_guest.micro-svc-test-1 (expand)" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "var.esxi_hostssl" references: [] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "output.ip" references: [esxi_guest.micro-svc-test-1 (expand) esxi_guest.micro-svc-test-1 esxi_guest.micro-svc-test-1] 2022-02-12T12:27:55.281-0500 [DEBUG] ReferenceTransformer: "esxi_guest.micro-svc-test-1" references: [var.vm_hostname var.disk_store var.ovf_file var.virtual_network] 2022-02-12T12:27:55.282-0500 [DEBUG] Starting graph walk: walkApply 2022-02-12T12:27:55.282-0500 [DEBUG] created provider logger: level=debug 2022-02-12T12:27:55.282-0500 [INFO] provider: configuring client automatic mTLS 2022-02-12T12:27:55.292-0500 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/josenk/esxi/1.10.2/linux_amd64/terraform-provider-esxi_v1.10.2 args=[.terraform/providers/registry.terraform.io/josenk/esxi/1.10.2/linux_amd64/terraform-provider-esxi_v1.10.2] 2022-02-12T12:27:55.292-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/josenk/esxi/1.10.2/linux_amd64/terraform-provider-esxi_v1.10.2 pid=23890 2022-02-12T12:27:55.292-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/josenk/esxi/1.10.2/linux_amd64/terraform-provider-esxi_v1.10.2 2022-02-12T12:27:55.304-0500 [INFO] provider.terraform-provider-esxi_v1.10.2: configuring server automatic mTLS: timestamp=2022-02-12T12:27:55.303-0500 2022-02-12T12:27:55.351-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: plugin address: address=/tmp/plugin348574458 network=unix timestamp=2022-02-12T12:27:55.351-0500 2022-02-12T12:27:55.351-0500 [DEBUG] provider: using plugin: version=5 2022-02-12T12:27:55.390-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio" 2022-02-12T12:27:55.390-0500 [DEBUG] No provider meta schema returned 2022-02-12T12:27:55.392-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: pid-23890-config.go:18: [validateEsxiCreds] 2022-02-12T12:27:55.392-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: pid-23890-esxi_remote_cmds.go:61: [runRemoteSshCommand] :Connectivity test, get vmware version 2022-02-12T12:27:55.579-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: pid-23890-esxi_remote_cmds.go:83: [runRemoteSshCommand] cmd:/vmware --version/ 2022-02-12T12:27:55.579-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: stdout:/VMware ESXi 6.5.0 build-16576891/ 2022-02-12T12:27:55.579-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: stderr:/%!s()/
2022-02-12T12:27:55.579-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: pid-23890-esxi_remote_cmds.go:61: [runRemoteSshCommand] :Create home directory if missing
2022-02-12T12:27:55.735-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: pid-23890-esxi_remote_cmds.go:83: [runRemoteSshCommand] cmd:/mkdir -p ~/
2022-02-12T12:27:55.735-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: stdout://
2022-02-12T12:27:55.735-0500 [DEBUG] provider.terraform-provider-esxi_v1.10.2: stderr:/%!s()/
2022-02-12T12:27:55.746-0500 [WARN] Provider "registry.terraform.io/josenk/esxi" produced an invalid plan for esxi_guest.micro-svc-test-1, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
Stopping operation...`