Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with storage_profile enabled at creation. #754

Closed
nakasix opened this issue Nov 30, 2021 · 7 comments
Closed

Bug with storage_profile enabled at creation. #754

nakasix opened this issue Nov 30, 2021 · 7 comments

Comments

@nakasix
Copy link

nakasix commented Nov 30, 2021

Hello,

When I set the "enabled" value to "false" of the "storage_profile" block of resource "vcd_org_vdc", the value is not taken into account when creating the VDC.

The output of Terraform:
image

The result in VCD GUI:
image

NB: However, once the VDC is created and the module is reread, the variable is taken in consideration.

Regards,

@vbauzys
Copy link
Contributor

vbauzys commented Nov 30, 2021

Hello, @nakasix

at the start could provide VCD and terraform provider version ?

@nakasix
Copy link
Author

nakasix commented Nov 30, 2021

Hello @vbauzysvmware ,

Of course!

VMware Cloud Director:
10.3.1.18738571

Terraform:
{ "terraform_version": "1.0.11", "platform": "linux_amd64", "provider_selections": { "registry.terraform.io/vmware/vcd": "3.4.0" }, "terraform_outdated": false }

Regards,

@vbauzys
Copy link
Contributor

vbauzys commented Nov 30, 2021

Also full HCL :) if need you can obfuscate details.

@nakasix
Copy link
Author

nakasix commented Nov 30, 2021

Hello,

What do you mean by HCL?

  • The .terraform.lock.hcl file?
  • The terraform main.tf file?
  • Hardware Compatibility List? :)

Regards,

@vbauzys
Copy link
Contributor

vbauzys commented Nov 30, 2021

script to create VDC from main.tf file :)

@nakasix
Copy link
Author

nakasix commented Nov 30, 2021

Hello,

I did not put the declaration of my variables for more readability.

terraform {
  required_providers {
    vcd = {
      source = "vmware/vcd"
    }
  }
}

provider "vcd" {
  user     = var.vcd_user
  password = var.vcd_password
  org      = "System"
  url      = var.vcd_url
}

resource "vcd_org_vdc" "vcd_org_vdc" {

  name = var.vcd_org_vdc
  org  = var.vcd_org

  allocation_model           = "Flex"
  elasticity                 = true
  include_vm_memory_overhead = false

  network_pool_name = var.network_pool_name
  provider_vdc_name = var.provider_vdc_name

  cpu_speed = 1000

  cpu_guaranteed    = 0
  memory_guaranteed = 0

  network_quota = 1000

  compute_capacity {
    cpu {
      allocated = tonumber(var.compute_capacity_cpu) * 1000
      limit     = 0
    }

    memory {
      allocated = tonumber(var.compute_capacity_memory) * 1024
      limit     = 0
    }
  }

  storage_profile {
    name    = "SSD"
    enabled = tonumber(var.storage_profile_ssd) != 0 ? true : false
    limit   = tonumber(var.storage_profile_ssd) * 1024
    default = tonumber(var.storage_profile_ssd) != 0 ? true : false
  }

  storage_profile {
    name    = "SATA"
    enabled = tonumber(var.storage_profile_sata) != 0 ? true : false
    limit   = tonumber(var.storage_profile_sata) * 1024
    default = tonumber(var.storage_profile_sata) != 0 && tonumber(var.storage_profile_ssd) == 0 ? true : false
  }

  enabled                  = true
  enable_thin_provisioning = true
  enable_fast_provisioning = false
  delete_force             = true
  delete_recursive         = true
}

Regards,

@vbauzys
Copy link
Contributor

vbauzys commented Mar 18, 2022

Solved and fix will be released in 3.6.

@vbauzys vbauzys closed this as completed Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants