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

ibm_pi_network and ibm_pi_instance should have more complete examples #4913

Closed
powellquiring opened this issue Nov 9, 2023 · 2 comments
Closed
Labels
documentation service/Power Systems Issues related to Power Systems service/Resource Management Issues related to Resource Manager or Resource controller Issues

Comments

@powellquiring
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

New or Affected Resource(s) or Datasource(s)

  • ibm_pi_network
  • ibm_pi_instance

Description

Include in this example the creation of a workspace/cloud_instance_id

image

For example, some variation of this that has been tested:

resource "ibm_resource_instance" "location" {
  name              = local.name
  resource_group_id = local.resource_group_id
  location          = local.datacenter
  service           = "power-iaas"
  plan              = "power-virtual-server-group"
}


data "ibm_pi_key" "personal" {
  pi_key_name = var.settings.ssh_key_name
  pi_cloud_instance_id = ibm_resource_instance.location.guid
}

resource "ibm_pi_image" "testacc_image" {
  pi_image_name        = "SLES15-SP4"
  pi_cloud_instance_id = ibm_resource_instance.location.guid
  pi_image_id          = "e00178e1-f763-41b7-adb0-b5da0edde4c9"
}

resource "ibm_pi_network" "private" {
  pi_cloud_instance_id = ibm_resource_instance.location.guid
  pi_network_type      = "vlan"
  pi_cidr              = "10.0.0.0/24"
}

resource "ibm_pi_instance" "worker" {
  pi_memory            = "4"
  pi_processors        = "2"
  pi_instance_name     = "name"
  pi_proc_type         = "shared"
  pi_image_id          = ibm_pi_image.testacc_image.image_id
  pi_key_pair_name     = data.ibm_pi_key.personal.id
  pi_sys_type          = "s922"
  pi_cloud_instance_id = var.power.guid
  pi_pin_policy        = "none"
  pi_storage_type      = "tier3"
  pi_network {
    // network_id = ibm_pi_network.private.network_id
    network_id = var.power.network_private.network_id
  }
  pi_network {
    //network_id = ibm_pi_network.power_networks.network_id
    network_id = var.power.network_public.network_id
  }
}

References

  • #0000
@github-actions github-actions bot added service/Power Systems Issues related to Power Systems service/Resource Management Issues related to Resource Manager or Resource controller Issues labels Nov 9, 2023
@powellquiring
Copy link
Author

Here are the components that would make up an example for ibm_resource_instance. Note the timeout is required to avoid intermittent failures when creating the networks.

resource "ibm_resource_instance" "location" {
  name              = local.name
  resource_group_id = local.resource_group_id
  location          = local.datacenter
  service           = "power-iaas"
  plan              = "power-virtual-server-group"
}

resource "ibm_pi_network" "public" {
  count                = local.count
  pi_network_name      = "${local.name}-public"
  pi_cloud_instance_id = ibm_resource_instance.location.guid
  pi_network_type      = "pub-vlan"
}

resource "ibm_pi_network" "private" {
  count                = local.count
  pi_network_name      = "${local.name}-private"
  pi_cloud_instance_id = ibm_resource_instance.location.guid
  pi_network_type      = "vlan"
  pi_cidr              = local.cidr
}

resource "ibm_pi_image" "testacc_image" {
  pi_image_name        = "SLES15-SP4"
  pi_cloud_instance_id = var.power.guid
  pi_image_id          = "e00178e1-f763-41b7-adb0-b5da0edde4c9"
}


resource "ibm_pi_instance" "worker" {
  pi_memory            = "4"
  pi_processors        = "2"
  pi_instance_name     = var.power.name
  pi_proc_type         = "shared"
  pi_image_id          = ibm_pi_image.testacc_image.image_id
  pi_key_pair_name     = "pfq"
  pi_sys_type          = "s922"
  pi_cloud_instance_id = ibm_resource_instance.location.guid
  pi_pin_policy        = "none"
  pi_storage_type      = "tier3"
  pi_network {
    network_id = ibm_pi_network.private.network_id
  }
  pi_network {
    network_id = ibm_pi_network.power_networks.network_id
  }
}

@michaelkad
Copy link
Collaborator

michaelkad commented Jan 22, 2024

At complete example was added here #5050.
@powellquiring feel free to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation service/Power Systems Issues related to Power Systems service/Resource Management Issues related to Resource Manager or Resource controller Issues
Projects
None yet
Development

No branches or pull requests

2 participants