oci_core_compute_capacity_reservation

This resource provides the Compute Capacity Reservation resource in Oracle Cloud Infrastructure Core service.

Creates a new compute capacity reservation in the specified compartment and availability domain. Compute capacity reservations let you reserve instances in a compartment. When you launch an instance using this reservation, you are assured that you have enough space for your instance, and you won’t get out of capacity errors. For more information, see Reserved Capacity.

Example Usage

resource "oci_core_compute_capacity_reservation" "test_compute_capacity_reservation" {
	#Required
	availability_domain = var.compute_capacity_reservation_availability_domain
	compartment_id = var.compartment_id

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	display_name = var.compute_capacity_reservation_display_name
	freeform_tags = {"Department"= "Finance"}
	instance_reservation_configs {
		#Required
		instance_shape = var.compute_capacity_reservation_instance_reservation_configs_instance_shape
		reserved_count = var.compute_capacity_reservation_instance_reservation_configs_reserved_count

		#Optional
		cluster_config {
			#Required
			hpc_island_id = oci_core_hpc_island.test_hpc_island.id

			#Optional
			network_block_ids = var.compute_capacity_reservation_instance_reservation_configs_cluster_config_network_block_ids
		}
		cluster_placement_group_id = oci_identity_group.test_group.id
		fault_domain = var.compute_capacity_reservation_instance_reservation_configs_fault_domain
		instance_shape_config {

			#Optional
			memory_in_gbs = var.compute_capacity_reservation_instance_reservation_configs_instance_shape_config_memory_in_gbs
			ocpus = var.compute_capacity_reservation_instance_reservation_configs_instance_shape_config_ocpus
		}
	}
	is_default_reservation = var.compute_capacity_reservation_is_default_reservation
}

Argument Reference

The following arguments are supported:

<<<<<<< HEAD If the parameter is provided, the reservation is created with the HPC island and a list of HPC blocks that you specify. If a list of HPC blocks are missing or not provided, the reservation is created with any HPC blocks in the HPC island that you specify. If the values of HPC island or HPC block that you provide are not valid, an error is returned. * hpc_island_id - (Required) (Updatable) The OCID of the HPC island.

* network_block_ids - (Optional) (Updatable) The list of OCIDs of the network blocks.

	If the parameter is provided, the reservation is created with the HPC island and a list of HPC blocks that you specify. If a list of HPC blocks are missing or not provided, the reservation is created with any HPC blocks in the HPC island that you specify. If the values of HPC island or HPC block that you provide are not valid, an error is returned.
	* `hpc_island_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the HPC island. 
	* `network_block_ids` - (Optional) (Updatable) The list of OCIDs of the network blocks.
* `cluster_placement_group_id` - (Optional) (Updatable) The OCID of the cluster placement group for this instance reservation capacity configuration.

d74e4e1fef (Added - clusterPlacementGroupId terraform implementation and tests) * fault_domain - (Optional) (Updatable) The fault domain to use for instances created using this capacity configuration. For more information, see Fault Domains. If you do not specify the fault domain, the capacity is available for an instance that does not specify a fault domain. To change the fault domain for a reservation, delete the reservation and create a new one in the preferred fault domain.

	To retrieve a list of fault domains, use the `ListFaultDomains` operation in the [Identity and Access Management Service API](/iaas/api/#/en/identity/20160918/).

	Example: `FAULT-DOMAIN-1` 
* `instance_shape` - (Required) (Updatable) The shape requested when launching instances using reserved capacity. The shape determines the number of CPUs, amount of memory, and other resources allocated to the instance. You can list all available shapes by calling [ListComputeCapacityReservationInstanceShapes](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/computeCapacityReservationInstanceShapes/ListComputeCapacityReservationInstanceShapes). 
* `instance_shape_config` - (Optional) (Updatable) The shape configuration requested when launching instances in a compute capacity reservation.

	If the parameter is provided, the reservation is created with the resources that you specify. If some properties are missing or the parameter is not provided, the reservation is created with the default configuration values for the `shape` that you specify.

	Each shape only supports certain configurable values. If the values that you provide are not valid for the specified `shape`, an error is returned.

	For more information about customizing the resources that are allocated to flexible shapes, see [Flexible Shapes](https://docs.cloud.oracle.com/iaas/Content/Compute/References/computeshapes.htm#flexible). 
	* `memory_in_gbs` - (Optional) (Updatable) The total amount of memory available to the instance, in gigabytes. 
	* `ocpus` - (Optional) (Updatable) The total number of OCPUs available to the instance. 
* `reserved_count` - (Required) (Updatable) The total number of instances that can be launched from the capacity configuration.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

<<<<<<< HEAD If the parameter is provided, the reservation is created with the HPC island and a list of HPC blocks that you specify. If a list of HPC blocks are missing or not provided, the reservation is created with any HPC blocks in the HPC island that you specify. If the values of HPC island or HPC block that you provide are not valid, an error is returned. * hpc_island_id - The OCID of the HPC island.

* network_block_ids - The list of OCIDs of the network blocks.

	If the parameter is provided, the reservation is created with the HPC island and a list of HPC blocks that you specify. If a list of HPC blocks are missing or not provided, the reservation is created with any HPC blocks in the HPC island that you specify. If the values of HPC island or HPC block that you provide are not valid, an error is returned.
	* `hpc_island_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the HPC island. 
	* `network_block_ids` - The list of OCIDs of the network blocks.
* `cluster_placement_group_id` - The OCID of the cluster placement group for this instance reservation capacity configuration.

d74e4e1fef (Added - clusterPlacementGroupId terraform implementation and tests) * fault_domain - The fault domain of this capacity configuration. If a value is not supplied, this capacity configuration is applicable to all fault domains in the specified availability domain. For more information, see Capacity Reservations. * instance_shape - The shape to use when launching instances using compute capacity reservations. The shape determines the number of CPUs, the amount of memory, and other resources allocated to the instance. You can list all available shapes by calling ListComputeCapacityReservationInstanceShapes. * instance_shape_config - The shape configuration requested when launching instances in a compute capacity reservation.

	If the parameter is provided, the reservation is created with the resources that you specify. If some properties are missing or the parameter is not provided, the reservation is created with the default configuration values for the `shape` that you specify.

	Each shape only supports certain configurable values. If the values that you provide are not valid for the specified `shape`, an error is returned.

	For more information about customizing the resources that are allocated to flexible shapes, see [Flexible Shapes](https://docs.cloud.oracle.com/iaas/Content/Compute/References/computeshapes.htm#flexible). 
	* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes. 
	* `ocpus` - The total number of OCPUs available to the instance. 
* `reserved_count` - The total number of instances that can be launched from the capacity configuration.
* `used_count` - The amount of capacity in use out of the total capacity reserved in this capacity configuration.

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Compute Capacity Reservation * update - (Defaults to 20 minutes), when updating the Compute Capacity Reservation * delete - (Defaults to 20 minutes), when destroying the Compute Capacity Reservation

Import

ComputeCapacityReservations can be imported using the id, e.g.

$ terraform import oci_core_compute_capacity_reservation.test_compute_capacity_reservation "id"