oci_instance - Launch, terminate and control the lifecycle of OCI Compute instances

New in version 2.5.

Synopsis

  • This module allows the user to launch/create, terminate and perform other power actions on OCI Compute Service instances. An instance represents 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 at https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Concepts/computeoverview.htm. In experimental mode, this module also allows attaching/detaching volumes and boot volumes to an instance.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_OCID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_type
    Choices:
  • api_key ←
  • instance_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
availability_domain
The Availability Domain of the instance. Required when creating a compute instance with state=present.
boot_volume_details
Details for attaching/detaching a boot volume to/from an instance. boot_volume_details is mutually exclusive with image_id. This option is only supported in experimental mode. To use an experimental feature, set the environment variable OCI_ANSIBLE_EXPERIMENTAL to True.
attachment_state
    Choices:
  • present ←
  • absent
Attach a boot volume to the instance instance_id with attachment_state=present. Detach a boot volume from the instance instance_id with attachment_state=absent.
boot_volume_id
required
The OCID of the boot volume.
compartment_id
The OCID of the compartment. Required when state=present.
config_file_location
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name Default:
DEFAULT
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
count_tag
Used with exact_count to determine how many compute instances matching the specific tag criteria count_tag must be running. Only defined_tags associated with an instance are considered for matching against count_tag.
defined_tags
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm.
display_name
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. If a display_name is specified, and if exact_count is specified, the display name would be suffixed with an auto-incrementing integer.

aliases: name
exact_count
Indicates how many instances that match the count_tag option should be running. This must be used with state=present and a valid count_tag. If the number of compute instances that match count_tag is lesser than exact_count, additional compute instances would be provisioned to match the desired exact_count. If the number of matching compute instances is larger than exact_count, compute instances would be terminated to match the desired exact_count. The latest launch instance(s) from the set of instances that match count_tag are picked for termination. Private IP assignments through private_ip, and specification of hostname_label and volume_details and boot_volume_details is not supported with exact_count and count_tag. By default, an auto-incremented integer value is suffixed to the value of display_name and assigned as the display_name of a newly provisioned instance. For example, if display_name is 'my_web_server', new compute instances would be called 'my_web_server_0', 'my_web_server_1' and so on. To control the generated display name in a fine-grained manner, use "printf" style format in display_name such as 'my_%d_web_server'.
extended_metadata
Additional metadata key/value pairs that you provide. They serve a similar purpose and functionality from 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). If you don't need nested metadata values, it is strongly advised to avoid using this object and use the Metadata object instead.
fault_domain
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 oci_fault_domain_facts.
force_create
bool
    Choices:
  • no ←
  • yes
Whether to attempt non-idempotent creation of a resource. By default, create resource is an idempotent operation, and doesn't create the resource if it already exists. Setting this option to true, forcefully creates a copy of the resource, even if it already exists.This option is mutually exclusive with key_by.
freeform_tags
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 https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm.
image_id
The OCID of the image used to boot the instance. Required to launch an instance using an image with state=present. image_id is mutually exclusive with boot_volume_details. This can also be provided through source_details.
instance_id
The OCID of the compute instance. Required for updating an existing compute instance when state=present, for performing power actions (such as start, stop, softreset or reset) on an instance, and for terminating an instance state=absent.

aliases: id
ipxe_script
custom iPXE script that will run when the instance boots.
key_by
The list of comma-separated attributes of this resource which should be used to uniquely identify an instance of the resource. By default, all the attributes of a resource except freeform_tags are used to uniquely identify a resource.
metadata
A hash/dictionary of custom key/value pairs that are associated with the instance. This option is also used to provide information to cloud-init and specifying "ssh_authorized_keys" for the default user of the instance. This hash is specified as '{"key":"value"}' and '{"key":"value","key":"value"}'.
preserve_boot_volume
bool
    Choices:
  • no ←
  • yes
Whether to preserve the boot volume when terminating an instance with state=absent.
region
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
shape
The shape of the instance. Required when creating a compute instance with state=present.
source_details
required
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.
boot_volume_id
The OCID of the boot volume used to boot the instance. Required if source_type is "bootVolume".
image_id
The OCID of the image used to boot the instance. Required if source_type is "image".
source_type
required
    Choices:
  • image
  • bootVolume
The source type for the instance. Use image when specifying the image OCID. Use bootVolume when specifying the boot volume OCID.
state
    Choices:
  • present ←
  • absent
  • running
  • reset
  • softreset
  • stopped
The state of the instance that must be asserted to. When state=present, and the compute instance doesn't exist, the instance is launched/created with the specified details. When state=absent, the compute instance is terminated. When state=stopped, the compute instance is powered off. When state=running, the compute instance is powered on. When state=softreset, an ACPI shutdown is initiated and the compute instance is powered on. When state=reset, the compute instance is powered off and then powered on. Note that state=softreset and state=reset states are not idempotent. Every time a play is executed with these state options, a shutdown and a power on sequence is executed against the instance.
tenancy
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm
vnic
Details for the primary VNIC that is automatically created and attached when the instance is launched. Required when creating a compute instance with state=present.

aliases: create_vnic_details
skip_source_dest_check Default:
no
Determines whether the source/destination check is disabled on the VNIC. Defaults to false, which means the check is performed.
name
A user-friendly name for the VNIC. Does not have to be unique.
hostname_label
The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname portion of the primary private IP's fully qualified domain name (FQDN) (for example, bminstance-1 in FQDN bminstance-1.subnet123.vcn1.oraclevcn.com). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.
assign_public_ip
Determines whether the VNIC should be assigned a public IP address. If not set and the VNIC is being created in a private subnet (that is, where prohibitPublicIpOnVnic = true in the Subnet), then no public IP address is assigned. If not set and the subnet is public prohibitPublicIpOnVnic = false, then a public IP address is assigned. If set to true and prohibitPublicIpOnVnic = true, an error is returned.
subnet_id
required
The OCID of the subnet to create the VNIC in.
private_ip
The private IP to assign to the VNIC. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. This is the VNIC's primary private IP address.
volume_details
Details for attaching or detaching a volume to an instance with state=present or state=RUNNING. This option is only supported in experimental mode. To use an experimental feature, set the environment variable OCI_ANSIBLE_EXPERIMENTAL to True.
attachment_name
A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information.
attachment_state
    Choices:
  • present ←
  • absent
Attach a volume to the instance instance_id with attachment_state=present. Detach a volume from the instance instance_id with attachment_state=absent.
type
    Choices:
  • iscsi ←
The type of volume. The only supported value is "iscsi".
volume_id
The OCID of the volume to be attached to or detached from the instance instance_id.
wait
bool
    Choices:
  • no
  • yes ←
Whether to wait for create or delete operation to complete.
wait_timeout Default:
1200
Time, in seconds, to wait when wait=yes.
wait_until
The lifecycle state to wait for the resource to transition into when wait=yes. By default, when wait=yes, we wait for the resource to get into ACTIVE/ATTACHED/AVAILABLE/PROVISIONED/ RUNNING applicable lifecycle state during create operation & to get into DELETED/DETACHED/ TERMINATED lifecycle state during delete operation.

Examples

- name: Launch/create an instance using an image, with custom metadata and a private IP assignment
  oci_instance:
     name: myinstance1
     availability_domain: "BnQb:PHX-AD-1"
     compartment_id: "ocid1.compartment.oc1..xxxxxEXAMPLExxxxx...vm62xq"
     image_id: "ocid1.image.oc1.phx.xxxxxEXAMPLExxxxx...sa7klnoa"
     shape: "BM.Standard1.36"
     metadata:
        foo: bar
        baz: quux
     volume_details:
        attachment_state: present
        volume_id: ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
     vnic:
        hostname_label: "myinstance1"
        private_ip: "10.0.0.5"
        subnet_id: "ocid1.subnet.oc1.phx.xxxxxEXAMPLExxxxx...5iddusmpqpaoa"

- name: Launch/create an instance using a boot volume, a private IP assignment and attach a volume, and a specific
        fault domain
  oci_instance:
     name: myinstance2
     availability_domain: "BnQb:PHX-AD-1"
     fault_domain: "FAULT-DOMAIN-2"
     source_details:
        source_type: bootVolume
        boot_volume_id: ocid1.bootvolume.oc1.iad.xxxxxEXAMPLExxxxx
     compartment_id: "ocid1.compartment.oc1..xxxxxEXAMPLExxxxx...vm62xq"
     shape: "BM.Standard1.36"
     volume_details:
        attachment_state: present
        volume_id: ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
     vnic:
        hostname_label: "myinstance2"
        private_ip: "10.0.0.6"
        subnet_id: "ocid1.subnet.oc1.phx.xxxxxEXAMPLExxxxx...5iddusmpqpaoa"

- name: Update an instance's name
  oci_instance:
     name: myinstance1-new-name
     id: "ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx...lxiggdq"

- name: Detach a volume from an instance
  oci_instance:
     id: "ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx...lxiggdq"
     volume_details:
        attachment_state: absent
        volume_id: ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx

- name: Stop an instance
  oci_instance:
     id: "ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx...lxiggdq"
     state: "stopped"

- name: Stop an instance and detach boot volume
  oci_instance:
     id: "ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx...lxiggdq"
     state: "stopped"
     boot_volume_details:
        boot_volume_id: ocid1.bootvolume.oc1.iad.xxxxxEXAMPLExxxxx
        attachment_state: absent

- name: Attach a boot volume & Start an instance
  oci_instance:
     id: "ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx...lxiggdq"
     state: "running"
     boot_volume_details:
        boot_volume_id: ocid1.bootvolume.oc1.iad.xxxxxEXAMPLExxxxx

- name: Reset an instance
  oci_instance:
     id: "ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx...lxiggdq"
     state: "reset"

- name: Terminate/delete an instance
  oci_instance:
     id: "ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx...lxiggdq"
     state: "absent"

- name: Terminate/delete an instance and preserve boot volume
  oci_instance:
     id: "ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx...lxiggdq"
     state: "absent"
     preserve_boot_volume: yes

- name: Ensure 3 web-server instances with the defined tag namespace "TagNamespace1", tag key "Application" and
        value "App1" are running
  oci_instance:
     name: my-web-server
     availability_domain: "BnQb:PHX-AD-1"
     compartment_id: "ocid1.compartment.oc1..xxxxxEXAMPLExxxxx...vm62xq"
     image_id: "ocid1.image.oc1.phx.xxxxxEXAMPLExxxxx...sa7klnoa"
     shape: "BM.Standard1.36"
     vnic:
        subnet_id: "ocid1.subnet.oc1.phx.xxxxxEXAMPLExxxxx...5iddusmpqpaoa"
     defined_tags:
        TagNamespace1: { Application: App1 }
     exact_count: 3
     count_tag:
        TagNamespace1: { Application: App1 }

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
added_instances
complex
On successful addition of new compute instances
Details of newly added compute instances

Sample:
Same as the instances sample
  lifecycle_state
string
always
The current state of the instance.

Sample:
TERMINATED
  availability_domain
string
always
The Availability Domain the instance is running in.

Sample:
BnQb:PHX-AD-1
  extended_metadata
dict(str, str)
always
Additional key-value pairs associated with the instance

Sample:
{'foo': 'bar'}
  compartment_id
string
always
The OCID of the compartment that contains the instance.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx....62xq
  region
string
always
The region that contains the Availability Domain the instance is running in.

Sample:
phx
  time_created
string
always
The date and time the instance was created, in the format defined by RFC3339

Sample:
2017-11-20 04:52:54.541000
  display_name
string
always
A user-friendly name for the instance

Sample:
ansible-instance-968
  image_id
string
always
The OCID of the image that the instance is based on

Sample:
ocid1.image.oc1.iad.xxxxxEXAMPLExxxxx
  shape
string
always
The shape of the instance. The shape determines the number of CPUs and the amount of memory allocated to the instance.

Sample:
BM.Standard1.36
  ipxe_script
string
always
A custom iPXE script that will run when the instance boots

  volume_attachments
complex
In experimental mode.
List of information about volume attachments

    lifecycle_state
string
always
The current state of the volume attachment.

Sample:
ATTACHED
    availability_domain
string
always
The Availability Domain of an instance.

Sample:
BnQb:PHX-AD-1
    display_name
string
always
A user-friendly name. Does not have to be unique, and it cannot be changed.

Sample:
My volume attachment
    compartment_id
string
always
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx
    chap_username
string
always
The volume's system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name.

Sample:
ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
    time_created
string
always
The date and time the volume was created, in the format defined by RFC3339.

Sample:
2016-08-25 21:10:29.600000
    id
string
always
The OCID of the volume attachment.

Sample:
ocid1.volumeattachment.oc1.phx.xxxxxEXAMPLExxxxx
    instance_id
string
always
The OCID of the instance the volume is attached to.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
    iqn
string
always
The target volume's iSCSI Qualified Name in the format defined by RFC 3720.

Sample:
iqn.2015-12.us.oracle.com:456b0391-17b8-4122-bbf1-f85fc0bb97d9
    ipv4
string
always
The volume's iSCSI IP address.

Sample:
169.254.0.2
    volume_id
string
always
The OCID of the volume.

Sample:
ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
    attachment_type
string
always
The type of volume attachment.

Sample:
iscsi
    port
int
always
The volume's iSCSI port.

Sample:
3260
    chap_secret
string
always
The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name. (Also called the "CHAP password".)

Sample:
d6866c0d-298b-48ba-95af-309b4faux45e
  boot_volume_attachment
dict
In experimental mode.
Information of the boot volume attachment.

    boot_volume_id
string
always
The OCID of the boot volume.

Sample:
ocid1.bootvolume.oc1.iad.xxxxxEXAMPLExxxxx
    availability_domain
string
always
The Availability Domain of the instance.

Sample:
BnQb:PHX-AD-1
    display_name
string
always
A user-friendly name. Does not have to be unique, and it cannot be changed.

Sample:
My boot volume attachment
    compartment_id
string
always
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx
    lifecycle_state
string
always
The current state of the boot volume attachment.

Sample:
ATTACHED
    time_created
string
always
The date and time the boot volume was created, in the format defined by RFC3339.

Sample:
2016-08-25 21:10:29.600000
    instance_id
string
always
The OCID of the instance the boot volume is attached to.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
    id
string
always
The OCID of the boot volume attachment.

Sample:
ocid1.instance.oc1.iad.xxxxxEXAMPLExxxxx
  id
string
always
The OCID of the instance.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
  metadata
dict(str, str)
always
Custom metadata that was associated with the instance

Sample:
{'foo': 'bar'}
instance
complex
On successful operation (create, update and terminate) on a single Compute instance
Details of the OCI compute instance launched, updated or terminated as a result of the current operation

  lifecycle_state
string
always
The current state of the instance.

Sample:
TERMINATED
  fault_domain
string
always
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.

Sample:
FAULT-DOMAIN-1
  extended_metadata
dict(str, str)
always
Additional key-value pairs associated with the instance

Sample:
{'foo': 'bar'}
  compartment_id
string
always
The OCID of the compartment that contains the instance.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx....62xq
  region
string
always
The region that contains the Availability Domain the instance is running in.

Sample:
phx
  time_created
string
always
The date and time the instance was created, in the format defined by RFC3339

Sample:
2017-11-20 04:52:54.541000
  display_name
string
always
A user-friendly name for the instance

Sample:
ansible-instance-968
  image_id
string
always
The OCID of the image that the instance is based on

Sample:
ocid1.image.oc1.iad.xxxxxEXAMPLExxxxx
  shape
string
always
The shape of the instance. The shape determines the number of CPUs and the amount of memory allocated to the instance.

Sample:
BM.Standard1.36
  availability_domain
string
always
The Availability Domain the instance is running in.

Sample:
BnQb:PHX-AD-1
  volume_attachments
complex
In experimental mode.
List of information about volume attachments

    lifecycle_state
string
always
The current state of the volume attachment.

Sample:
ATTACHED
    availability_domain
string
always
The Availability Domain of an instance.

Sample:
BnQb:PHX-AD-1
    display_name
string
always
A user-friendly name. Does not have to be unique, and it cannot be changed.

Sample:
My volume attachment
    compartment_id
string
always
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx
    chap_username
string
always
The volume's system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name.

Sample:
ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
    time_created
string
always
The date and time the volume was created, in the format defined by RFC3339.

Sample:
2016-08-25 21:10:29.600000
    id
string
always
The OCID of the volume attachment.

