# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

import oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
core_client = oci.core.ComputeManagementClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_instance_configuration_response = core_client.create_instance_configuration(
    create_instance_configuration=oci.core.models.CreateInstanceConfigurationDetails(
        source="NONE",
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        instance_details=oci.core.models.ComputeInstanceDetails(
            instance_type="compute",
            block_volumes=[
                oci.core.models.InstanceConfigurationBlockVolumeDetails(
                    attach_details=oci.core.models.InstanceConfigurationIscsiAttachVolumeDetails(
                        type="iscsi",
                        display_name="EXAMPLE-displayName-Value",
                        is_read_only=False,
                        device="EXAMPLE-device-Value",
                        is_shareable=False,
                        use_chap=False),
                    create_details=oci.core.models.InstanceConfigurationCreateVolumeDetails(
                        availability_domain="EXAMPLE-availabilityDomain-Value",
                        backup_policy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-backupPolicyId-Value",
                        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                        is_auto_tune_enabled=False,
                        block_volume_replicas=[
                            oci.core.models.InstanceConfigurationBlockVolumeReplicaDetails(
                                availability_domain="EXAMPLE-availabilityDomain-Value",
                                display_name="EXAMPLE-displayName-Value")],
                        defined_tags={
                            'EXAMPLE_KEY_jfJD8': {
                                'EXAMPLE_KEY_0Ww5D': 'EXAMPLE--Value'}},
                        display_name="EXAMPLE-displayName-Value",
                        freeform_tags={
                            'EXAMPLE_KEY_3eaBA': 'EXAMPLE_VALUE_oru1zGaARTmUbAG6y3IZ'},
                        kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
                        vpus_per_gb=624,
                        cluster_placement_group_id="ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value",
                        size_in_gbs=233,
                        source_details=oci.core.models.InstanceConfigurationVolumeSourceFromVolumeDetails(
                            type="volume",
                            id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
                        autotune_policies=[
                            oci.core.models.InstanceConfigurationPerformanceBasedAutotunePolicy(
                                autotune_type="PERFORMANCE_BASED",
                                max_vpus_per_gb=0)],
                        xrc_kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-xrcKmsKeyId-Value"),
                    volume_id="ocid1.test.oc1..<unique_ID>EXAMPLE-volumeId-Value")],
            launch_details=oci.core.models.InstanceConfigurationLaunchInstanceDetails(
                availability_domain="EXAMPLE-availabilityDomain-Value",
                capacity_reservation_id="ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value",
                compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                cluster_placement_group_id="ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value",
                create_vnic_details=oci.core.models.InstanceConfigurationCreateVnicDetails(
                    assign_ipv6_ip=True,
                    assign_public_ip=False,
                    assign_private_dns_record=False,
                    defined_tags={
                        'EXAMPLE_KEY_PEYsc': {
                            'EXAMPLE_KEY_ibgYo': 'EXAMPLE--Value'}},
                    display_name="EXAMPLE-displayName-Value",
                    freeform_tags={
                        'EXAMPLE_KEY_LWUvV': 'EXAMPLE_VALUE_gkwGIeNWmhCIW4ai9986'},
                    security_attributes={
                        'EXAMPLE_KEY_J3WJF': {
                            'EXAMPLE_KEY_PVxrY': 'EXAMPLE--Value'}},
                    ipv6_address_ipv6_subnet_cidr_pair_details=[
                        oci.core.models.InstanceConfigurationIpv6AddressIpv6SubnetCidrPairDetails(
                            ipv6_subnet_cidr="EXAMPLE-ipv6SubnetCidr-Value",
                            ipv6_address="EXAMPLE-ipv6Address-Value")],
                    hostname_label="EXAMPLE-hostnameLabel-Value",
                    nsg_ids=["EXAMPLE--Value"],
                    private_ip="EXAMPLE-privateIp-Value",
                    skip_source_dest_check=False,
                    subnet_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
                defined_tags={
                    'EXAMPLE_KEY_BPet6': {
                        'EXAMPLE_KEY_lmTgF': 'EXAMPLE--Value'}},
                security_attributes={
                    'EXAMPLE_KEY_BWbvY': {
                        'EXAMPLE_KEY_yNmiX': 'EXAMPLE--Value'}},
                display_name="EXAMPLE-displayName-Value",
                extended_metadata={
                    'EXAMPLE_KEY_DI5Z5': 'EXAMPLE--Value'},
                freeform_tags={
                    'EXAMPLE_KEY_hbxlj': 'EXAMPLE_VALUE_OwCBT3MqpqjOOiSjvCgB'},
                ipxe_script="EXAMPLE-ipxeScript-Value",
                metadata={
                    'EXAMPLE_KEY_XbLoe': 'EXAMPLE_VALUE_ZtcMhELKaNBU1sY79Y7P'},
                shape="EXAMPLE-shape-Value",
                shape_config=oci.core.models.InstanceConfigurationLaunchInstanceShapeConfigDetails(
                    ocpus=4959.6006,
                    vcpus=822,
                    memory_in_gbs=4106.3174,
                    baseline_ocpu_utilization="BASELINE_1_2",
                    nvmes=1),
                platform_config=oci.core.models.InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfig(
                    type="AMD_MILAN_BM_GPU",
                    is_secure_boot_enabled=False,
                    is_trusted_platform_module_enabled=True,
                    is_measured_boot_enabled=False,
                    is_memory_encryption_enabled=False,
                    numa_nodes_per_socket="NPS2",
                    is_symmetric_multi_threading_enabled=True,
                    is_access_control_service_enabled=True,
                    are_virtual_instructions_enabled=True,
                    is_input_output_memory_management_unit_enabled=False,
                    config_map={
                        'EXAMPLE_KEY_DqyQv': 'EXAMPLE_VALUE_9ZDQDIGs07eApOpR1t7K'}),
                source_details=oci.core.models.InstanceConfigurationInstanceSourceViaImageDetails(
                    source_type="image",
                    boot_volume_size_in_gbs=516,
                    image_id="ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value",
                    kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
                    boot_volume_vpus_per_gb=540,
                    instance_source_image_filter_details=oci.core.models.InstanceConfigurationInstanceSourceImageFilterDetails(
                        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                        defined_tags_filter={
                            'EXAMPLE_KEY_zxohe': {
                                'EXAMPLE_KEY_1j3va': 'EXAMPLE--Value'}},
                        operating_system="EXAMPLE-operatingSystem-Value",
                        operating_system_version="EXAMPLE-operatingSystemVersion-Value")),
                fault_domain="EXAMPLE-faultDomain-Value",
                dedicated_vm_host_id="ocid1.test.oc1..<unique_ID>EXAMPLE-dedicatedVmHostId-Value",
                launch_mode="CUSTOM",
                launch_options=oci.core.models.InstanceConfigurationLaunchOptions(
                    boot_volume_type="PARAVIRTUALIZED",
                    firmware="UEFI_64",
                    network_type="PARAVIRTUALIZED",
                    remote_data_volume_type="SCSI",
                    is_pv_encryption_in_transit_enabled=True,
                    is_consistent_volume_naming_enabled=True),
                agent_config=oci.core.models.InstanceConfigurationLaunchInstanceAgentConfigDetails(
                    is_monitoring_disabled=False,
                    is_management_disabled=True,
                    are_all_plugins_disabled=True,
                    plugins_config=[
                        oci.core.models.InstanceAgentPluginConfigDetails(
                            name="EXAMPLE-name-Value",
                            desired_state="ENABLED")]),
                is_pv_encryption_in_transit_enabled=True,
                preferred_maintenance_action="LIVE_MIGRATE",
                instance_options=oci.core.models.InstanceConfigurationInstanceOptions(
                    are_legacy_imds_endpoints_disabled=False),
                availability_config=oci.core.models.InstanceConfigurationAvailabilityConfig(
                    is_live_migration_preferred=False,
                    recovery_action="RESTORE_INSTANCE"),
                preemptible_instance_config=oci.core.models.PreemptibleInstanceConfigDetails(
                    preemption_action=oci.core.models.TerminatePreemptionAction(
                        type="TERMINATE",
                        preserve_boot_volume=False))),
            secondary_vnics=[
                oci.core.models.InstanceConfigurationAttachVnicDetails(
                    create_vnic_details=oci.core.models.InstanceConfigurationCreateVnicDetails(
                        assign_ipv6_ip=True,
                        assign_public_ip=True,
                        assign_private_dns_record=False,
                        defined_tags={
                            'EXAMPLE_KEY_nTYmd': {
                                'EXAMPLE_KEY_Sfuif': 'EXAMPLE--Value'}},
                        display_name="EXAMPLE-displayName-Value",
                        freeform_tags={
                            'EXAMPLE_KEY_Xd6C2': 'EXAMPLE_VALUE_DGoBm7Jv17O9M0L3cllT'},
                        security_attributes={
                            'EXAMPLE_KEY_mMByN': {
                                'EXAMPLE_KEY_bOEr7': 'EXAMPLE--Value'}},
                        ipv6_address_ipv6_subnet_cidr_pair_details=[
                            oci.core.models.InstanceConfigurationIpv6AddressIpv6SubnetCidrPairDetails(
                                ipv6_subnet_cidr="EXAMPLE-ipv6SubnetCidr-Value",
                                ipv6_address="EXAMPLE-ipv6Address-Value")],
                        hostname_label="EXAMPLE-hostnameLabel-Value",
                        nsg_ids=["EXAMPLE--Value"],
                        private_ip="EXAMPLE-privateIp-Value",
                        skip_source_dest_check=False,
                        subnet_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
                    display_name="EXAMPLE-displayName-Value",
                    nic_index=19)]),
        defined_tags={
            'EXAMPLE_KEY_L9GpG': {
                'EXAMPLE_KEY_7yxOB': 'EXAMPLE--Value'}},
        display_name="EXAMPLE-displayName-Value",
        freeform_tags={
            'EXAMPLE_KEY_29CXV': 'EXAMPLE_VALUE_Bhk1e2BslL2ypWjpv0ER'}),
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

# Get the data from response
print(create_instance_configuration_response.data)