Starting and managing virtual machine instances
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 with valid billing information. If you don't have an account, sign up for a free trial to explore the simplicity and power of the Triton Compute Service.
- Navigate to the Triton portal and log in to your account.
- From the Dashboard, select Create Instance.
- Select a Data Center, and then select Virtual Machine.
- Follow the prompts to choose image and package options. Click Next.
- Enter a name for the virtual machine and choose the appopriate optional settings.
- 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.
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.
For recommended methods of connecting to Triton instances, read connecting to containers and virtual machines.
Watch the screencast to learn how to quickly and easily set up a virtual machine in the Triton portal.
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.
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:
--name=myDebianServernames the instance.
-wflags the command to wait for the image to be created.
debian-8identifies the image to use.
k4-highcpu-kvm-250Msets the package.
If you need more information before creating an instance, you can run:
triton image lsto list all available images.
triton packagesto list all available packages. Note that VM instances cannot use
triton packages | grep "k4"to show only
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 22.214.171.124
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.
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:
- To start removing an instance, log in to your account.
- Navigate to the Instances list.
- Select the data center that hosts the instance you want to remove.
- Select the check box next to the instance to delete.
- From the actions drop down, select delete.
- Choose Yes when prompted to confirm: "Destroy the information on this instance and stop billing for this instance?"
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.