Skip to main content

Working with Virtual Machines

In this section, we'll go over all the necessary steps needed to provision and manage Virtual Machines on OGC.

Let's look at a few example commands and their output.

List available machines

Before creating a VM, you first need to decide what machine characteristics you need as well as a few other details.

The command below offers a view of what machines are currently available through OGC. To get more information on each SKU, view Quota page on OGC (under Settings > Resource Quotas)

user@machine ~ % ogc vm list-sku
SKU | Location | Os Image
ogx-a100-10 | new-jersey | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
ogx-a100-160-b | new-jersey,frankfurt-2,sillicon-valley,bangalore | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
ogx-a100-20 | new-jersey,frankfurt-2,london-2,sillicon-valley | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
ogx-a100-320-b | frankfurt-2 | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
ogx-a100-4 | new-jersey | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
ogx-a100-40 | new-jersey,frankfurt-2,london-2,sillicon-valley,bangalore | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
ogx-a100-8 | new-jersey,london-2 | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
ogx-a16-128 | chicago,sillicon-valley,bangalore | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
ogx-a16-16 | frankfurt-2,london-2,tokyo,chicago,sillicon-valley,bangalore | Debian-10,Debian-11,Debian-12,Ubuntu-20.04,Ubuntu-22.04
...

Create SSH Keys

In order to create a Virtual Machine, you first need to create an SSH key pair which will allow you to access the instance.

After creating your SSH key pair, you will use the public key to create an OGC SSH key resource with the following command.

user@machine ~ % ogc ssh create personal-key --public-key <public-key>
5272e090-a595-4d6a-8587-cfe78214739e

user@machine ~ % ogc ssh list
ID | Name | Description
5272e090-a595-4d6a-8587-cfe78214739e | personal-key |

Create Virtual Machine

Once we have decided the machine type, location, OS image as well as created the SSH key, we are now ready to create a Virtual Machine.

The command below is an example of how to create an L40s machine

info

This will create a compute resource that will incur cost.

user@machine ~ % ogc vm create test-vm --public-key-id <id> --sku ogx-l40s-48 --os-image Ubuntu-20.04 --region gravelines-4
0cc1d7ca-88df-41ba-8713-b4214bf12f0c

user@machine ~ % ogc vm list
ID | Name | Status
0cc1d7ca-88df-41ba-8713-b4214bf12f0c | test-vm | Available

Manage Virtual Machine

Once a machine is Available, you can perform administrative actions on the machine (you can read more about VM actions here)

# restart
user@machine ~ % ogc vm restart 0cc1d7ca-88df-41ba-8713-b4214bf12f0c

# suspend
user@machine ~ % ogc vm suspend 0cc1d7ca-88df-41ba-8713-b4214bf12f0c

# resume (after suspend)
user@machine ~ % ogc vm resume 0cc1d7ca-88df-41ba-8713-b4214bf12f0c

# delete
user@machine ~ % ogc vm delete 0cc1d7ca-88df-41ba-8713-b4214bf12f0c

Contents