LaunchInstance

POST {{baseUrl}}/instances/

Creates a new instance in the specified compartment and the specified availability domain. For general information about instances, see Overview of the Compute Service.

For information about access control and compartments, see Overview of the IAM Service.

For information about availability domains, see Regions and Availability Domains. To get a list of availability domains, use the ListAvailabilityDomains operation in the Identity and Access Management Service API.

All Oracle Cloud Infrastructure resources, including instances, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the resource in the Console.

To launch an instance using an image or a boot volume use the sourceDetails parameter in LaunchInstanceDetails.

When you launch an instance, it is automatically attached to a virtual network interface card (VNIC), called the primary VNIC. The VNIC has a private IP address from the subnet's CIDR. You can either assign a private IP address of your choice or let Oracle automatically assign one. You can choose whether the instance has a public IP address. To retrieve the addresses, use the ListVnicAttachments operation to get the VNIC ID for the instance, and then call GetVnic with the VNIC ID.

You can later add secondary VNICs to an instance. For more information, see Virtual Network Interface Cards (VNICs).

To launch an instance from a Marketplace image listing, you must provide the image ID of the listing resource version that you want, but you also must subscribe to the listing before you try to launch the instance. To subscribe to the listing, use the GetAppCatalogListingAgreements operation to get the signature for the terms of use agreement for the desired listing resource version. Then, call CreateAppCatalogSubscription with the signature. To get the image ID for the LaunchInstance operation, call GetAppCatalogListingResourceVersion.

Request Body

{"compartmentId"=>"{{compartment_ocid}}", "shape"=>"VM.Standard.E3.Flex", "availabilityDomain"=>"zzzZ:US-ASHBURN-AD-1", "agentConfig"=>{"isMonitoringDisabled"=>false, "isManagementDisabled"=>false, "areAllPluginsDisabled"=>false, "pluginsConfig"=>nil}, "availabilityConfig"=>{"isLiveMigrationPreferred"=>nil, "recoveryAction"=>"RESTORE_INSTANCE"}, "capacityReservationId"=>"minim anim dolore aute", "createVnicDetails"=>{"assignPrivateDnsRecord"=>"value", "assignPublicIp"=>"value", "definedTags"=>"value", "displayName"=>"value", "freeformTags"=>"value", "hostnameLabel"=>"value", "nsgIds"=>"value", "privateIp"=>"value", "skipSourceDestCheck"=>"value", "subnetId"=>"value", "vlanId"=>"value"}, "dedicatedVmHostId"=>"eu aute nulla cupidatat", "displayName"=>"labore non dolore", "faultDomain"=>"in id commodo mollit", "hostnameLabel"=>"mollit", "imageId"=>"minim tempor ipsum proident", "instanceOptions"=>{"areLegacyImdsEndpointsDisabled"=>false}, "ipxeScript"=>"exercitation ea sint enim", "isPvEncryptionInTransitEnabled"=>false, "launchMode"=>"NATIVE", "launchOptions"=>{"bootVolumeType"=>"PARAVIRTUALIZED", "firmware"=>"UEFI_64", "networkType"=>"VFIO", "remoteDataVolumeType"=>"PARAVIRTUALIZED", "isPvEncryptionInTransitEnabled"=>false, "isConsistentVolumeNamingEnabled"=>true}, "platformConfig"=>{"type"=>"value", "isMeasuredBootEnabled"=>"value", "isSecureBootEnabled"=>"value", "isTrustedPlatformModuleEnabled"=>"value"}, "preemptibleInstanceConfig"=>{"preemptionAction"=>"value"}, "shapeConfig"=>{"baselineOcpuUtilization"=>nil, "memoryInGBs"=>16.0, "ocpus"=>1.0}, "sourceDetails"=>{"sourceType"=>"image", "bootVolumeSizeInGBs"=>nil, "imageId"=>"ocid1.image.oc1....", "kmsKeyId"=>nil}, "subnetId"=>"fugiat"}

HEADERS

KeyDatatypeRequiredDescription
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or
server error without risk of executing that same action again. Retry tokens expire after 24
hours, but can be invalidated before then due to conflicting operations (for example, if a resource
has been deleted and purged from the system, then a retry of the original creation request
may be rejected).
Content-Typestring
Datestring(Required) Current Date
Authorizationstring(Required) Signature Authentication on Authorization header
x-content-sha256string(Required) Content sha256 for POST, PUT and PATCH operations

RESPONSES

status: OK

{"id":"sit dolor","compartmentId":"et esse","shape":"sunt veniam","region":"laboris","availabilityDomain":"dolor","lifecycleState":"TERMINATED","timeCreated":"2006-02-03T20:50:31.716Z","agentConfig":{"areAllPluginsDisabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"isManagementDisabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"isMonitoringDisabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"pluginsConfig":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"availabilityConfig":{"isLiveMigrationPreferred":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"recoveryAction":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"capacityReservationId":"occaecat sint id","dedicatedVmHostId":"ipsum dolor incididunt sit ex","definedTags":{},"displayName":"consequat aliquip magna ullamco","extendedMetadata":{},"faultDomain":"incididunt esse","freeformTags":{},"imageId":"dolor nulla consequat ipsum","instanceOptions":{"areLegacyImdsEndpointsDisabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"ipxeScript":"anim magna","launchMode":"CUSTOM","launchOptions":{"bootVolumeType":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"firmware":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"isConsistentVolumeNamingEnabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"isPvEncryptionInTransitEnabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"networkType":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"remoteDataVolumeType":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"metadata":{},"platformConfig":{"type":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"isMeasuredBootEnabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"isSecureBootEnabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"isTrustedPlatformModuleEnabled":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"preemptibleInstanceConfig":{"preemptionAction":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"shapeConfig":{"baselineOcpuUtilization":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"gpuDescription":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"gpus":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"localDiskDescription":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"localDisks":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"localDisksTotalSizeInGBs":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"maxVnicAttachments":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"memoryInGBs":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"networkingBandwidthInGbps":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"ocpus":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"processorDescription":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"sourceDetails":{"sourceType":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"timeMaintenanceRebootDue":"1973-07-06T14:36:00.263Z"}