Hello and welcome to this video on Oracle Private Cloud Appliance.
In this video, you will learn how to create, launch, retrieve and delete
a compute instance by using an instance configuration.
Instance configurations simplify the management of compute instances.
A configuration contains settings that are used to create a compute instance.
To create an instance configuration, you must use the OCI CLI.
From the command line, I have already configured my terminal for the oci tools.
Please refer to the video, Configure the OCI CLI to learn how to configure a terminal
for OCI.
Let's start and create a configuration file used as an input for the following
command oci compute-management instance-configuration create
dash dash generate dash param dash json dash input
instance dash details followed by greater than sign
instance underscore details dot json oci compute-management
instance-configuration create --generate-param-json-input instance-details
> instance_details.json Next we'll copy and rename this file
to customize our new config json file using the command:
cp instance_details.json my_instance_config_file.json
Edit this new file with vi and enter the values required to create
a new instance. As you can see, I've reduced
this file to only the required fields to create an instance configuration.
At a minimum, you'll need to add: availabilityDomain, compartment_OCID,
ConfigType, subnet OCID, display name of the instance,
public key, shape name, and an image OCID. Save and exit editing this file by typing :x.
Next run the following command to create the instance configuration:
oci compute-management instance-configuration create -c ocid1
--display-name my-instance-01 --instance-details file://my_instance_config_file.json
Let's verify that the new instance configuration was created by turning to the web interface.
After logging in and from the dashboard,
click on the menu then Compute and Then click on Instance Configurations.
As you can see, the new instance configuration, my-instance-01 was created.
I'll click on my-instance-01 to see the general information, shape configuration such as
the shape and other configurations for the instance configuration.
You can also retrieve specific instance configurations by using the oci cli command:
oci compute-management instance-configuration get --instance-configuration-id
and the ocid of the instance configuration. Let's now launch a compute instance
using the instance configuration my-instance-01 by running the command:
oci compute-management instance-configuration launch-compute-instance
--instance-configuration-id ocid1 Let's check to see if my-instance-01
is running using the web interface. Returning to the GUI, we see that the instance
my-instance-01 was launched and is now up and running.
Lastly, let's delete the instance configuration using the GUI.
Click the three dots under the actions and then Delete.
When asked to confirm the deletion, click confirm.
As we can see, the instance my-instance-01 was successfully deleted from the compartment.
For more information, please check our additional information on Oracle Private
Cloud Appliance documentation or in the Oracle Private Cloud Appliance Learning
Library.
This concludes the video. Thank you for watching.