Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

XaaS blueprint issue - Map of string required #160

Open
jam3s32 opened this issue Jun 4, 2019 · 6 comments
Open

XaaS blueprint issue - Map of string required #160

jam3s32 opened this issue Jun 4, 2019 · 6 comments

Comments

@jam3s32
Copy link

jam3s32 commented Jun 4, 2019

Hi there,

I'm trying to deploy a basic VM:
resource "vra7_deployment" "TestingVM" {
count = "1"
catalog_item_name = "HPaaS Microsoft Windows"
reasons = "Deployment"
description = "Deployment via terraform"
resource_configuration = {
// OSVersion = "Windows Server 2016"
Site = "SYD01"
}
wait_timeout = "5"
}

However when I run this the resource configuration returns an error that the value for Site requires a map of string. As far as I'm aware the resource and deployment configs require:
DeploymentConfiguration map[string]interface{}
ResourceConfiguration map[string]interface{}

This is my error message:
image

It seems to be having issues pulling off the blueprint with the mapped names.

@RReivax
Copy link

RReivax commented Jul 1, 2019

Similar issue with Blueprint deployment:

resource "vra7_deployment" "machine" {
  catalog_item_name = "BPNAME"
  count = 2
  description = "Deployment via terraform"
  reasons = "Deployment test"

  deployment_configuration = {
    _leaseDays = "3"
  }
}

Output error:

Error: Incorrect attribute value type

  on main.tf line 15, in resource "vra7_deployment" "machine":
  15: 	deployment_configuration = {

Inappropriate value for attribute "deployment_configuration": element
"_leaseDays": map of string required.

@hobovirtual
Copy link

Hi @RReivax

Which version of the provider are you using?

Please try removing the double quotes, here's my declaration which is working with the latest version which can be found here

provider "vra7" {
  username = "${var.vra_username}"
  password = "${var.vra_password}"
  tenant   = "${var.vra_tenant}"
  host     = "${var.vra_host}"
  insecure = true
}

resource "vra7_deployment" "deployment1" {
  catalog_item_name = "centOS 7"

  //component vm1 section
  resource_configuration = {
    vm1._cluster = 1
    vm1.cpu = "2"
    vm1.memory = "4096"
    vm1.description = "Component Description here"
  }

  //deployment section
  deployment_configuration = {
    reasons      = "Some Reasons"
    description  = "Deployment Description here"
    _leaseDays = 5
    _number_of_instances = 1
  }
}

Thanks!

@hobovirtual
Copy link

Hi @jam3s32

For Datacenter location you need to use this property in the resource_configuration section: Vrm.DataCenter.Location

Here's an example of my declaration with the latest release.

provider "vra7" {
  username = "${var.vra_username}"
  password = "${var.vra_password}"
  tenant   = "${var.vra_tenant}"
  host     = "${var.vra_host}"
  insecure = true
}

resource "vra7_deployment" "deployment1" {
  catalog_item_name = "centOS 7"

  //component vm1 section
  resource_configuration = {
    vm1._cluster = 1
    vm1.cpu = "2"
    vm1.memory = "4096"
    vm1.description = "Component Description here"
    vm1.Vrm.DataCenter.Location = "New York"
  }

  //deployment section
  deployment_configuration = {
    reasons      = "Some Reasons"
    description  = "Deployment Description here"
    _leaseDays = 5
    _number_of_instances = 1
  }
}

@RReivax
Copy link

RReivax commented Jul 2, 2019

Hi @hobovirtual thank you for the reply.

I build the provider from the master branch of this repository. I tried with the updated repository you linked me, but run into this issue as well (Error: Failed to instantiate provider "vra7" to obtain schema: Incompatible API version with plugin. Plugin version: 4, Client versions: [5]). I am running Terraform v0.12.3.

Are you using a different version of Terraform to make it work ?

@hobovirtual
Copy link

HI @RReivax

There's a known issue with the provider and terraform 0.12.x
The team is working on addressing this, i'm using 0.11.13 at the moment until issue #13 is resolved

Thanks!

@RReivax
Copy link

RReivax commented Jul 2, 2019

@hobovirtual Tested with Terraform 0.11.14 and working fine. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants