HewlettPackard / terraform-provider-oneview

Automates the provisioning of physical infrastructure from a private cloud using templates from HPE OneView with Terraform
Apache License 2.0
49 stars 30 forks source link

Unable to set UUID and Serial Number #413

Closed WannaBeGeekster closed 2 years ago

WannaBeGeekster commented 3 years ago

Scenario: Trying to iPXE boot CoreOS and as part of that process I want to be able to set the UUID of the server to a known value so that I can use it when loading the actual iPXE template that is used to install CoreOS. I am generating iPXE files with static IP Addresses set in there and need to be able to generate these files with the UUID in the file name. Using a mac address is problematic due to the special characters that are used in it. File name looks like this: node_name-uuid.html. Since the UUID only has dashes it is the only variable that makes sense to use when loading from a URL. In the OneView GUI when you change "serial_number_type" to UserDefined you have to not only specify the Serial Number but also the UUID. When I set the serial_number_type = "UserDefined" and try and set the serial_number I get an error:

Error: "serial_number": this field cannot be set

When I remove the serial_number variable I get the following error message:

Error: The serial number (null) and UUID (null) must be specified when serial number type is user-defined. Specify a valid serial number and UUID or select virtual or physical type.

I have tried creating random serial numbers that still conform to the required serial number format.

I have also tried setting the serial numbers with pre-selected values stored in a list and I still get the same results. So I know that it is not an improperly formatted Serial Number causing the problem.

My Terraform code works just fine without the serial_number_type set to UserDefined.

Here is the terraform I am using and getting the error message:

resource "random_string" "serial_numbers" { count = var.node_count length = 7 upper = true lower = false number = true special = false }

resource "oneview_server_profile" "node-sp" { depends_on = [resource.null_resource.ipxe_files] count = var.node_count name = "${var.node_fqdn[count.index]}" hardware_name = "${var.hardware_name[count.index]}" type = "ServerProfileV12" template = "${data.oneview_server_profile_template.ocs-node-template.name}" power_state = "on" serial_number_type = "UserDefined" uuid = "${var.node_uuid[count.index]}" serial_number = "VCG${resource.random_string.serial_numbers[count.index].result}" }

nabhajit-ray commented 3 years ago

We will be looking into this and get back to you.

nabhajit-ray commented 2 years ago

We have added this in our backlog . Closing it here.

nabhajit-ray commented 2 years ago

This is fixed in the main branch.