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.

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 list_vnic_attachments() operation to get the VNIC ID for the instance, and then call get_vnic() with the VNIC ID.

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.

Attributes

LAUNCH_MODE_CUSTOM A constant which can be used with the launch_mode property of a Instance.
LAUNCH_MODE_EMULATED A constant which can be used with the launch_mode property of a Instance.
LAUNCH_MODE_NATIVE A constant which can be used with the launch_mode property of a Instance.
LAUNCH_MODE_PARAVIRTUALIZED A constant which can be used with the launch_mode property of a Instance.
LIFECYCLE_STATE_CREATING_IMAGE A constant which can be used with the lifecycle_state property of a Instance.
LIFECYCLE_STATE_MOVING A constant which can be used with the lifecycle_state property of a Instance.
LIFECYCLE_STATE_PROVISIONING A constant which can be used with the lifecycle_state property of a Instance.
LIFECYCLE_STATE_RUNNING A constant which can be used with the lifecycle_state property of a Instance.
LIFECYCLE_STATE_STARTING A constant which can be used with the lifecycle_state property of a Instance.
LIFECYCLE_STATE_STOPPED A constant which can be used with the lifecycle_state property of a Instance.
LIFECYCLE_STATE_STOPPING A constant which can be used with the lifecycle_state property of a Instance.
LIFECYCLE_STATE_TERMINATED A constant which can be used with the lifecycle_state property of a Instance.
LIFECYCLE_STATE_TERMINATING A constant which can be used with the lifecycle_state property of a Instance.
SECURITY_ATTRIBUTES_STATE_STABLE A constant which can be used with the security_attributes_state property of a Instance.
SECURITY_ATTRIBUTES_STATE_UPDATING A constant which can be used with the security_attributes_state property of a Instance.
agent_config Gets the agent_config of this Instance.
availability_config Gets the availability_config of this Instance.
availability_domain [Required] Gets the availability_domain of this Instance.
capacity_reservation_id Gets the capacity_reservation_id of this Instance.
cluster_placement_group_id Gets the cluster_placement_group_id of this Instance.
compartment_id [Required] Gets the compartment_id of this Instance.
dedicated_vm_host_id Gets the dedicated_vm_host_id of this Instance.
defined_tags Gets the defined_tags of this Instance.
display_name Gets the display_name of this Instance.
extended_metadata Gets the extended_metadata of this Instance.
fault_domain Gets the fault_domain of this Instance.
freeform_tags Gets the freeform_tags of this Instance.
id [Required] Gets the id of this Instance.
image_id Gets the image_id of this Instance.
instance_configuration_id Gets the instance_configuration_id of this Instance.
instance_options Gets the instance_options of this Instance.
ipxe_script Gets the ipxe_script of this Instance.
is_cross_numa_node Gets the is_cross_numa_node of this Instance.
launch_mode Gets the launch_mode of this Instance.
launch_options Gets the launch_options of this Instance.
licensing_configs Gets the licensing_configs of this Instance.
lifecycle_state [Required] Gets the lifecycle_state of this Instance.
metadata Gets the metadata of this Instance.
platform_config Gets the platform_config of this Instance.
preemptible_instance_config Gets the preemptible_instance_config of this Instance.
region [Required] Gets the region of this Instance.
security_attributes Gets the security_attributes of this Instance.
security_attributes_state Gets the security_attributes_state of this Instance.
shape [Required] Gets the shape of this Instance.
shape_config Gets the shape_config of this Instance.
source_details Gets the source_details of this Instance.
system_tags Gets the system_tags of this Instance.
time_created [Required] Gets the time_created of this Instance.
time_maintenance_reboot_due Gets the time_maintenance_reboot_due of this Instance.

Methods

__init__(**kwargs) Initializes a new Instance object with values from keyword arguments.
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”

SECURITY_ATTRIBUTES_STATE_STABLE = 'STABLE'

A constant which can be used with the security_attributes_state property of a Instance. This constant has a value of “STABLE”

SECURITY_ATTRIBUTES_STATE_UPDATING = 'UPDATING'

A constant which can be used with the security_attributes_state property of a Instance. This constant has a value of “UPDATING”

