Basic Commands

yo launch

Launch an OCI instance.

The instance settings (image/OS, shape, name, etc) are typically taken from the instance profile in your configuration file. However, you can override these settings with command line options too.

You can run startup tasks on the instance via the “-t” option. Again, these can be specified via an instance profile, so that you don’t need to write long commands. If you ask Yo to run a task, it will wait until the instance is ready, and then connect over SSH so that it can start the tasks.

You can use “-s” to wait until the instance is ready and then use SSH to connect. If you’ve configured “yo.notify_prog”, then you can also receive a desktop notification when your instance is ready. Alternatively, use “-w” to wait until the instance is ready, but not connect via SSH.

usage: yo launch [-h] [--name NAME] [--os OS | --image IMAGE | --volume VOLUME] [--shape SHAPE] [--boot-volume-size-gbs BOOT_VOLUME_SIZE_GBS] [--mem MEM]
                 [--cpu CPU] [--ad AD] [--wait] [--wait-ssh] [--ssh] [--exact-name] [--no-exact-name] [--dry-run] [--profile PROFILE] [--task TASKS]
                 [--load-image {UNIQUE,LATEST}] [--username USERNAME] [--allow-legacy-imds-endpoints]

Named Arguments

--name, -n

Name to give the instance

--os

Operating system and version, separated by colon (:)

--image

Display name of a custom image in the instance_compartment_id

--volume, -V

Select a boot volume to use to launch your instance

--shape, -S

Specify the shape to use

--boot-volume-size-gbs

Specify the size of the boot volume (unit is GiB)

--mem

Specify the amount of memory (unit is GiB)

--cpu

Specify the amount of CPUs

--ad

Specify the availability domain (overrides instance profile)

--wait, -w

Wait for the instance to start running

Default: False

--wait-ssh

Wait for the instance to be reachable via SSH (implies –wait)

Default: False

--ssh, -s

SSH to the instance once it is running (implies –wait-ssh)

Default: False

--exact-name, -E

When set, allows you to bypass the name rules implemented by this program. In particular: (1) allows non-unique instance names, and (2) allows you to use a name which is not prefixed by your username.

--no-exact-name

the opposite of –exact-name (this is the default, but can be used to override your Yo configuration file)

--dry-run

When set, don’t actually create the instance, just print what we would have done.

Default: False

--profile, -p

Which profile (from your ~/.oci/yo.ini) should be used

Default: “DEFAULT”

--task, -t

Tasks to run once the instance is up and accessible

Default: []

--load-image

Possible choices: UNIQUE, LATEST

Strategy for loading images (relevant only for –image)

--username, -u

Custom username for logging into the instance

--allow-legacy-imds-endpoints

Allows IMDS v1 endpoints (overrides configured value)

Default: False

yo list

List your OCI instances.

Yo caches some data to speed up operations, but when you run “yo list”, it will always ensure you get the freshest data. You can disable this behavior if you want, which will show you stale data, but it will be fast.

By default, Yo also tries to only show instances that belong to you (though, please see the documentation for the config “yo.resource_filtering”). You can use the “–all” argument to see all of the instances in your compartment, regardless of whether Yo believes you created them. Please keep in mind that you won’t be able to manage those instances (e.g. yo ssh, yo terminate, etc) unless you change your “yo.resource_filtering” configuration.

usage: yo list [-h] [--cached] [--columns COLUMNS] [--extra-column {Name,Shape,CPU,Mem,State,AD,Created,IP,ResourceType}] [--ip] [--ad] [--all]

Named Arguments

--cached, -c

avoid loading and calling OCI if possible (list may beout of date)

Default: False

--columns, -C

specify all columns in the table

--extra-column, -x

Possible choices: Name, Shape, CPU, Mem, State, AD, Created, IP, ResourceType

add a column to the table

Default: []

--ip, -i

include IP addresses column (alias for: -x IP)

Default: False

--ad

display the availability domain column (alias for: -x AD)

Default: False

--all, -a

display all instances in the compartment (not just yours)

Default: False

yo ssh

SSH into an instance.

usage: yo ssh [-h] [--name NAME] [--exact-name] [--no-exact-name] [--wait] [--agent] [--ssh-args SSH_ARGS] [--start] [--quiet] [name_pos] [cmds ...]

Positional Arguments

name_pos

Name of the instance to filter by

cmds

Execute the listed commands rather than a login shell

Named Arguments

--name, -n

Name of the instance to filter by

--exact-name, -E

Do not standardize the name by prefixing it with your system username if necessary.

--no-exact-name

Standardize the name by prefixing it with your system username (this is the default, but can be used to override your Yo configuration file)

--wait, -w

Wait for SSH access

Default: False

--agent, -A

Forward SSH agent

Default: False

--ssh-args

Arguments to pass to ssh

Default: “”

--start, -s

Start the instance if not already started and then ssh (implies –wait)

Default: False

--quiet, -q

Reduce the informative output

Default: False