Managing Instances

An instance is a logical representation of a virtual machine (VM). An instance defines the properties of a virtual machine and has a life cycle that surrounds and extends beyond the life cycle of a single virtual machine. You create virtual machine instances by starting orchestrations, but you can manage them individually thereafter by using CLI commands or API requests.

Note:

Life-cycle commands (such as start, stop, restart etc.) that change the state of an instance, return immediately with the state change proceeding on the server side. Instance state can be monitored by retrieving the instance details.

delete instance

This command enables you to delete a specific instance.

Note:

An instance can only be deleted when it is in any one of the following states: running, shut_down, or error.

Syntax

oracle-compute delete instance name

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
name A unique hierarchical name of an instance. For example, /mytenant/public/e6640ebc-6953-444f-848d-4a3bf6050ea5

Example

oracle-compute delete instance /mytenant/public/3e81e735-cdfc-43c2-9ba9-219585501f90

shutdown instance

This command enables you to shut down a specific instance.

Syntax

oracle-compute shutdown instance name

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
name A unique hierarchical name for an instance. For example, /mytenant/public/e6640ebc-6953-444f-848d-4a3bf6050ea5

Example

$ oracle-compute shutdown instance /mytenant/public/0c9f738c-26e1-440e-9a92-c81378f80683

restart instance

This command enables you to restart a specific instance.

Note:

An instance can only be restarted when it is in one of the following states:shut_down, warning, and error .

Syntax

oracle-compute restart instance name

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
name A unique hierarchical name of an instance. For example,  /mytenant/public/e6640ebc-6953-444f-848d-4a3bf6050ea5

Example

$ oracle-compute restart instance /mytenant/public/dc48d972-d893-4574-9446-5b7d6ea1f596

Sample Output

$ 
 oracle-compute restart instance /mytenant/public/dc48d972-d893-4574-9446-5b7d6ea1f596 -Fname,state
name                                                    state 
/mytenant/public/dc48d972-d893-4574-9446-5b7d6ea1f596   shut_down

update instance

This command enables you to update information for a specific instance.

Syntax

oracle-compute update instance name [--shape] [--networking] [--nis] [--tag] [--delete_tag]

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
name An unique hierarchical name for an instance. For example, /mytenant/public/e6640ebc-6953-444f-848d-4a3bf6050ea5e
--shape (Optional) The name of the shape to be associated with the instance. You can update the shape only when the instance is in the shut_down state.
--networking (Optional) Mapping of device name to network specifiers for the virtual Network Interface Card (NICs) to be attached to this instance. You can update the instance when it is in either the running state or the shut_down state.
--nis (Optional) Network Information Service (NIS) configuration. You can update the NIS configuration only when the instance is in the running state or the shut_down state.
--tag (Optional) User-friendly tags for a specific instance. You can tag an instance with a list of human-readable tags (strings) that can be used to identify a group of instances easily during instance listing.
--delete_tag (Optional) Deletes user-friendly strings for a specific instance. You can remove tags from the instance in any state.

For more information on instance optional parameters, see section Orchestration Templates in Using Oracle Compute Cloud Service.

Example

$ oracle-compute update instance /mytenant/public/e8faac3a-d4bb-41bd-9e79-e13d8be4d9d0 --shape medium -Fname,shape,state

Sample Output

name                                                  shape   state
/mytenant/public/e8faac3a-d4bb-41bd-9e79-e13d8be4d9d0 medium  shut_down

Retrieve Instance Details

You can retrieve instance details by using the CLI.

discover instance

This command enables you to discover instances in the specific container and subcontainers.

Syntax

oracle-compute discover instance container

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
container Hierarchical name-space containing instances

Example

$ oracle-compute discover instance /mytenant/

Sample Output

$ oracle-compute discover instance /mytenant/ 
name
/mytenant/public/0c9f738c-26e1-440e-9a92-c81378f80683
/mytenant/public/58f3a5d2-2c8c-41cb-8047-44f2e3aab876
/mytenant/public/6e319b05-4158-4d43-961b-be37157c8022
/mytenant/public/8243c540-337f-499e-ab08-4abd48b4d7bf
/mytenant/public/bdb7b6da-8919-4034-ad0f-6e506837e4f3
/mytenant/public/d02a40a0-5e51-43f9-a15d-09d014d0c915
/mytenant/public/e25237f7-def4-4853-9c13-dde120cb9161
/mytenant/public/fdd530da-347c-4f07-86ad-0855add035f2
/mytenant/public/scae09-sdi-sdivm-el1-8-instance/1a9ce3a1-ddba-44f7-9cc5-04c77f6523bc

get instance

This command enables you to retrieve information for a specific instance.

Syntax

oracle-compute get instance name

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
name A unique hierarchical name for an instance. For example, /mytenant/public/e6640ebc-6953-444f-848d-4a3bf6050ea5

Example

$ oracle-compute get instance /mytenant/public/0c9f738c-26e1-440e-9a92-c81378f80683

Sample Output

$ oracle-compute get instance /mytenant/public/0c9f738c-26e1-440e-9a92-c81378f80683 -F shape,tags,entry
entry           shape           tags
1               oc4             mytenant_db, mytenant_db_instance1, /mytenant/public/el-db-vms, db8633ae9d611203b6c566770b51d34b

list instance

This command enables you to retrieve instance information in a specific container or subcontainer.

Syntax

oracle-compute list instance container [--tags] [--quota] [--vcable_id]

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Note:

The output of this command is filtered based on the optional parameters (if specified).
Parameter Description
container Hierarchical name-space for instances
--tags (Optional) You can tag an instance with a list of human-readable tags (strings) that can be used to identify a group of instances easily during instance listing.
--quota (Optional) The name of a quota associated with an instance
--vcable_id (Optional) The unique identifier of a Virtual Cable (vCable) associated with an instance.

Example

$ oracle-compute list instance /mytenant/public/

Sample Output

$ oracle-compute list instance /demo/ -Fname,ip,state,label -ftab
name                                                   label     state     ip
/demo/public/960adf49-eefd-4f93-a300-2c798ba4a123      vm2       shut_down 10.247.60.146
/demo/public/dg1/35faaf0b-825c-42f9-bbfe-e72470c23883  myvm-j-v1 shut_down 10.247.64.55
/demo/public/ff94e915-a1d1-4f0f-88de-cc41b91394d3      vm1       shut_down 10.247.60.145