Sample:
ocid1.volumeattachment.oc1.phx.xxxxxEXAMPLExxxxx
    instance_id
string
always
The OCID of the instance the volume is attached to.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
    iqn
string
always
The target volume's iSCSI Qualified Name in the format defined by RFC 3720.

Sample:
iqn.2015-12.us.oracle.com:456b0391-17b8-4122-bbf1-f85fc0bb97d9
    ipv4
string
always
The volume's iSCSI IP address.

Sample:
169.254.0.2
    volume_id
string
always
The OCID of the volume.

Sample:
ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
    attachment_type
string
always
The type of volume attachment.

Sample:
iscsi
    port
int
always
The volume's iSCSI port.

Sample:
3260
    chap_secret
string
always
The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name. (Also called the "CHAP password".)

Sample:
d6866c0d-298b-48ba-95af-309b4faux45e
  ipxe_script
string
always
A custom iPXE script that will run when the instance boots

  boot_volume_attachment
dict
In experimental mode.
Information of the boot volume attachment.

    boot_volume_id
string
always
The OCID of the boot volume.

Sample:
ocid1.bootvolume.oc1.iad.xxxxxEXAMPLExxxxx
    availability_domain
string
always
The Availability Domain of the instance.

Sample:
BnQb:PHX-AD-1
    display_name
string
always
A user-friendly name. Does not have to be unique, and it cannot be changed.

Sample:
My boot volume attachment
    compartment_id
string
always
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx
    lifecycle_state
string
always
The current state of the boot volume attachment.

Sample:
ATTACHED
    time_created
string
always
The date and time the boot volume was created, in the format defined by RFC3339.

Sample:
2016-08-25 21:10:29.600000
    instance_id
string
always
The OCID of the instance the boot volume is attached to.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
    id
string
always
The OCID of the boot volume attachment.

Sample:
ocid1.instance.oc1.iad.xxxxxEXAMPLExxxxx
  id
string
always
The OCID of the instance.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
  metadata
dict(str, str)
always
Custom metadata that was associated with the instance

Sample:
{'foo': 'bar'}
instances
complex
On successful operation (launch, update and terminate) of compute instances. For 'exact_count' scenarios, details of all matching instances are returned for this key.
List of details of the OCI compute instances launched or terminated as a result of the current operation

Sample:
[{'lifecycle_state': 'RUNNING', 'fault_domain': 'FAULT-DOMAIN-1', 'extended_metadata': {}, 'compartment_id': 'ocid1.compartment.oc1..xxxxxEXAMPLExxxxx...vm62xq', 'region': 'phx', 'time_created': '2017-11-14T16:09:07.557000+00:00', 'display_name': 'ansible-test-968', 'image_id': 'ocid1.image.oc1.phx.xxxxxEXAMPLExxxxx....7klnoa', 'shape': 'BM.Standard1.36', 'availability_domain': 'BnQb:PHX-AD-1', 'volume_attachments': [{'lifecycle_state': 'ATTACHED', 'availability_domain': 'BnQb:PHX-AD-1', 'display_name': 'ansible_volume_attachment', 'compartment_id': 'ocid1.compartment.oc1..xxxxxEXAMPLExxxxx', 'chap_username': None, 'time_created': '2017-11-23T11:17:50.139000+00:00', 'id': 'ocid1.volumeattachment.oc1.phx.xxxxxEXAMPLExxxxx', 'instance_id': 'ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx', 'iqn': 'iqn.2015-12.com.oracleiaas:472a085d-41a9-4c18-ae7d-dea5b296dad3', 'ipv4': '169.254.2.2', 'volume_id': 'ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx', 'attachment_type': 'iscsi', 'port': 3260, 'chap_secret': None}], 'ipxe_script': None, 'boot_volume_attachment': {'boot_volume_id': 'ocid1.bootvolume.oc1.iad.xxxxxEXAMPLExxxxx', 'availability_domain': 'IwGV:US-ASHBURN-AD-1', 'display_name': 'Remote boot attachment for instance', 'compartment_id': 'ocid1.compartment.oc1..xxxxxEXAMPLExxxxx', 'lifecycle_state': 'ATTACHED', 'time_created': '2018-01-15T07:23:10.838000+00:00', 'instance_id': 'ocid1.instance.oc1.iad.xxxxxEXAMPLExxxxx', 'id': 'ocid1.instance.oc1.iad.xxxxxEXAMPLExxxxx'}, 'id': 'ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx....lxiggdq', 'metadata': {'foo': 'bar', 'baz': 'quux'}}]
  lifecycle_state
