# Миграция виртуальных машин между датацентрами HOSTVM

Датацентры являются отдельными объектами в среде HOSTVM, между этими двумя объектами нет общих путей хранения. Следовательно, для перемещения виртуальных машин между датацентрами необходимо установить внешнее подключение к обоим датацентрам через домен экспорта.

Процесс миграции включает в себя:

1\) Создание домена экспорта и подключение его к датацентру1:

Для создания домена экспорта можно использовать nfs-share, с процедурой ее создания можно ознакомиться в главе [Подготовка NFS share](/hostvm-server/installation-guide/ustanovka-hostvm-4.3-4.4/pered-ustanovkoi-hostvm-manager/podgotovka-nfs-share.md)

<figure><img src="/files/60Zf59XubaDlP5D7YwJn" alt=""><figcaption></figcaption></figure>

2\) Перенос виртуальных машин в домен экспорта из datacenter1:

`Compute -> Virtual Machines -> выбирате ВМ -> ⋮ -> Export to Export Domain`

<figure><img src="/files/3Iv04PmtPsiRViqYiWhS" alt=""><figcaption></figcaption></figure>

3\) Отсоединение домена экспорта от датацентра1:

`Data Centers -> выбираете data center -> выбираете Export Domain -> Maintenance -> Detach`

<figure><img src="/files/l1vVRb40XwrmYGLNQbZP" alt=""><figcaption></figcaption></figure>

Далее `Storage -> domains -> выбираете export domain -> remove`

<figure><img src="/files/sMECck23DcBP1QuaLiZ6" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Важно!** Чек-бокс Format Domain отмечать не нужно, иначе все данные будут утеряны.
{% endhint %}

<figure><img src="/files/3s7NKaCt14zI9BSSddzd" alt=""><figcaption></figcaption></figure>

4\) Подключение д*омена экспорта к датацентру2:*

`Storage -> Domains -> Import Domain`

<figure><img src="/files/MZCl2CAKpdoHeRVx9WXa" alt=""><figcaption></figcaption></figure>

После добавления домена активируйте его:

`Data Centers -> выбираете datacenter -> domain -> activate`

<figure><img src="/files/9z1UKZVrbps4i99Yyaqa" alt=""><figcaption></figcaption></figure>

5\) Импорт виртуальных машин в datacenter2:

`Compute -> Virtual Machines -> ⋮ -> Import -> Load`

В поле Virtual Machines on Source будут отображены доступные ВМ для импорта

<figure><img src="/files/ux5CNqzZxNGlcFhWmdEE" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.pvhostvm.ru/hostvm-server/rukovodstvo-po-administrirovaniyu/chasto-zadavaemye-voprosy/virtualnye-mashiny-i-shablony/migraciya-virtualnykh-mashin-mezhdu-datacentrami-hostvm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
