Skip to content

Commit 888766b

Browse files
Chris WellsSrividyaKamakshi
authored andcommitted
Added - Support for Dynamic Resource VM
1 parent 4a78d51 commit 888766b

8 files changed

+52
-4
lines changed

internal/service/core/core_instance_configuration_resource.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,12 @@ func CoreInstanceConfigurationResource() *schema.Resource {
10211021
Computed: true,
10221022
ForceNew: true,
10231023
},
1024+
"resource_management": {
1025+
Type: schema.TypeString,
1026+
Optional: true,
1027+
Computed: true,
1028+
ForceNew: false,
1029+
},
10241030
"vcpus": {
10251031
Type: schema.TypeInt,
10261032
Optional: true,
@@ -2084,6 +2090,12 @@ func CoreInstanceConfigurationResource() *schema.Resource {
20842090
Computed: true,
20852091
ForceNew: true,
20862092
},
2093+
"resource_management": {
2094+
Type: schema.TypeString,
2095+
Optional: true,
2096+
Computed: true,
2097+
ForceNew: false,
2098+
},
20872099
"vcpus": {
20882100
Type: schema.TypeInt,
20892101
Optional: true,
@@ -4950,6 +4962,10 @@ func (s *CoreInstanceConfigurationResourceCrud) mapToInstanceConfigurationLaunch
49504962
result.Ocpus = &tmp
49514963
}
49524964

4965+
if resourceManagement, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "resource_management")); ok {
4966+
result.ResourceManagement = oci_core.InstanceConfigurationLaunchInstanceShapeConfigDetailsResourceManagementEnum(resourceManagement.(string))
4967+
}
4968+
49534969
if vcpus, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "vcpus")); ok {
49544970
tmp := vcpus.(int)
49554971
result.Vcpus = &tmp
@@ -4975,6 +4991,8 @@ func InstanceConfigurationLaunchInstanceShapeConfigDetailsToMap(obj *oci_core.In
49754991
result["ocpus"] = float32(*obj.Ocpus)
49764992
}
49774993

4994+
result["resource_management"] = string(obj.ResourceManagement)
4995+
49784996
if obj.Vcpus != nil {
49794997
result["vcpus"] = int(*obj.Vcpus)
49804998
}

internal/service/core/core_instance_resource.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,11 @@ func CoreInstanceResource() *schema.Resource {
808808
Optional: true,
809809
Computed: true,
810810
},
811+
"resource_management": {
812+
Type: schema.TypeString,
813+
Optional: true,
814+
Computed: true,
815+
},
811816
"vcpus": {
812817
Type: schema.TypeInt,
813818
Optional: true,
@@ -3693,6 +3698,10 @@ func (s *CoreInstanceResourceCrud) mapToLaunchInstanceShapeConfigDetails(fieldKe
36933698
result.Ocpus = &tmp
36943699
}
36953700

3701+
if resourceManagement, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "resource_management")); ok {
3702+
result.ResourceManagement = oci_core.LaunchInstanceShapeConfigDetailsResourceManagementEnum(resourceManagement.(string))
3703+
}
3704+
36963705
if vcpus, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "vcpus")); ok {
36973706
tmp := vcpus.(int)
36983707
result.Vcpus = &tmp
@@ -3722,6 +3731,10 @@ func (s *CoreInstanceResourceCrud) mapToUpdateInstanceShapeConfigDetails(fieldKe
37223731
}
37233732
}
37243733

3734+
if resourceManagement, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "resource_management")); ok {
3735+
result.ResourceManagement = oci_core.UpdateInstanceShapeConfigDetailsResourceManagementEnum(resourceManagement.(string))
3736+
}
3737+
37253738
if vcpus, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "vcpus")); ok {
37263739
if s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "vcpus")) {
37273740
tmp := vcpus.(int)
@@ -3778,6 +3791,8 @@ func InstanceShapeConfigToMap(obj *oci_core.InstanceShapeConfig) map[string]inte
37783791
result["processor_description"] = string(*obj.ProcessorDescription)
37793792
}
37803793

3794+
result["resource_management"] = string(obj.ResourceManagement)
3795+
37813796
if obj.Vcpus != nil {
37823797
result["vcpus"] = int(*obj.Vcpus)
37833798
}