__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.
  • capacity_reservation_id (str) – The value to assign to the capacity_reservation_id property of this Instance.
  • compartment_id (str) – The value to assign to the compartment_id property of this Instance.
  • cluster_placement_group_id (str) – The value to assign to the cluster_placement_group_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.
  • security_attributes (dict(str, dict(str, object))) – The value to assign to the security_attributes property of this Instance.
  • security_attributes_state (str) – The value to assign to the security_attributes_state property of this Instance. Allowed values for this property are: “STABLE”, “UPDATING”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • 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 (oci.core.models.LaunchOptions) – The value to assign to the launch_options property of this Instance.
  • instance_options (oci.core.models.InstanceOptions) – The value to assign to the instance_options property of this Instance.
  • availability_config (oci.core.models.InstanceAvailabilityConfig) – The value to assign to the availability_config property of this Instance.
  • preemptible_instance_config (oci.core.models.PreemptibleInstanceConfigDetails) – The value to assign to the preemptible_instance_config 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.
  • shape_config (oci.core.models.InstanceShapeConfig) – The value to assign to the shape_config property of this Instance.
  • is_cross_numa_node (bool) – The value to assign to the is_cross_numa_node property of this Instance.
  • source_details (oci.core.models.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 (oci.core.models.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.
  • platform_config (oci.core.models.PlatformConfig) – The value to assign to the platform_config property of this Instance.
  • instance_configuration_id (str) – The value to assign to the instance_configuration_id property of this Instance.
  • licensing_configs (list[oci.core.models.LicensingConfig]) – The value to assign to the licensing_configs property of this Instance.
agent_config

Gets the agent_config of this Instance.

Returns:The agent_config of this Instance.
Return type:oci.core.models.InstanceAgentConfig
availability_config

Gets the availability_config of this Instance.

Returns:The availability_config of this Instance.
Return type:oci.core.models.InstanceAvailabilityConfig
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
capacity_reservation_id

Gets the capacity_reservation_id of this Instance. 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.

Returns:The capacity_reservation_id of this Instance.
Return type:str
cluster_placement_group_id

Gets the cluster_placement_group_id of this Instance. The OCID of the cluster placement group of the instance.

Returns:The cluster_placement_group_id 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 the dedicated virtual machine host that the instance is placed on.

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.

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.

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
instance_configuration_id

Gets the instance_configuration_id of this Instance. The OCID of the Instance Configuration used to source launch details for this instance. Any other fields supplied in the instance launch request override the details stored in the Instance Configuration for this instance launch.

Returns:The instance_configuration_id of this Instance.
Return type:str
instance_options

Gets the instance_options of this Instance.

Returns:The instance_options of this Instance.
Return type:oci.core.models.InstanceOptions
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. 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, use the following iSCSI IP address: 169.254.0.2, and boot volume IQN: iqn.2015-02.oracle.boot.

If your instance boot volume attachment type is paravirtualized, the boot volume is attached to the instance through virtio-scsi and no iPXE script is used. If your instance boot volume attachment type is paravirtualized and you use custom iPXE to network boot into your instance, the primary boot volume is attached as a data volume through virtio-scsi drive.

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
is_cross_numa_node

Gets the is_cross_numa_node of this Instance. Whether the instance’s OCPUs and memory are distributed across multiple NUMA nodes.

Returns:The is_cross_numa_node of this Instance.
Return type:bool
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 platform 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:oci.core.models.LaunchOptions
licensing_configs

Gets the licensing_configs of this Instance. List of licensing configurations associated with the instance.

Returns:The licensing_configs of this Instance.
Return type:list[oci.core.models.LicensingConfig]
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)
platform_config

Gets the platform_config of this Instance.

Returns:The platform_config of this Instance.
Return type:oci.core.models.PlatformConfig
preemptible_instance_config

Gets the preemptible_instance_config of this Instance.

Returns:The preemptible_instance_config of this Instance.
Return type:oci.core.models.PreemptibleInstanceConfigDetails
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
security_attributes

Gets the security_attributes of this Instance. Security Attributes for this resource. This is unique to ZPR, and helps identify which resources are allowed to be accessed by what permission controls.

Example: {“Oracle-DataSecurity-ZPR”: {“MaxEgressCount”: {“value”:”42”,”mode”:”audit”}}}

Returns:The security_attributes of this Instance.
Return type:dict(str, dict(str, object))
security_attributes_state

Gets the security_attributes_state of this Instance. The lifecycle state of the securityAttributes

Allowed values for this property are: “STABLE”, “UPDATING”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The security_attributes_state 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
shape_config

Gets the shape_config of this Instance.

Returns:The shape_config of this Instance.
Return type:oci.core.models.InstanceShapeConfig
source_details

Gets the source_details of this Instance.

Returns:The source_details of this Instance.
Return type:oci.core.models.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