» opentelekomcloud_compute_bms_server_v2

Manages a BMS Server resource within OpenTelekomCloud.

» Example Usage

» Basic Instance

variable "image_id" {}
variable "flavor_id" {}
variable "keypair_name" {}
variable "network_id" {}
variable "availability_zone" {}

resource "opentelekomcloud_compute_bms_server_v2" "basic" {
  name            = "basic"
  image_id        = "${var.image_id}"
  flavor_id       = "${var.flavor_id}"
  key_pair        = "${var.keypair_name}"
  security_groups = ["default"]
  availability_zone = "${var.availability_zone}"

  metadata {
    this = "that"
  }

  network {
    uuid = "${var.network_id}"
  }
}

» Instance Boot From Volume Image

variable "image_id" {}
variable "flavor_id" {}
variable "keypair_name" {}
variable "network_id" {}
variable "availability_zone" {}

resource "opentelekomcloud_compute_bms_server_v2" "basic" {
  name            = "basic"
  image_id        = "${var.image_id}"
  flavor_id       = "${var.flavor_id}"
  key_pair        = "${var.keypair_name}"
  security_groups = ["default"]
  availability_zone = "${var.availability_zone}"

  metadata {
    this = "that"
  }

  network {
    uuid = "${var.network_id}"
  }

  block_device {
    uuid = "${var.image_id}"
    source_type = "image"
    volume_type = "SATA"
    volume_size = 100
    boot_index = 0
    destination_type = "volume"
    delete_on_termination = true
    device_name = "/dev/sda"
  }
}

» Argument Reference

The following arguments are supported:

  • name - (Required) The name of the BMS.

  • image_id - (Optional; Required if image_name is empty.) Changing this creates a new bms server.

  • image_name - (Optional; Required if image_id is empty.) The name of the desired image for the bms server. Changing this creates a new bms server.

  • flavor_id - (Optional; Required if flavor_name is empty) The flavor ID of the desired flavor for the bms server. Changing this resizes the existing bms server.

  • flavor_name - (Optional; Required if flavor_id is empty) The name of the desired flavor for the bms server. Changing this resizes the existing bms server.

  • user_data - (Optional) The user data to provide when launching the instance. Changing this creates a new bms server.

  • security_groups - (Optional) An array of one or more security group names to associate with the bms server. Changing this results in adding/removing security groups from the existing bms server.

  • availability_zone - (Required) The availability zone in which to create the bms server.

  • network - (Optional) An array of one or more networks to attach to the bms instance. Changing this creates a new bms server.

  • metadata - (Optional) Metadata key/value pairs to make available from within the instance. Changing this updates the existing bms server metadata.

  • admin_pass - (Optional) The administrative password to assign to the bms server. Changing this changes the root password on the existing server.

  • key_pair - (Optional) The name of a key pair to put on the bms server. The key pair must already be created and associated with the tenant's account. Changing this creates a new bms server.

  • stop_before_destroy - (Optional) Whether to try stop instance gracefully before destroying it, thus giving chance for guest OS daemons to stop correctly. If instance doesn't stop within timeout, it will be destroyed anyway.

The network block supports:

  • uuid - (Required unless port or name is provided) The network UUID to attach to the bms server. Changing this creates a new bms server.

  • name - (Required unless uuid or port is provided) The human-readable name of the network. Changing this creates a new bms server.

  • port - (Required unless uuid or name is provided) The port UUID of a network to attach to the bms server. Changing this creates a new server.

  • fixed_ip_v4 - (Optional) Specifies a fixed IPv4 address to be used on this network. Changing this creates a new bms server.

  • fixed_ip_v6 - (Optional) Specifies a fixed IPv6 address to be used on this network. Changing this creates a new bms server.

  • access_network - (Optional) Specifies if this network should be used for provisioning access. Accepts true or false. Defaults to false.

» Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The id of the bms server.

  • config_drive - Whether to use the config_drive feature to configure the instance.

  • kernel_id - The UUID of the kernel image when the AMI image is used.

  • user_id - The ID of the user to which the BMS belongs.

  • host_status - The nova-compute status: UP, UNKNOWN, DOWN, MAINTENANCE and Null.