terraform-provider-ibm: Volume attachment to PVS Instances not working

Terraform CLI and Terraform IBM Provider Version

Terraform v0.13.6
./ibmcloud version 2.0.0+5a84b9b-2021-06-23T17:07:07+00:00

Affected Resource(s)

  • ibm_pi_instance

Terraform Configuration Files

resource "ibm_pi_instance" "master" {
  count = var.master["count"]

  pi_memory            = var.master["memory"]
  pi_processors        = var.master["processors"]
  pi_instance_name     = "${var.name_prefix}-master-${count.index}"
  pi_proc_type         = var.processor_type
  pi_image_id          = data.ibm_pi_image.rhcos.id
  pi_sys_type          = var.system_type
  pi_cloud_instance_id = var.service_instance_id
  pi_network_ids       = [data.ibm_pi_network.network.id]
  pi_volume_ids        = local.master.volume_count == 0 ? null : chunklist(ibm_pi_volume.master.*.volume_id, local.master.volume_count)[count.index]

  # Inject ignition source timeout to force ignition fail when HTTP file is not available for 500s. This will reboot the node and try ignition fetch process again.
  pi_user_data = base64encode(replace(data.ignition_config.master[count.index].rendered, "\"timeouts\":{}", "\"timeouts\":{\"httpTotal\":500}"))

  # Not needed by RHCOS but required by resource
  pi_key_pair_name = "${var.name_prefix}-keypair"
  pi_health_status = "WARNING"
}

resource "ibm_pi_volume" "master" {
  count = local.master.volume_count == 0 ? 0 : var.master["count"] * local.master.volume_count

  pi_volume_size       = local.master.volume_size
  pi_volume_name       = "${var.name_prefix}-master-${count.index}-volume"
  pi_volume_type       = data.ibm_pi_image.rhcos.storage_type
  pi_volume_shareable  = var.volume_shareable
  pi_cloud_instance_id = var.service_instance_id
}

Expected Behavior

Volumes should have attached successfully to Instance.

Actual Behavior

Error: failed to provision Failed to Create PVM Instance :[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][400] pcloudPvminstancesPostBadRequest &{Code:0 Description:bad request: calculated parameter has failed for cloud-instance a007eb5664ab4188a236468c86e51f16: validate volumes failed, all volumes are not in the same VM deployment storage pool Tier3-Flash-1 Error:bad request Message:}

Steps to Reproduce

  1. Create volumes
  2. Try attaching volumes as part of instance creation

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

October…

If the lpar is in the warning state , you cannot attach or perform any operation on them. Power Cloud is working on a fix. I can ask them for an ETA