string
always
The current state of the instance.

Sample:
TERMINATED
  fault_domain
string
always
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.

Sample:
FAULT-DOMAIN-1
  extended_metadata
dict(str, str)
always
Additional key-value pairs associated with the instance

Sample:
{'foo': 'bar'}
  compartment_id
string
always
The OCID of the compartment that contains the instance.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx....62xq
  region
string
always
The region that contains the Availability Domain the instance is running in.

Sample:
phx
  time_created
string
always
The date and time the instance was created, in the format defined by RFC3339

Sample:
2017-11-20 04:52:54.541000
  display_name
string
always
A user-friendly name for the instance

Sample:
ansible-instance-968
  image_id
string
always
The OCID of the image that the instance is based on

Sample:
ocid1.image.oc1.iad.xxxxxEXAMPLExxxxx
  shape
string
always
The shape of the instance. The shape determines the number of CPUs and the amount of memory allocated to the instance.

Sample:
BM.Standard1.36
  availability_domain
string
always
The Availability Domain the instance is running in.

Sample:
BnQb:PHX-AD-1
  volume_attachments
complex
In experimental mode.
List of information about volume attachments

    lifecycle_state
string
always
The current state of the volume attachment.

Sample:
ATTACHED
    availability_domain
string
always
The Availability Domain of an instance.

Sample:
BnQb:PHX-AD-1
    display_name
string
always
A user-friendly name. Does not have to be unique, and it cannot be changed.

Sample:
My volume attachment
    compartment_id
string
always
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx
    chap_username
string
always
The volume's system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name.

Sample:
ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
    time_created
string
always
The date and time the volume was created, in the format defined by RFC3339.

Sample:
2016-08-25 21:10:29.600000
    id
string
always
The OCID of the volume attachment.

Sample:
ocid1.volumeattachment.oc1.phx.xxxxxEXAMPLExxxxx
    instance_id
string
always
The OCID of the instance the volume is attached to.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
    iqn
string
always
The target volume's iSCSI Qualified Name in the format defined by RFC 3720.

Sample:
iqn.2015-12.us.oracle.com:456b0391-17b8-4122-bbf1-f85fc0bb97d9
    ipv4
string
always
The volume's iSCSI IP address.

Sample:
169.254.0.2
    volume_id
string
always
The OCID of the volume.

Sample:
ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
    attachment_type
string
always
The type of volume attachment.

Sample:
iscsi
    port
int
always
The volume's iSCSI port.

Sample:
3260
    chap_secret
string
always
The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name. (Also called the "CHAP password".)

Sample:
d6866c0d-298b-48ba-95af-309b4faux45e
  ipxe_script
string
always
A custom iPXE script that will run when the instance boots

  boot_volume_attachment
dict
In experimental mode.
Information of the boot volume attachment.

    boot_volume_id
string
always
The OCID of the boot volume.

Sample:
ocid1.bootvolume.oc1.iad.xxxxxEXAMPLExxxxx
    availability_domain
string
always
The Availability Domain of the instance.

Sample:
BnQb:PHX-AD-1
    display_name
string
always
A user-friendly name. Does not have to be unique, and it cannot be changed.

Sample:
My boot volume attachment
    compartment_id
string
always
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx
    lifecycle_state
string
always
The current state of the boot volume attachment.

Sample:
ATTACHED
    time_created
string
always
The date and time the boot volume was created, in the format defined by RFC3339.

Sample:
2016-08-25 21:10:29.600000
    instance_id
string
always
The OCID of the instance the boot volume is attached to.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
    id
string
always
The OCID of the boot volume attachment.

Sample:
ocid1.instance.oc1.iad.xxxxxEXAMPLExxxxx
  id
string
always
The OCID of the instance.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
  metadata
dict(str, str)
always
Custom metadata that was associated with the instance

Sample:
{'foo': 'bar'}
terminated_instances
complex
On successful termination of compute instances
Details of terminated compute instances

