LaunchInstanceDetails

class oci.core.models.LaunchInstanceDetails(**kwargs)

Bases: object

Instance launch details. Use the sourceDetails parameter to specify whether a boot volume or an image should be used to launch a new instance.

__init__(**kwargs)

Initializes a new LaunchInstanceDetails object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • availability_domain (str) -- The value to assign to the availability_domain property of this LaunchInstanceDetails.
  • compartment_id (str) -- The value to assign to the compartment_id property of this LaunchInstanceDetails.
  • create_vnic_details (CreateVnicDetails) -- The value to assign to the create_vnic_details property of this LaunchInstanceDetails.
  • dedicated_vm_host_id (str) -- The value to assign to the dedicated_vm_host_id property of this LaunchInstanceDetails.
  • defined_tags (dict(str, dict(str, object))) -- The value to assign to the defined_tags property of this LaunchInstanceDetails.
  • display_name (str) -- The value to assign to the display_name property of this LaunchInstanceDetails.
  • extended_metadata (dict(str, object)) -- The value to assign to the extended_metadata property of this LaunchInstanceDetails.
  • fault_domain (str) -- The value to assign to the fault_domain property of this LaunchInstanceDetails.
  • freeform_tags (dict(str, str)) -- The value to assign to the freeform_tags property of this LaunchInstanceDetails.
  • hostname_label (str) -- The value to assign to the hostname_label property of this LaunchInstanceDetails.
  • image_id (str) -- The value to assign to the image_id property of this LaunchInstanceDetails.
  • ipxe_script (str) -- The value to assign to the ipxe_script property of this LaunchInstanceDetails.
  • launch_options (LaunchOptions) -- The value to assign to the launch_options property of this LaunchInstanceDetails.
  • metadata (dict(str, str)) -- The value to assign to the metadata property of this LaunchInstanceDetails.
  • agent_config (LaunchInstanceAgentConfigDetails) -- The value to assign to the agent_config property of this LaunchInstanceDetails.
  • shape (str) -- The value to assign to the shape property of this LaunchInstanceDetails.
  • source_details (InstanceSourceDetails) -- The value to assign to the source_details property of this LaunchInstanceDetails.
  • subnet_id (str) -- The value to assign to the subnet_id property of this LaunchInstanceDetails.
  • is_pv_encryption_in_transit_enabled (bool) -- The value to assign to the is_pv_encryption_in_transit_enabled property of this LaunchInstanceDetails.
agent_config

Gets the agent_config of this LaunchInstanceDetails.

Returns:The agent_config of this LaunchInstanceDetails.
Return type:LaunchInstanceAgentConfigDetails
availability_domain

[Required] Gets the availability_domain of this LaunchInstanceDetails. The availability domain of the instance.

Example: Uocm:PHX-AD-1

Returns:The availability_domain of this LaunchInstanceDetails.
Return type:str
compartment_id

[Required] Gets the compartment_id of this LaunchInstanceDetails. The OCID of the compartment.

Returns:The compartment_id of this LaunchInstanceDetails.
Return type:str
create_vnic_details

Gets the create_vnic_details of this LaunchInstanceDetails. Details for the primary VNIC, which is automatically created and attached when the instance is launched.

Returns:The create_vnic_details of this LaunchInstanceDetails.
Return type:CreateVnicDetails
dedicated_vm_host_id

Gets the dedicated_vm_host_id of this LaunchInstanceDetails. The OCID of dedicated VM host.

Returns:The dedicated_vm_host_id of this LaunchInstanceDetails.
Return type:str
defined_tags

Gets the defined_tags of this LaunchInstanceDetails. Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

Returns:The defined_tags of this LaunchInstanceDetails.
Return type:dict(str, dict(str, object))
display_name

Gets the display_name of this LaunchInstanceDetails. A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Example: My bare metal instance

Returns:The display_name of this LaunchInstanceDetails.
Return type:str
extended_metadata

Gets the extended_metadata of this LaunchInstanceDetails. Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the 'metadata' object.

They are distinguished from 'metadata' fields in that these can be nested JSON objects (whereas 'metadata' fields are string/string maps only).

Returns:The extended_metadata of this LaunchInstanceDetails.
Return type:dict(str, object)
fault_domain

Gets the fault_domain of this LaunchInstanceDetails. A fault domain is a grouping of hardware and infrastructure within an availability domain. Each availability domain contains three fault domains. Fault domains let you distribute your instances so that they are not on the same physical hardware within a single availability domain. A hardware failure or Compute hardware maintenance that affects one fault domain does not affect instances in other fault domains.

If you do not specify the fault domain, the system selects one for you. To change the fault domain for an instance, terminate it and launch a new instance in the preferred fault domain.

To get a list of fault domains, use the list_fault_domains() operation in the Identity and Access Management Service API.

Example: FAULT-DOMAIN-1

Returns:The fault_domain of this LaunchInstanceDetails.
Return type:str
freeform_tags

Gets the freeform_tags of this LaunchInstanceDetails. Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

Returns:The freeform_tags of this LaunchInstanceDetails.
Return type:dict(str, str)
hostname_label

Gets the hostname_label of this LaunchInstanceDetails. Deprecated. Instead use hostnameLabel in CreateVnicDetails. If you provide both, the values must match.

Returns:The hostname_label of this LaunchInstanceDetails.
Return type:str
image_id

Gets the image_id of this LaunchInstanceDetails. Deprecated. Use sourceDetails with instance_source_via_image_details() source type instead. If you specify values for both, the values must match.

Returns:The image_id of this LaunchInstanceDetails.
Return type:str
ipxe_script

Gets the ipxe_script of this LaunchInstanceDetails. This is an advanced option.

