How to create a VM with a container
- Web console
-
In the web console, go to
Compute → Containers over VMs.
-
Click
Create container over VM.
- On the page that opens, select the project for the VM location.
- Specify the VM name.
- Select a container image to deploy on this VM. Certain container images require additional settings configured and access credentials stored (for example, save a token from the web console). If you want to deploy a custom Docker image from a public registry, select the Custom image option and then set Docker parameters.
- Set computing resources.
- In the Local storage section, specify the size of the VM disk.
- (Optional) Add shared filesystems to the VM. You can create a new filesystem or select an existing one.
-
In the Access section, add a username and an SSH key for the VM’s user so you can connect to the VM on its behalf.
You can add new credentials or select existing ones.
Do not use the
rootoradminusernames. They are reserved for internal needs and are not allowed to connect to a VM by SSH. -
(Optional) Add advanced settings:
- GPU cluster: Allows accelerating tasks that require high-performance computing (HPC) power, such as training a model. A GPU cluster only helps if you add at least two VMs with 8 GPUs each to the cluster.
- Local storage: Select an existing disk or create a new one. For a new disk, you can configure parameters such as a disk type, encryption, size and the block size. If you enable the advanced settings, you configure storage in them. The storage settings that you set earlier become disabled, and they do not apply.
- Additional disks: Select an existing disk or create a new one as well.
-
Network settings:
- Select a network and subnet to locate the VM.
- Specify whether the VM’s private IP address should be assigned automatically or be selected from a list of allocations.
- Specify whether the VM should have a public IP address. If you do not assign a public address to your VM, the access to the container is restricted. For more information about available options, see Public IP addresses.
- Service account: Specify a service account that will perform actions on behalf of the VM, for example, run scripts.
- Click Create container over VM.
How to access a deployed container
Access depends on two major characteristics:- Whether a public IP address is assigned to a VM. If a public address is assigned, you can open the web interface of a container by a provided link. If a VM only has a private IP address, configure a WireGuard jump server for the VM. After that, you can connect to your VM via a configured VPN and access your container by using an additional VM.
- Whether a given container requires credentials, such as a token or API key. If credentials are needed, they are displayed on the container creation and overview pages. After you open the web interface, you can apply the provided credentials there and access the web interface.
- Web console
- In the web console, go to
Compute → Containers over VMs.
- Open the page of the VM with the required container.
- If the VM is assigned a public IP address, click the go-to-web-UI button.
- If the VM only has a private address, configure a WireGuard jump server. For more information, click How to connect on the VM page.
How to check that a custom image is deployed
If you want to make sure that a custom Docker image is deployed in your VM:- Connect to the VM via SSH.
-
Check the Docker logs:
If the container image is deployed, the logs display information about it.