website/docs/d/core_instance.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ The following attributes are exported:
216216
* `networking_bandwidth_in_gbps` - The networking bandwidth available to the instance, in gigabits per second.
217217
* `ocpus` - The total number of OCPUs available to the instance.
218218
* `processor_description` - A short description of the instance's processor (CPU).
219+
* `resource_management` - This field is reserved for internal use.
219220
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
220221
* `source_details` -
221222
* `boot_volume_size_in_gbs` - The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 32,768 GB (32 TB).

website/docs/d/core_instance_configuration.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ The following attributes are exported:
268268
* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes.
269269
* `nvmes` - The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
270270
* `ocpus` - The total number of OCPUs available to the instance.
271+
* `resource_management` - This field is reserved for internal use.
271272
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
272273
* `source_details` -
273274
* `boot_volume_id` - The OCID of the boot volume used to boot the instance.
@@ -510,6 +511,7 @@ The following attributes are exported:
510511
* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes.
511512
* `nvmes` - The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
512513
* `ocpus` - The total number of OCPUs available to the instance.
514+
* `resource_management` - This field is reserved for internal use.
513515
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
514516
* `source_details` -
515517
* `boot_volume_id` - The OCID of the boot volume used to boot the instance.

website/docs/d/core_instance_configurations.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ The following attributes are exported:
275275
* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes.
276276
* `nvmes` - The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
277277
* `ocpus` - The total number of OCPUs available to the instance.
278+
* `resource_management` - This field is reserved for internal use.
278279
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
279280
* `source_details` -
280281
* `boot_volume_id` - The OCID of the boot volume used to boot the instance.
@@ -517,6 +518,7 @@ The following attributes are exported:
517518
* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes.
518519
* `nvmes` - The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
519520
* `ocpus` - The total number of OCPUs available to the instance.
521+
* `resource_management` - This field is reserved for internal use.
520522
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
521523
* `source_details` -
522524
* `boot_volume_id` - The OCID of the boot volume used to boot the instance.