When a bare metal or virtual machine instance boots, the iPXE firmware that runs on the instance is configured to run an iPXE script to continue the boot process.

If you want more control over the boot process, you can provide your own custom iPXE script that will run when the instance boots; however, you should be aware that the same iPXE script will run every time an instance boots; not only after the initial LaunchInstance call.

The default iPXE script connects to the instance's local boot volume over iSCSI and performs a network boot. If you use a custom iPXE script and want to network-boot from the instance's local boot volume over iSCSI the same way as the default iPXE script, you should use the following iSCSI IP address: 169.254.0.2, and boot volume IQN: iqn.2015-02.oracle.boot.

For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see Bring Your Own Image.

For more information about iPXE, see http://ipxe.org.

Returns:The ipxe_script of this LaunchInstanceDetails.
Return type:str
is_pv_encryption_in_transit_enabled

Gets the is_pv_encryption_in_transit_enabled of this LaunchInstanceDetails. Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false.

Returns:The is_pv_encryption_in_transit_enabled of this LaunchInstanceDetails.
Return type:bool
launch_options

Gets the launch_options of this LaunchInstanceDetails.

Returns:The launch_options of this LaunchInstanceDetails.
Return type:LaunchOptions
metadata

Gets the metadata of this LaunchInstanceDetails. Custom metadata key/value pairs that you provide, such as the SSH public key required to connect to the instance.

A metadata service runs on every launched instance. The service is an HTTP endpoint listening on 169.254.169.254. You can use the service to:

  • Provide information to Cloud-Init to be used for various system initialization tasks.
  • Get information about the instance, including the custom metadata that you provide when you launch the instance.

Providing Cloud-Init Metadata

You can use the following metadata key names to provide information to Cloud-Init:

"ssh_authorized_keys" - Provide one or more public SSH keys to be included in the ~/.ssh/authorized_keys file for the default user on the instance. Use a newline character to separate multiple keys. The SSH keys must be in the format necessary for the authorized_keys file, as shown in the example below.

"user_data" - Provide your own base64-encoded data to be used by Cloud-Init to run custom scripts or provide custom Cloud-Init configuration. For information about how to take advantage of user data, see the Cloud-Init Documentation.

Note: Cloud-Init does not pull this data from the http://169.254.169.254/opc/v1/instance/metadata/ path. When the instance launches and either of these keys are provided, the key values are formatted as OpenStack metadata and copied to the following locations, which are recognized by Cloud-Init:

http://169.254.169.254/openstack/latest/meta_data.json - This JSON blob contains, among other things, the SSH keys that you provided for

"ssh_authorized_keys".

http://169.254.169.254/openstack/latest/user_data - Contains the base64-decoded data that you provided for "user_data".

Metadata Example

"metadata" : {
"quake_bot_level" : "Severe", "ssh_authorized_keys" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCZ06fccNTQfq+xubFlJ5ZR3kt+uzspdH9tXL+lAejSM1NXM+CFZev7MIxfEjas06y80ZBZ7DUTQO0GxJPeD8NCOb1VorF8M4xuLwrmzRtkoZzU16umt4y1W0Q4ifdp3IiiU0U8/WxczSXcUVZOLqkz5dc6oMHdMVpkimietWzGZ4LBBsH/LjEVY7E0V+a0sNchlVDIZcm7ErReBLcdTGDq0uLBiuChyl6RUkX1PNhusquTGwK7zc8OBXkRuubn5UKXhI3Ul9Nyk4XESkVWIGNKmw8mSpoJSjR8P9ZjRmcZVo8S+x4KVPMZKQEor== ryan.smith@company.com ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAzJSAtwEPoB3Jmr58IXrDGzLuDYkWAYg8AsLYlo6JZvKpjY1xednIcfEVQJm4T2DhVmdWhRrwQ8DmayVZvBkLt+zs2LdoAJEVimKwXcJFD/7wtH8Lnk17HiglbbbNXsemjDY0hea4JUE5CfvkIdZBITuMrfqSmA4n3VNoorXYdvtTMoGG8fxMub46RPtuxtqi9bG9Zqenordkg5FJt2mVNfQRqf83CWojcOkklUWq4CjyxaeLf5i9gv1fRoBo4QhiA8I6NCSppO8GnoV/6Ox6TNoh9BiifqGKC9VGYuC89RvUajRBTZSK2TK4DPfaT+2R+slPsFrwiT/oPEhhEK1S5Q== rsa-key-20160227", "user_data" : "SWYgeW91IGNhbiBzZWUgdGhpcywgdGhlbiBpdCB3b3JrZWQgbWF5YmUuCg=="

}

Getting Metadata on the Instance

To get information about your instance, connect to the instance using SSH and issue any of the following GET requests:

You'll get back a response that includes all the instance information; only the metadata information; or the metadata information for the specified key name, respectively.

Returns:The metadata of this LaunchInstanceDetails.
Return type:dict(str, str)
shape

[Required] Gets the shape of this LaunchInstanceDetails. The shape of an instance. The shape determines the number of CPUs, amount of memory, and other resources allocated to the instance.

You can enumerate all available shapes by calling list_shapes().

Returns:The shape of this LaunchInstanceDetails.
Return type:str
source_details

Gets the source_details of this LaunchInstanceDetails. Details for creating an instance. Use this parameter to specify whether a boot volume or an image should be used to launch a new instance.

Returns:The source_details of this LaunchInstanceDetails.
Return type:InstanceSourceDetails
subnet_id

Gets the subnet_id of this LaunchInstanceDetails. Deprecated. Instead use subnetId in CreateVnicDetails. At least one of them is required; if you provide both, the values must match.

Returns:The subnet_id of this LaunchInstanceDetails.
Return type:str