Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COS: added information about some disk mount errors and x-yc-disks usage #856

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions en/cos/concepts/boot-disk.md

This file was deleted.

2 changes: 1 addition & 1 deletion en/cos/concepts/coi-specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Where:
* `restart`: Docker container restart policy settings.
* `volumes`: Description of the volumes used in the Docker container.
* `x-yc-disks`: Section that describes the [disks](../../compute/concepts/disk.md) to attach. It is an [extension of the Docker Compose specification](https://docs.docker.com/compose/compose-file/#extension-fields). Used when preparing to run Docker containers, before running the Docker Compose file. Docker Compose skips this section.
* `device_name`: Device name.
* `device_name`: The device name. Not the same as the disk name. It is specified when attaching a disk to a VM. It is used on the VM to search for the disk through the `/dev/disk/by-id/virtio-<device_name>` tree. It is specified in flags and CLI commands for adding disks to a VM using the `device-name` parameter. In the management console, it is specified in the pop-up window when [attaching a disk to a VM](../../compute/operations/vm-control/vm-attach-disk#attach).
* `fs_type`: File system type. The supported file systems are ext4 and xfs.
* `host_path`: Directory the disk is mounted to.
* `partition`: Disk partition being used.
18 changes: 18 additions & 0 deletions en/cos/concepts/disks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Specifics of working with disks in {{ cos-full-name }}
description: Please note that, when creating a VM from a {{ coi }}, it's necessary to consider some specific aspects of working with disks.
---

# Specifics of working with disks

## Specifics of working with a boot disk

When [creating a VM from a {{ coi }}](../tutorials/vm-create.md), take into account the following specifics:
* You cannot create a boot disk from a [disk snapshot](../../compute/concepts/snapshot.md).
* By default, you create a disk that is the same size as the image. However, since the purpose of a VM created from a {{ coi }} is to run a Docker container, there may not be enough free space to deploy the Docker container. To avoid this, explicitly specify the required size of the boot disk using the `--create-boot-disk size=<disk_size_in_GB>` flag. The disk size must be at least 30 GB.

## Specifics of working with additional disks {#second-disk}

Using the `x-yc-disks` extension section in the [Docker Compose specification](./coi-specifications.md#compose-spec), you can [mount an additional volume inside the container](../tutorials/vm-create-with-second-disk.md):
* To mount a disk inside a virtual machine with {{ coi }}, the disk's `device-name` is used to search through the `/dev/disk/by-id/virtio-...` tree. If this parameter is not specified when attaching a disk to a VM, a [mounting error](../error/index.md#disk-mount) may occur.
* When using an additional disk that's partitioned, it's important to use the `partition: X` parameter with the partition number for mounting in the [Docker Compose specification](./coi-specifications.md#compose-spec-example).
38 changes: 30 additions & 8 deletions en/cos/error/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: This guide describes how you can fix issues with a {{ coi }}.
To view Docker image startup logs, use the command:

```bash
sudo journalctl -u yc-container-daemon
sudo journalctl -eu yc-container-daemon
```

See below for a list of common issues and their fixes:
Expand All @@ -33,11 +33,11 @@ Mar 25 12:07:41 instance-name yc-container-daemon[516]:
**Example**:

```text
Sep 28 08:00:18 cl17bn514eluq62d****-**** yc-container-daemon[952]:
Sep 28 08:00:18 instance-name yc-container-daemon[952]:
{"level":"DEBUG","ts":"2019-09-28T08:00:18.842Z ","caller":"container/container.go:121","msg":"trying to pull image (0/3)"}
Sep 28 08:00:18 cl17bn514eluq62d****-**** yc-container-daemon[952]:
Sep 28 08:00:18 instance-name yc-container-daemon[952]:
{"level":"DEBUG","ts":"2019-09-28T08:00:18.842Z","caller":"container/container.go:162","msg":"pulling image: '{{ registry }}/crpgrueprnhc********/nginx:1.16.0'"}
Sep 28 08:00:33 cl17bn514eluq62d****-**** yc-container-daemon[952]:
Sep 28 08:00:33 instance-name yc-container-daemon[952]:
{"level":"ERROR","ts":"2019-09-28T08:00:33.843Z","caller":"container/container.go:124","msg":"error pulling image: Error response from daemon: Get https://{{ registry }}/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"}
```

Expand Down Expand Up @@ -65,16 +65,38 @@ Mar 25 12:13:24 instance-name yc-container-daemon[518]:
**Example**:

```text
Mar 25 12:34:22 intr13-vm yc-container-daemon[518]:
Mar 25 12:34:22 instance-name yc-container-daemon[518]:
{"level":"DEBUG","ts":"2021-03-25T12:34:22.043Z","caller":"container/image.go:75","msg":"trying to pull image (0/3)"}
Mar 25 12:34:22 intr13-vm yc-container-daemon[518]:
Mar 25 12:34:22 instance-name yc-container-daemon[518]:
{"level":"DEBUG","ts":"2021-03-25T12:34:22.043Z","caller":"container/image.go:47","msg":"pulling image: 'openjdk:7' (normalized: 'docker.io/library/openjdk:7')"}
Mar 25 12:34:46 intr13-vm yc-container-daemon[518]:
Mar 25 12:34:46 instance-name yc-container-daemon[518]:
{"level":"DEBUG","ts":"2021-03-25T12:34:46.276Z","caller":"container/image.go:59","msg":"received ImagePull response: ... {\"message\":\"failed to register layer: Error processing tar file(exit status 1): write /usr/bin/hostnamectl: no space left on device\"},\"error\":\"failed to register layer: Error processing tar file(exit status 1): write /usr/bin/hostnamectl: no space left on device\"}\r\n)."}
```

**How to fix it**: Stop the VM and [increase the disk size](../../compute/operations/disk-control/update.md#change-disk-size).


## Disk partition not specified {#disk-partition}

**Example**:

```text
Oct 23 19:43:36 instance-name yc-container-daemon[781]: {"level":"ERROR","ts":"2024-10-23T19:43:36.478Z","caller":"mdtracking/checker.go:135","msg":"OnChange callback failed: received multiline output from lsblk, the device likely contains subpartitions:\nNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS\nloop0 7:0 0 63.3M 1 loop /snap/core20/1822\nloop1 7:1 0 64M 1 loop /snap/core20/2379\nloop2 7:2 0 111.9M 1 loop /snap/lxd/24322\nloop3 7:3 0 87M 1 loop /snap/lxd/29351\nloop4 7:4 0 49.8M 1 loop /snap/snapd/18357\nloop5 7:5 0 38.8M 1 loop /snap/snapd/21759\nvda 252:0 0 30G 0 disk \n├─vda1 252:1 0 1M 0 part \n└─vda2 252:2 0 30G 0 part /\nvdb 252:16 0 20G 0 disk \n├─vdb1 252:17 0 1M 0 part \n└─vdb2 252:18 0 15G 0 part \n"}
```

**How to fix it**: Determine which partition number is needed for mounting using the `lsblk` command, add the `partition: X` parameter with the partition number to the [Docker Compose specification](../concepts/coi-specifications.md#compose-spec), [update the VM](../tutorials/vm-update.md) using the edited specification.

## Disk not mounting {#disk-mount}

**Example**:

```text
Sep 29 08:10:10 instance-name yc-container-daemon[743]: {"level":"ERROR","ts":"2024-09-29T08:10:10.133Z","caller":"mdtracking/checker.go:135","msg":"OnChange callback failed: device /dev/disk/by-id/virtio-coi-data access error: stat /dev/disk/by-id/virtio-coi-data: no such file or directory"}
```

**How to fix it**: Specify the `device-name` parameter in flags and CLI commands for adding disks to the VM, equal to the `device_name` value in the [Docker Compose specification](../concepts/coi-specifications.md#compose-spec-example). In the management console, it is specified in the pop-up window when [attaching a disk to a VM](../../compute/operations/vm-control/vm-attach-disk#attach). In the log example above, the `device-name` will be `coi-data`.


## The requested image's platform does not match the host platform {#platforms-not-match}

**Example**:
Expand All @@ -83,6 +105,6 @@ Mar 25 12:34:46 intr13-vm yc-container-daemon[518]:
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested
```

**How to fix**: Use a Docker image compatible with a platform that fits your VM's OS and architecture.
**How to fix it**: Use a Docker image compatible with a platform that fits your VM's OS and architecture.

One Docker image can support [multiple platforms](https://docs.docker.com/build/building/multi-platform/). When you run such an image, Docker will automatically select an option that fits in with your host's OS and architecture. If the image contains no suitable option, it will fail to run with an error message.
2 changes: 1 addition & 1 deletion en/cos/qa/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The [Docker Compose specification](../../cos/concepts/coi-specifications.md#comp
* Check that the Docker image name is correct.
* Make sure the [service account](../../iam/concepts/users/service-accounts.md) linked to the VM has the `{{ roles-cr-puller }}` rights to the appropriate Docker image.
* Check that the VM has internet access.
* You can also view logs by running the `sudo journalctl -u yc-container-daemon` command on the VM.
* You can also view [log errors](../error/index.md) by running the `sudo journalctl -eu yc-container-daemon` command on the VM.

#### How can I close a port for public access and leave it accessible within the network? {#port}

Expand Down
4 changes: 2 additions & 2 deletions en/cos/toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ items:
items:
- name: '{{ coi }}'
href: concepts/index.md
- name: Specifics of working with a boot disk
href: concepts/boot-disk.md
- name: Specifics of working with disks
href: concepts/disks.md
- name: Specifics of working with the network
href: concepts/network.md
- name: Docker image
Expand Down
10 changes: 0 additions & 10 deletions ru/cos/concepts/boot-disk.md

This file was deleted.

2 changes: 1 addition & 1 deletion ru/cos/concepts/coi-specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ x-yc-disks:
* `restart` – настройка политики перезапуска Docker-контейнера.
* `volumes` – описание томов, используемых в Docker-контейнере.
* `x-yc-disks` – раздел, в котором описываются подключаемые [диски](../../compute/concepts/disk.md). Представляет собой [расширение спецификации Docker Compose](https://docs.docker.com/compose/compose-file/#extension-fields). Используется при подготовке к запуску Docker-контейнеров, перед запуском Docker Compose. Docker Compose пропускает этот раздел.
* `device_name` – имя устройства.
* `device_name` – имя устройства. Не то же самое, что имя диска. Указывается при подключении диска к ВМ. Используется на ВМ для поиска диска по дереву `/dev/disk/by-id/virtio-<device_name>`. Указывается в флагах и командах CLI по добавлению дисков на ВМ при помощи параметра `device-name`. В консоли управления указывается в открывшемся окне при [подключении диска к ВМ](../../compute/operations/vm-control/vm-attach-disk#attach).
* `fs_type` – тип файловой системы. Поддерживаются файловые системы ext4 и xfs.
* `host_path` – директория, в которую монтируется диск.
* `partition` – используемый раздел диска.
18 changes: 18 additions & 0 deletions ru/cos/concepts/disks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Особенности работы с дисками в {{ cos-full-name }}
description: При создании виртуальной машины с {{ coi }} необходимо учитывать, некоторые особенности работы с дисками.
---

# Особенности работы с дисками

## Особенности работы с загрузочным диском {#boot-disk}

При [создании виртуальной машины с {{ coi }}](../tutorials/vm-create.md) необходимо учитывать следующие особенности:
* Невозможно создать загрузочный диск из [снимка диска](../../compute/concepts/snapshot.md).
* По умолчанию создается диск, размер которого равен размеру образа. Но так как назначение ВМ с {{ coi }} — запуск на ней [Docker-контейнера](/blog/posts/2022/03/docker-containers), может возникнуть проблема недостаточного свободного места при развертывании Docker-контейнера. Чтобы этого избежать, явно укажите необходимый размер загрузочного диска с помощью флага `--create-boot-disk size=<размер_диска_ГБ>`. Размер диска должен быть не менее 30 ГБ.

## Особенности работы с дополнительными дисками {#second-disk}

Используя раздел-расширение `x-yc-disks` в [спецификации Docker Compose](./coi-specifications.md#compose-spec), можно [примонтировать дополнительный том внутрь контейнера](../tutorials/vm-create-with-second-disk.md):
* Для монтирования диска внутрь виртуальной машины с {{ coi }} используется `device-name` диска для поиска по дереву `/dev/disk/by-id/virtio-...`. Если при подключении диска к ВМ не указать этот параметр, может возникать [ошибка монтирования](../error/index.md#disk-mount).
* При использовании дополнительного диска, разбитого на разделы, важно в [спецификации Docker Compose](./coi-specifications.md#compose-spec-example) использовать параметр `partition: X` с номером раздела для монтирования.
Loading