website/docs/d/core_instances.html.markdown

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The following attributes are exported:
8989
* `boot_volume_id` - The OCID of the attached boot volume. If the `source_type` is `bootVolume`, this will be the same OCID as the `source_id`.
9090
* `capacity_reservation_id` - The OCID of the compute capacity reservation this instance is launched under. When this field contains an empty string or is null, the instance is not currently in a capacity reservation. For more information, see [Capacity Reservations](https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/reserve-capacity.htm#default).
9191
* `compartment_id` - The OCID of the compartment that contains the instance.
92-
* `compute_host_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the Customer-unique host group
92+
* `compute_host_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the Customer-unique host group
9393
* `dedicated_vm_host_id` - The OCID of the dedicated virtual machine host that the instance is placed on.
9494
* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}`
9595
* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
@@ -231,7 +231,8 @@ The following attributes are exported:
231231
* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes.
232232
* `networking_bandwidth_in_gbps` - The networking bandwidth available to the instance, in gigabits per second.
233233
* `ocpus` - The total number of OCPUs available to the instance.
234-
* `processor_description` - A short description of the instance's processor (CPU).
234+
* `processor_description` - A short description of the instance's processor (CPU).
235+
* `resource_management` - This field is reserved for internal use.
235236
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
236237
* `source_details` -
237238
* `boot_volume_size_in_gbs` - The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 32,768 GB (32 TB).

website/docs/r/core_instance.html.markdown

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ resource "oci_core_instance" "test_instance" {
217217
memory_in_gbs = var.instance_shape_config_memory_in_gbs
218218
nvmes = var.instance_shape_config_nvmes
219219
ocpus = var.instance_shape_config_ocpus
220+
resource_management = var.instance_shape_config_resource_management
220221
vcpus = var.instance_shape_config_vcpus
221222
}
222223
source_details {
@@ -510,7 +511,8 @@ The following arguments are supported:
510511
* `BASELINE_1_1` - baseline usage is an entire OCPU. This represents a non-burstable instance.
511512
* `memory_in_gbs` - (Optional) (Updatable) The total amount of memory available to the instance, in gigabytes.
512513
* `nvmes` - (Optional) (Updatable) The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
513-
* `ocpus` - (Optional) (Updatable) The total number of OCPUs available to the instance.
514+
* `ocpus` - (Optional) (Updatable) The total number of OCPUs available to the instance.
515+
* `resource_management` - (Optional) (Updatable) This field is reserved for internal use.
514516
* `vcpus` - (Optional) (Updatable) The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
515517
* `source_details` - (Optional) (Updatable)
516518
* `boot_volume_size_in_gbs` - (Applicable when source_type=image) (Updatable) The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 32,768 GB (32 TB).
@@ -707,7 +709,8 @@ The following attributes are exported:
707709
* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes.
708710
* `networking_bandwidth_in_gbps` - The networking bandwidth available to the instance, in gigabits per second.
709711
* `ocpus` - The total number of OCPUs available to the instance.
710-
* `processor_description` - A short description of the instance's processor (CPU).
712+
* `processor_description` - A short description of the instance's processor (CPU).
713+
* `resource_management` - This field is reserved for internal use.
711714
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
712715
* `source_details` -
713716
* `boot_volume_size_in_gbs` - The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 32,768 GB (32 TB).

website/docs/r/core_instance_configuration.html.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ resource "oci_core_instance_configuration" "test_instance_configuration" {
210210
memory_in_gbs = var.instance_configuration_instance_details_launch_details_shape_config_memory_in_gbs
211211
nvmes = var.instance_configuration_instance_details_launch_details_shape_config_nvmes
212212
ocpus = var.instance_configuration_instance_details_launch_details_shape_config_ocpus
213+
resource_management = var.instance_configuration_instance_details_launch_details_shape_config_resource_management
213214
vcpus = var.instance_configuration_instance_details_launch_details_shape_config_vcpus
214215
}
215216
source_details {
@@ -406,6 +407,7 @@ resource "oci_core_instance_configuration" "test_instance_configuration" {
406407
memory_in_gbs = var.instance_configuration_instance_details_options_launch_details_shape_config_memory_in_gbs
407408
nvmes = var.instance_configuration_instance_details_options_launch_details_shape_config_nvmes
408409
ocpus = var.instance_configuration_instance_details_options_launch_details_shape_config_ocpus
410+
resource_management = var.instance_configuration_instance_details_options_launch_details_shape_config_resource_management
409411
vcpus = var.instance_configuration_instance_details_options_launch_details_shape_config_vcpus
410412
}
411413
source_details {
@@ -719,6 +721,7 @@ The following arguments are supported:
719721
* `memory_in_gbs` - (Applicable when instance_type=compute) The total amount of memory available to the instance, in gigabytes.
720722
* `nvmes` - (Applicable when instance_type=compute) The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
721723
* `ocpus` - (Applicable when instance_type=compute) The total number of OCPUs available to the instance.
724+
* `resource_management` - (Applicable when instance_type=compute) This field is reserved for internal use.
722725
* `vcpus` - (Applicable when instance_type=compute) The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
723726
* `source_details` - (Applicable when instance_type=compute)
724727
* `boot_volume_id` - (Applicable when source_type=bootVolume) The OCID of the boot volume used to boot the instance.
@@ -964,6 +967,7 @@ The following arguments are supported:
964967
* `memory_in_gbs` - (Applicable when instance_type=instance_options) The total amount of memory available to the instance, in gigabytes.
965968
* `nvmes` - (Applicable when instance_type=instance_options) The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
966969
* `ocpus` - (Applicable when instance_type=instance_options) The total number of OCPUs available to the instance.
970+
* `resource_management` - (Applicable when instance_type=instance_options) This field is reserved for internal use.
967971
* `vcpus` - (Applicable when instance_type=instance_options) The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
968972
* `source_details` - (Applicable when instance_type=instance_options)
969973
* `boot_volume_id` - (Applicable when source_type=bootVolume) The OCID of the boot volume used to boot the instance.
@@ -1260,6 +1264,7 @@ The following attributes are exported:
12601264
* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes.
12611265
* `nvmes` - The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
12621266
* `ocpus` - The total number of OCPUs available to the instance.
1267+
* `resource_management` - This field is reserved for internal use.
12631268
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
12641269
* `source_details` -
12651270
* `boot_volume_id` - The OCID of the boot volume used to boot the instance.
@@ -1501,6 +1506,7 @@ The following attributes are exported:
15011506
* `memory_in_gbs` - The total amount of memory available to the instance, in gigabytes.
15021507
* `nvmes` - The number of NVMe drives to be used for storage. A single drive has 6.8 TB available.
15031508
* `ocpus` - The total number of OCPUs available to the instance.
1509+
* `resource_management` - This field is reserved for internal use.
15041510
* `vcpus` - The total number of VCPUs available to the instance. This can be used instead of OCPUs, in which case the actual number of OCPUs will be calculated based on this value and the actual hardware. This must be a multiple of 2.
15051511
* `source_details` -
15061512
* `boot_volume_id` - The OCID of the boot volume used to boot the instance.

0 commit comments

Comments
 (0)