Closed josyfj closed 2 years ago
Hi @josyfj ,
We will look into this and get back to you. Thanks
The fix is now part of master. We are closing it here.
Hello Nabhajit,
I'm still seeing an error when attempting to run this. I've made sure to update the provider to version 7. Below is the resource exactly as I have it configured as well as the output I get:
The resource had to be modified from the example. I removed the "description" parameter and moved the "name" parameter from inside the properties subset into the main resource parameters.
resource "oneview_volume" "volume" {
properties {
#description = "Test Volume with no template"
storage_pool = data.oneview_storage_pool.st_pool.uri
size = 1221225472
provisioning_type = "Thin"
is_deduplicated = false
}
name = "testvol3"
initial_scope_uris = [data.oneview_scope.scope_obj.uri]
provisioned_capacity = "1221225472"
}
2022-06-20T10:35:55.876+0200 [DEBUG] created provider logger: level=debug
2022-06-20T10:35:55.878+0200 [INFO] provider: configuring client automatic mTLS
2022-06-20T10:35:55.897+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hewlettpackard/oneview/7.0.0-13/windows_amd64/terraform-provider-oneview_v7.0.0-13.exe args=[.terraform/providers/registry.terraform.io/hewlettpackard/oneview/7.0.0-13/windows_amd64/terraform-provider-oneview_v7.0.0-13.exe]
2022-06-20T10:35:55.917+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hewlettpackard/oneview/7.0.0-13/windows_amd64/terraform-provider-oneview_v7.0.0-13.exe pid=70760
2022-06-20T10:35:55.917+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hewlettpackard/oneview/7.0.0-13/windows_amd64/terraform-provider-oneview_v7.0.0-13.exe
2022-06-20T10:35:55.975+0200 [INFO] provider.terraform-provider-oneview_v7.0.0-13.exe: configuring
server automatic mTLS: timestamp=2022-06-20T10:35:55.971+0200
2022-06-20T10:35:56.031+0200 [DEBUG] provider: using plugin: version=5
2022-06-20T10:35:56.031+0200 [DEBUG] provider.terraform-provider-oneview_v7.0.0-13.exe: plugin address: address=127.0.0.1:10000 network=tcp timestamp=2022-06-20T10:35:56.030+0200
2022-06-20T10:35:56.158+0200 [WARN] ValidateProviderConfig from "provider[\"registry.terraform.io/hewlettpackard/oneview\"]" changed the config value, but that value is unused
2022-06-20T10:35:57.553+0200 [INFO] provider.terraform-provider-oneview_v7.0.0-13.exe: 2022/06/20 10:35:57 [WARN] Truncating attribute path of 0 diagnostics for TypeSet: timestamp=2022-06-20T10:35:57.553+0200
2022-06-20T10:35:57.554+0200 [INFO] provider.terraform-provider-oneview_v7.0.0-13.exe: 2022/06/20 10:35:57 [WARN] Truncating attribute path of 0 diagnostics for TypeSet: timestamp=2022-06-20T10:35:57.553+0200
module.Add_Volume_Terraform.oneview_volume.volume: Creating...
2022-06-20T10:35:57.560+0200 [INFO] Starting apply for module.Add_Volume_Terraform.oneview_volume.volume
2022-06-20T10:35:57.563+0200 [DEBUG] module.Add_Volume_Terraform.oneview_volume.volume: applying the planned Create change
2022-06-20T10:35:57.569+0200 [INFO] provider.terraform-provider-oneview_v7.0.0-13.exe: 2022/06/20 10:35:57 [DEBUG] setting computed for "device_specific_attributes" from ComputedKeys: timestamp=2022-06-20T10:35:57.569+0200
2022-06-20T10:35:58.241+0200 [DEBUG] provider.terraform-provider-oneview_v7.0.0-13.exe: Error submitting new storage volume request: Error in response: One or more required fields are missing.
2022-06-20T10:35:58.242+0200 [DEBUG] provider.terraform-provider-oneview_v7.0.0-13.exe: Response Status: 400 Bad Request
2022-06-20T10:35:58.243+0200 [DEBUG] provider.terraform-provider-oneview_v7.0.0-13.exe: Response Details: Missing value for property 'templateUri'.
2022-06-20T10:35:58.280+0200 [ERROR] vertex "module.Add_Volume_Terraform.oneview_volume.volume" error: Error in response: One or more required fields are missing.
Response Status: 400 Bad Request
Response Details: Missing value for property 'templateUri'.
╷
│ Error: Error in response: One or more required fields are missing.
│ Response Status: 400 Bad Request
│ Response Details: Missing value for property 'templateUri'.
│
│ with module.Add_Volume_Terraform.oneview_volume.volume,
me":
│ 30: resource "oneview_volume" "volume" {
│
╵```
Is there something I'm missing in my resource or configuration that could be causing this?
Thank you
Hi Josyf,
Have you pull the latest changes and build the provider locally ?
Hi Nabhajit,
I've synced the latest changes and ran the provider locally by using a terraform mirror C:\<directory>
command followed by a terraform init -plugin-dir C:\<directory>
. If I run terraform providers
I get the following response:
.
├── provider[registry.terraform.io/hewlettpackard/oneview] 7.0.0-13
├── provider[registry.terraform.io/hashicorp/null] 3.0.0
└── module.Add_Volume_Terraform
└── provider[registry.terraform.io/hewlettpackard/oneview] 7.0.0-13
Providers required by state:
provider[registry.terraform.io/hewlettpackard/oneview]```
It appears that Terraform is using the latest provider version, unless there is something I'm missing?
Thank you again
Hi @josyfj ,
You have to build the provider and installed it locally to get the changes from main branch. Let us know if that works for you
Hi @josyfj ,
We did not hear from you if the fix is working. Closing it here. Please reopen if it is not working
Issue: A new volume cannot be created without having a volume template created first.
Below is the code containing the resource:
We are trying to create a new volume, but have not created any volume templates. We have tried to comment out the template_name and template_uri attributes, but get the following error:
Expected output: A volume is added without having used a template.
Is it possible to do this in the current revision of the provider?