Starting and managing virtual machine instances

Modified: 26 Jan 2023 22:12 UTC

You can start and manage virtual machines in Triton using the same process and triton that you use with infrastructure containers. Keep reading to learn how, or start by watching a video on starting and managing virtual machines.

Before you begin, you must have a Triton Compute Service account. If you don't have an account, please contact your administrator.

Starting an instance from the portal

  1. If you don't already have one, request an account from your administrator and log in.
  2. From the Dashboard, select Create Instance.
  3. Select a Data Center, and then select Virtual Machine.
  4. Follow the prompts to choose image and package options. Click Next.
  5. Enter a name for the virtual machine and choose the appopriate optional settings.
  6. Click Launch to create and start your instance.

The new instance displays on the Instances page, under the data center you selected. The status of the new instance may show as provisioning during the setup process. When provisioning is complete, the instance status displays as running.

Locating the IP address

In the Instances list, notice the primary IP address displays next to the instance name. You'll need the IP address to connect to your new virtual machine.

To view all IP addresses, click on the name of your new instance.

Connecting to the instance

For recommended methods of connecting to Triton instances, read connecting to containers and virtual machines.

Watch to learn

Watch the screencast to learn how to quickly and easily set up a virtual machine in the Triton portal.

Starting and managing instances with Triton CLI

This section provides a quick overview of the basic commands for starting and managing instances using Triton CLI. For more information, including instructions for installing the command line tools, read an overview of Triton CLI.

Creating an instance

Once you install and configure triton you can create and provision infrastructure instances by running triton instance create. This code example shows a Debian installation:

triton instance create -w --name=myDebianServer debian-8 k4-highcpu-kvm-250M
Creating instance myDebianServer (efb971ac-e7dc-4b0b-898d-1c50b1882461, debian-8@20161025)
Created instance myDebianServer (efb971ac-e7dc-4b0b-898d-1c50b1882461) in 39s

In the example, the triton instance create command uses four parameters:

  1. --name=myDebianServer names the instance.
  2. -w flags the command to wait for the image to be created.
  3. debian-8 identifies the image to use.
  4. k4-highcpu-kvm-250M sets the package.

If you need more information before creating an instance, you can run:

When an instance is created, it is automatically in a running state. If you have created additional instances, you can list all Triton instances by running triton instance list.

SHORTID   NAME                        IMG                    STATE    FLAGS  AGE
efb971ac  myDebianServer              debian-8@20161025      running  K      2m

You can view the IP address of your new instance by running triton instance ip, specifying the instance SHORTID.

triton instance ip myDebianServer
165.225.172.154

To view more details about your instance, including all public and private IP addresses, run triton instance get, specifying the instance name or SHORTID. The command returns a large list of infrastructure details.

$ triton instance get efb971ac

Visit working with instances to learn more.

You can find more information on managing instances in the CloudAPI reference documentation.

Removing an instance from the portal

You are billed for all provisioned instances, including the instances you have stopped. To avoid charges for instances that you do not need, be sure to remove them. The Triton Compute Service portal provides a simple process for this:

  1. To start removing an instance, log in to your account.
  2. Navigate to the Instances list.
  3. Select the data center that hosts the instance you want to remove.
  4. Select the check box next to the instance to delete.
  5. From the actions drop down, select delete.
  6. Choose Yes when prompted to confirm: "Destroy the information on this instance and stop billing for this instance?"

Removing all instances at the CLI

You can delete an instance using the triton instance delete <UUID> command.

triton instance delete efb971ac

If you are familiar with using Docker, note that triton instance delete <uuid> is equivalent to using docker rm -f to force the deletion of a single container. The benefit of using the Triton command is that instances are deleted asynchronously.

If you have more than one instance, you can remove all of your instances regardless of whether they running or stopped.

triton instance delete $(triton instance ls -o id)

Be aware that this command deletes all of your instances at once, including Docker, infrastructure, and VM instances. This command cannot be undone.