Instance

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

Bases: object

A compute host. The image used to launch the instance determines its operating system and other software. The shape specified during the launch process determines the number of CPUs and memory allocated to the instance. For more information, see Overview of the Compute Service.

To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies.

Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API.

LAUNCH_MODE_CUSTOM = 'CUSTOM'

A constant which can be used with the launch_mode property of a Instance. This constant has a value of "CUSTOM"

LAUNCH_MODE_EMULATED = 'EMULATED'

A constant which can be used with the launch_mode property of a Instance. This constant has a value of "EMULATED"

LAUNCH_MODE_NATIVE = 'NATIVE'

A constant which can be used with the launch_mode property of a Instance. This constant has a value of "NATIVE"

LAUNCH_MODE_PARAVIRTUALIZED = 'PARAVIRTUALIZED'

A constant which can be used with the launch_mode property of a Instance. This constant has a value of "PARAVIRTUALIZED"

LIFECYCLE_STATE_CREATING_IMAGE = 'CREATING_IMAGE'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "CREATING_IMAGE"

LIFECYCLE_STATE_MOVING = 'MOVING'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "MOVING"

LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "PROVISIONING"

LIFECYCLE_STATE_RUNNING = 'RUNNING'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "RUNNING"

LIFECYCLE_STATE_STARTING = 'STARTING'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "STARTING"

LIFECYCLE_STATE_STOPPED = 'STOPPED'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "STOPPED"

LIFECYCLE_STATE_STOPPING = 'STOPPING'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "STOPPING"

LIFECYCLE_STATE_TERMINATED = 'TERMINATED'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "TERMINATED"

LIFECYCLE_STATE_TERMINATING = 'TERMINATING'

A constant which can be used with the lifecycle_state property of a Instance. This constant has a value of "TERMINATING"

__init__(**kwargs)

Initializes a new Instance 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 Instance.
  • compartment_id (str) -- The value to assign to the compartment_id property of this Instance.
  • dedicated_vm_host_id (str) -- The value to assign to the dedicated_vm_host_id property of this Instance.
  • defined_tags (dict(str, dict(str, object))) -- The value to assign to the defined_tags property of this Instance.
  • display_name (str) -- The value to assign to the display_name property of this Instance.
  • extended_metadata (dict(str, object)) -- The value to assign to the extended_metadata property of this Instance.
  • fault_domain (str) -- The value to assign to the fault_domain property of this Instance.
  • freeform_tags (dict(str, str)) -- The value to assign to the freeform_tags property of this Instance.
  • id (str) -- The value to assign to the id property of this Instance.
  • image_id (str) -- The value to assign to the image_id property of this Instance.
  • ipxe_script (str) -- The value to assign to the ipxe_script property of this Instance.
  • launch_mode (str) -- The value to assign to the launch_mode property of this Instance. Allowed values for this property are: "NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • launch_options (LaunchOptions) -- The value to assign to the launch_options property of this Instance.
  • lifecycle_state (str) -- The value to assign to the lifecycle_state property of this Instance. Allowed values for this property are: "MOVING", "PROVISIONING", "RUNNING", "STARTING", "STOPPING", "STOPPED", "CREATING_IMAGE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • metadata (dict(str, str)) -- The value to assign to the metadata property of this Instance.
  • region (str) -- The value to assign to the region property of this Instance.
  • shape (str) -- The value to assign to the shape property of this Instance.
  • source_details (InstanceSourceDetails) -- The value to assign to the source_details property of this Instance.
  • system_tags (dict(str, dict(str, object))) -- The value to assign to the system_tags property of this Instance.
  • time_created (datetime) -- The value to assign to the time_created property of this Instance.
  • agent_config (InstanceAgentConfig) -- The value to assign to the agent_config property of this Instance.
  • time_maintenance_reboot_due (datetime) -- The value to assign to the time_maintenance_reboot_due property of this Instance.
agent_config

Gets the agent_config of this Instance.

Returns:The agent_config of this Instance.
Return type:InstanceAgentConfig
availability_domain

[Required] Gets the availability_domain of this Instance. The availability domain the instance is running in.

Example: Uocm:PHX-AD-1

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

[Required] Gets the compartment_id of this Instance. The OCID of the compartment that contains the instance.

Returns:The compartment_id of this Instance.
Return type:str
dedicated_vm_host_id

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

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

Gets the defined_tags of this Instance. 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 Instance.
Return type:dict(str, dict(str, object))
display_name

Gets the display_name of this Instance. 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 Instance.
Return type:str
extended_metadata

Gets the extended_metadata of this Instance. 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 Instance.
Return type:dict(str, object)
fault_domain

Gets the fault_domain of this Instance. The name of the fault domain the instance is running in.

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.

Example: FAULT-DOMAIN-1

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

Gets the freeform_tags of this Instance. 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 Instance.
Return type:dict(str, str)
id

[Required] Gets the id of this Instance. The OCID of the instance.

Returns:The id of this Instance.
Return type:str
image_id

Gets the image_id of this Instance. Deprecated. Use sourceDetails instead.

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

Gets the ipxe_script of this Instance. 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 Instance.
Return type:str
launch_mode

Gets the launch_mode of this Instance. Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * NATIVE - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images. * EMULATED - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. * PARAVIRTUALIZED - VM instances launch with paravirtualized devices using virtio drivers. * CUSTOM - VM instances launch with custom configuration settings specified in the LaunchOptions parameter.

Allowed values for this property are: "NATIVE", "EMULATED", "PARAVIRTUALIZED", "CUSTOM", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The launch_mode of this Instance.
Return type:str
launch_options

Gets the launch_options of this Instance.

Returns:The launch_options of this Instance.
Return type:LaunchOptions
lifecycle_state

[Required] Gets the lifecycle_state of this Instance. The current state of the instance.

Allowed values for this property are: "MOVING", "PROVISIONING", "RUNNING", "STARTING", "STOPPING", "STOPPED", "CREATING_IMAGE", "TERMINATING", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The lifecycle_state of this Instance.
Return type:str
metadata

Gets the metadata of this Instance. Custom metadata that you provide.

Returns:The metadata of this Instance.
Return type:dict(str, str)
region

[Required] Gets the region of this Instance. The region that contains the availability domain the instance is running in.

For the us-phoenix-1 and us-ashburn-1 regions, phx and iad are returned, respectively. For all other regions, the full region name is returned.

Examples: phx, eu-frankfurt-1

Returns:The region of this Instance.
Return type:str
shape

[Required] Gets the shape of this Instance. The shape of the instance. The shape determines the number of CPUs and the amount of memory allocated to the instance. You can enumerate all available shapes by calling list_shapes().

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

Gets the source_details of this Instance. Details for creating an instance

Returns:The source_details of this Instance.
Return type:InstanceSourceDetails
system_tags

Gets the system_tags of this Instance. System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace": {"bar-key": "value"}}

Returns:The system_tags of this Instance.
Return type:dict(str, dict(str, object))
time_created

[Required] Gets the time_created of this Instance. The date and time the instance was created, in the format defined by RFC3339.

Example: 2016-08-25T21:10:29.600Z

Returns:The time_created of this Instance.
Return type:datetime
time_maintenance_reboot_due

Gets the time_maintenance_reboot_due of this Instance. The date and time the instance is expected to be stopped / started, in the format defined by RFC3339. After that time if instance hasn't been rebooted, Oracle will reboot the instance within 24 hours of the due time. Regardless of how the instance was stopped, the flag will be reset to empty as soon as instance reaches Stopped state. Example: 2018-05-25T21:10:29.600Z

Returns:The time_maintenance_reboot_due of this Instance.
Return type:datetime