Sample:
Same as the instances sample
  lifecycle_state
string
always
The current state of the instance.

Sample:
TERMINATED
  fault_domain
string
always
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.

Sample:
FAULT-DOMAIN-1
  extended_metadata
dict(str, str)
always
Additional key-value pairs associated with the instance

Sample:
{'foo': 'bar'}
  compartment_id
string
always
The OCID of the compartment that contains the instance.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx....62xq
  region
string
always
The region that contains the Availability Domain the instance is running in.

Sample:
phx
  time_created
string
always
The date and time the instance was created, in the format defined by RFC3339

Sample:
2017-11-20 04:52:54.541000
  display_name
string
always
A user-friendly name for the instance

Sample:
ansible-instance-968
  image_id
string
always
The OCID of the image that the instance is based on

Sample:
ocid1.image.oc1.iad.xxxxxEXAMPLExxxxx
  shape
string
always
The shape of the instance. The shape determines the number of CPUs and the amount of memory allocated to the instance.

Sample:
BM.Standard1.36
  availability_domain
string
always
The Availability Domain the instance is running in.

Sample:
BnQb:PHX-AD-1
  volume_attachments
complex
In experimental mode.
List of information about volume attachments

    lifecycle_state
string
always
The current state of the volume attachment.

Sample:
ATTACHED
    availability_domain
string
always
The Availability Domain of an instance.

Sample:
BnQb:PHX-AD-1
    display_name
string
always
A user-friendly name. Does not have to be unique, and it cannot be changed.

Sample:
My volume attachment
    compartment_id
string
always
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx
    chap_username
string
always
The volume's system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name.

Sample:
ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
    time_created
string
always
The date and time the volume was created, in the format defined by RFC3339.

Sample:
2016-08-25 21:10:29.600000
    id
string
always
The OCID of the volume attachment.

Sample:
ocid1.volumeattachment.oc1.phx.xxxxxEXAMPLExxxxx
    instance_id
string
always
The OCID of the instance the volume is attached to.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
    iqn
string
always
The target volume's iSCSI Qualified Name in the format defined by RFC 3720.

Sample:
iqn.2015-12.us.oracle.com:456b0391-17b8-4122-bbf1-f85fc0bb97d9
    ipv4
string
always
The volume's iSCSI IP address.

Sample:
169.254.0.2
    volume_id
string
always
The OCID of the volume.

Sample:
ocid1.volume.oc1.phx.xxxxxEXAMPLExxxxx
    attachment_type
string
always
The type of volume attachment.

Sample:
iscsi
    port
int
always
The volume's iSCSI port.

Sample:
3260
    chap_secret
string
always
The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name. (Also called the "CHAP password".)

Sample:
d6866c0d-298b-48ba-95af-309b4faux45e
  ipxe_script
string
always
A custom iPXE script that will run when the instance boots

  boot_volume_attachment
dict
In experimental mode.
Information of the boot volume attachment.

    boot_volume_id
string
always
The OCID of the boot volume.

Sample:
ocid1.bootvolume.oc1.iad.xxxxxEXAMPLExxxxx
    availability_domain
string
always
The Availability Domain of the instance.

Sample:
BnQb:PHX-AD-1
    display_name
string
always
A user-friendly name. Does not have to be unique, and it cannot be changed.

Sample:
My boot volume attachment
    compartment_id
string
always
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxEXAMPLExxxxx
    lifecycle_state
string
always
The current state of the boot volume attachment.

Sample:
ATTACHED
    time_created
string
always
The date and time the boot volume was created, in the format defined by RFC3339.

Sample:
2016-08-25 21:10:29.600000
    instance_id
string
always
The OCID of the instance the boot volume is attached to.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
    id
string
always
The OCID of the boot volume attachment.

Sample:
ocid1.instance.oc1.iad.xxxxxEXAMPLExxxxx
  id
string
always
The OCID of the instance.

Sample:
ocid1.instance.oc1.phx.xxxxxEXAMPLExxxxx
  metadata
dict(str, str)
always
Custom metadata that was associated with the instance

Sample:
{'foo': 'bar'}


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Author

  • Sivakumar Thyagarajan (@sivakumart)

Hint

If you notice any issues in this documentation you can edit this document to improve it.