elsudano / terraform-provider-vmworkstation

VmWare Workstation Pro provider for Terraform
MIT License
52 stars 18 forks source link

Error: One of the parameters was invalid: path #20

Open rahim-devops opened 1 month ago

rahim-devops commented 1 month ago

I'm trying to create a virtual machine using Terraform with the vmworkstation provider, but I encounter an error related to the path parameter during the terraform apply step. Error: One of the parameters was invalid: path with vmworkstation_vm.vmware07_machine, on main.tf line 18, in resource "vmworkstation_vm" "vmware07_machine": 18: resource "vmworkstation_vm" "vmware07_machine" { Terraform Configuration main.tf:

terraform {
  required_version = ">= 0.14.4"
  required_providers {
    vmworkstation = {
      source  = "elsudano/vmworkstation"
      version = "1.0.4"
    }
  }
}

provider "vmworkstation" {
  user     = "root"
  password = "********"
  url      = "https://localhost:8697/api"
}

resource "vmworkstation_vm" "vmware07_machine" {
  sourceid     = var.vmws_reource_frontend_sourceid
  denomination = var.vmws_reource_frontend_denomination
  description  = var.vmws_reource_frontend_description
  path         = var.vmws_reource_frontend_path
  processors   = var.vmws_reource_frontend_processors
  memory       = var.vmws_reource_frontend_memory
}

variables.tf:

variable "vmws_reource_frontend_sourceid" {
  type        = string
  description = "(Required) The ID of the VM that to use for clone at the new"
  default     = "7MEOEQ89VNIAK31HCFIDEMNMDB616H98"
}

variable "vmws_reource_frontend_denomination" {
  type        = string
  description = "(Required) The Name of VM in WS"
  default     = "vmware07_machine"
}

variable "vmws_reource_frontend_description" {
  type        = string
  description = "(Required) The Description at later maybe to explain the instance"
  default     = "just a vm"
}

variable "vmws_reource_frontend_path" {
  type        = string
  description = "(Required) The Path where will be our instance in VmWare"
  default     = "C:\\Users\\OS-23\\Documents\\Virtual Machines"
}

variable "vmws_reource_frontend_processors" {
  type        = string
  description = "(Required) The number of processors of the Virtual Machine"
  default     = "1"
}

variable "vmws_reource_frontend_memory" {
  type        = string
  description = "(Required) The size of memory to the Virtual Machine"
  default     = "512"
}
elsudano commented 1 month ago

Hi Rahim

First of all thanks for testing our provider.

We have reviewed your code and we saw a couple of things weired.

First maybe is better if you use a latest version of the provider.

We know, you copy paste the example that you have seen in the documentation, but we haven't updated the documentation with the last version of the provider, sorry for that we have raised a ticket in order to fix it.

Apart from that, we have seen that you put a different parameters that in the last version they aren't.

Please take a look this two things and let us know if you have more doubt's.

Regards