> For the complete documentation index, see [llms.txt](https://isaac-exe.gitbook.io/various-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://isaac-exe.gitbook.io/various-tutorials/tutorials/1.-deployment-instance/oci-cli-small-test.md).

# OCI CLI small test

### Preparation

Let's test our OCI CLI, and create another instance in the tenancy with oci cli, since we already know the Compartment OCID and Tenancy OCID.

`Let's turn these OCIDs into environment variables, just in case:`

```
root@deploymentmachine:~/.oci# export TENANCY="ocid1.tenancy.oc1..aaaaaasomefaketenancyidinhereaaaaa323423421"
root@deploymentmachine:~/.oci# export COMPARTMENT="ocid1.tenancy.oc1..aaaaaasomefakecompartmentidinhereaaaaa323423422"
root@deploymentmachine:~/.oci# export USER="ocid1.user.oc1..aaaaaasomefakeuseridinhereaaaaa323423423"
```

`We would be needing Compartment only:`

```
root@deploymentmachine:~/.oci# echo $COMPARTMENT
ocid1.tenancy.oc1..aaaaaasomefakecompartmentidinhereaaaaa323423422
```

`I would also be needing a subnet OCID; since we are building this new instance in root compartment, we can use the subnet of our compartment:`

```
root@deploymentmachine:~/.oci#  oci compute instance list-vnics --compartment-id $COMPARTMENT | grep subnet
      "subnet-id": "ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaafakesubnetidherehahaha1245",
```

*`No regular expression here for now, since we would just copy-paste the subnet OCID`*&#x20;

I also nee&#x64;*:*

* [ an image OCID](https://docs.oracle.com/en-us/iaas/images/image/229363c7-b01f-4b71-8c19-0661df7e16b5/), in my case, since I am located in "eu-frankfurt-1", I have chosen an image accordingly.
* the path to my id\_rsa.pub ssh key (now you understand why we had to create ssh keys on the cloud instance).
* the availability domain - you can obtain it from our [previous tutorial,](/various-tutorials/tutorials/1.-deployment-instance/install-and-configure-oci-cli.md#3-run-a-command-just-for-testing) by running command "oci iam availability-domain list"
* the instance shape/size (in our case, we want to stick to free tier)
* and a name (LinuxOCIcli)

### Run script

`Overall, the script (a bit hardcoded) would look as following:`

```
#!/bin/bash

export INSTANCE_SIZE='VM.Standard.E2.1.Micro'
export INSTANCE_NAME='LinuxOCIcli'
export COMPARTMENT="ocid1.tenancy.oc1..aaaaaasomefakecompartmentidinhereaaaaa323423422"


oci compute instance launch \
         -c ${COMPARTMENT} \
          --shape "${INSTANCE_SIZE}" \
          --display-name "${INSTANCE_NAME}" \
          --image-id ocid1.image.oc1.eu-frankfurt-1.aaaaaaaahxue6crkdeevk75bzw63cmhh3c4uyqddcwov7mwlv7na4lkz7zla \
          --ssh-authorized-keys-file "/root/.ssh/id_rsaf.pub" \
          --subnet-id ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaafakesubnetidherehahaha1245 \
          --availability-domain "Aodz:EU-FRANKFURT-1-AD-1" \
          --wait-for-state RUNNING \
          --raw-output

```

`Make it executable, and run it:`

```
root@deploymentmachine:~/.oci# chmod +x run.sh
root@deploymentmachine:~/.oci# ./run.sh
Action completed. Waiting until the resource has entered state: ('RUNNING',) 
```

`Let's check in the Oracle Cloud UI:`

![](/files/-MRpyJOIbsSWI9kuI9r9)

`As soon as the instance is available and running, your script should provide a long output with all the details related to this new instance.`

`Once the instance LinuxOCIcli is available, let's ssh into it:`

![](/files/-MRpz9kLkXUzZIk1gMKO)

*`I can show the Public IP Address in this scenario, since I will be deleting this instance immediately.`*&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://isaac-exe.gitbook.io/various-tutorials/tutorials/1.-deployment-instance/oci-cli-small-test.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
