Конвертировать vmware в proxmox
There are various ways to migrate existing servers to Proxmox VE. They can be divided into two categories:
Physical-to-Virtual (P2V) Migration of physical servers to Proxmox VE Virtual-to-Virtual (V2V) Migration of virtual machines and containers from other hypervisors to Proxmox VE
Follow these steps to do a P2V migration and turn a physical machine into a Proxmox VE virtual machine that uses Qemu and KVM.
HyperV
This explains the migration from a Hyper-V on Windows 10 hypervisor to Proxmox VE 6.1. It is tested with a Proxmox VE 6.1 guest.
-
is a command line tool that is built-in in Windows and converts .vhdx to .vhd. This format is supported by qemu-img. is a graphical tool that can create .qcow2 disks from Hyper-V guests.
In Hyper-V-Manager choose "Export. " at the right side and then a destination. While many files (for example for snapshots) will be exported, we are only interested in the .vhdx file(s). Move those files to a storage that is accessible by your Proxmox VE host. You will have to recreate the virtual machine settings yourself.
Go to the GUI of Proxmox VE and create a new virtual machine. We don't need the hard disk that the virtual machine creation wizard created. Delete it in the hardware options of the virtual machine.
Now go to the command line interface of Proxmox VE. Use the command "qm importdisk" to import the .vhdx virtual hard disk. You can find syntax and an example on how to use this command on its man page.
XEN also uses qemu disk format, so it should work in the same manner as described under "VMware to Proxmox VE (KVM)".
You can use xenmigrate to do it
Importing to Proxmox VE
- Create a virtual machine (here vmid is 103) in Proxmox VE. Make sure to set BIOS to OVMF (this is UEFI).
- Delete the disk that was created in step 1.
- Create a directory mkdir /home/user/freenas
- Mount the shared directory from FreeNAS
- Import the image of the FreeNAS VM to the Proxmox VE VM as unused disk (vmid 103, storage local)
- In the GUI of Proxmox VE:
- Go to the hardware view of your new virtual machine
- Set the display to spice
- Double click on the unused disk to attach it and choose Virtio as bus
- Go to the options view of your new virtual machine
- Choose your new virtio disk as bootdisk
VMware Converter
Physical (running) Windows server to Proxmox VE (KVM) using VMware vCenter Converter Standalone Client (V5)
Tested on an HP ProLiant ML350 G5 and G6
VMware vCenter Settings
Launch VMware vCenter and use the following settings:
- Source type: Powered-on machine
- Specify the powered-on machine: This local machine
- Select destination type: VMware Workstation or other VMware virtual machine
- Select VMware Product: VMware Workstation 8.0.x
- Name: Enter the desired name for the image
- Select a location for the virtual machine: Browse to the USB or Network drive where the image will be saved.
The next screen shows the settings for the virtual machine.
Click on Advanced options, select the Post-conversion tab and make sure ‘Install VMware Tools on the destination virtual machine’ is NOT check. We do not want to install VMware tools.
Click next and Finish.
It will now convert your physical machine to a .vmdk file.
NOTE: Depending on your hardware, you may need to boot the .vmdk file using VMware Workstation or Player before moving the file to the Proxmox VE server. This allows windows to install additional drivers for the disk controller. If promoted to convert the disk to Workstation 9.x compatibility, say Yes. You won't know if you need this step until starting the Windows VM in the final step. If you get a blue screen during boot, you should try this step.
Prepare the VM on Proxmox VE
Create a new KVM virtual machine. You’ll want to use similar CPU and memory as the physical system. In the Hard Disk menu, leave everything as default. We won’t be using the disk created by Proxmox VE. Finish creating the VM. Make note of the VMID. For this guide, we’ll be using 100 as an example.
Once the VMware converter has completed, disable all of the networks adapters on the physical server and shut down. Disabling the network adapters will avoid potential IP conflicts if you will start the physical server back into Windows after you have your new virtual server running.
Move the image to the Proxmox VE Server
Plug a USB Hard Drive into the server
From the Proxmox VE command line:
You should see the contents of the USB drive. In my case, the vmdk file was located in /mnt/usb/windows-server/
Converting to qcow2
We want to convert the .vmdk image file to qcow2. To do this, use the following command:
This can take a while depending on the size of file and speed of your system.
Final Steps
Once the conversion is complete, we need to edit the configuration file for the VM.
In the line with ide0: we want to change vm-100-disk-1.raw,size=32G to windows-server.qcow2
You may delete the empty disk created by Proxmox VE when you created the VM.
Start the VM and open the console. Windows should boot up normally. It’ll take a few minutes to detect the hardware changes. If the Windows system had a static IP address, you'll have to reconfigure the settings.
Alternative Methods
Follow these steps to do a V2V migration and move a virtual machine from another hypervisor to a Proxmox VE virtual machine that uses Qemu and KVM.
Preparation in FreeNAS
- Create a shared directory in Sharing → Unix (NFS) Shares with path /mnt/test .
- Enable SSH in Services & edit the SSH service (Actions) to allow password login for root
- Copy the zvol to the shared directory
- Log in to FreeNAS via SSH
- Copy the zvol to the shared directory
Prepare location to save local image
This guide is using an external USB Hard Drive. You may also save to a mapped network share.
NOTE Although the final image will be around the same size as the actual amount of data on the server, the Proxmox VE server should have enough free space to fit the total physical disk of the server unless you plan to shrink the windows disks. once migrated to Proxmox VE.
Последовательность действий
Для начала миграции kvm виртуальной машины ее необходимо выключить на хосте источнике. После этого найти образ жесткого диска, который используется в виртуальной машине. Данный образ копируется на хост назначения с Proxmox, на котором мы будем проводить импорт. Допустим, образ нашего диска называется kvm_virtual_disk.qcow2.
Теперь создадим виртуальную машину в гипервизоре Proxmox с помощью утилиты qm. Данная программа одна из нескольких, часто используемых для управления и настройки Proxmox VE. В данном примере идентификатор машины будет 222, в реальной жизни используем любой свободный в нашей среде виртуализации. Также рекомендую использовать на всех виртуальных машинах qemu agent, для обеспечения более полного взаимодействия между гипервизором и виртуальной машиной. Для этого при создании ВМ добавляем опцию —agent enabled=1. Пример команды qm, создающий виртуальную машину, представлен ниже.
После этого проведем непосредственно импорт .qcow2 диска в гипервизор. Для этого также воспользуемся возможностями утилиты qm с параметром importdisk. Образец команды приведен ниже. В качестве датастора для хранения импортируемого диска мы в данном примере указываем local-lvm, в реальной жизни он может быть совершенно другим. Подразумевается, что образ диска .qcow2 находится в директории, из которой происходит выполнение команды.
Когда операция успешно завершится, проводим заключительную операцию по привязке диска к виртуальной машине с помощью все той же утилиты qm. Это делается следующим образом.
После этого донастраиваем параметры CPU, Memory, если надо сетевых интерфейсов в веб панели Proxmox. Теперь наша виртуалка полностью импортирована и готова к работе в среде Proxmox. Осталось запустить ее и дождаться отклика в консоли.
Prepare Windows
VMware vCenter Converter Standalone Client
- Download here(version 5.x is Free Software and also free of charge but you need to create an account and login before download)
Mergeide.reg
FreeNAS
Those are the necessary steps to migrate a Ubuntu Bionic VM from FreeNAS 11.2 to Proxmox VE 6.2-1. The VM in FreeNAS was created with the following parameters
- Boot Loader Type: UEFI
- Guest OS: Ubuntu Bionic
- Disk
- Disk Mode: AHCI
- Zvol: test/ubuntu-1xmtpt
Check the name of your zvol by going to Virtual Machines → Options of the VM ⋮→ Devices → Options of your disk ⋮ → Edit → Zvol
Importing
Go to the command line interface of Proxmox VE. Use the command qm importovf to import the virtual machine. For example:
This will create a new virtual machine using cores, memory and VM name as read from the OVF manifest, and import the disks. You have to configure the network manually. You can find syntax and an example on how to use this command on its man page.
If you are migrating a Windows guest, you additionally have to execute the following commands. This example assumes that your imported virtual machine has the ID 130.
- Use UEFI instead of BIOS for the virtual machine:
- Windows requires additional drivers to use SCSI. Therefore, you should temporarily use SATA instead. In the following command, 'scsi0' should be replaced with the drive that's used to boot Windows.
This will give you a initial working version. You can then improve your experience and access remaining SCSI drives by installing additional drivers as explained in Windows 10 guest best practices.
Qemu/KVM
Create an new VM on Proxmox VE and add the existing disk image to this new VM, set the boot order and start.
Minimal exampleFirst a VM has to be created. 120 is an unused VM ID.
someImage.img is an image that was created before. someStorage is the name of a storage as listed in pvesm status.
qm importdisk adds the image as unused disk to the virtual machine. Thus, making it the bootdisk is still necessary.
If your use case is not covered by this article you should check out the additional ways to migrate to Proxmox VE in the wiki. It gathers years of knowledge for cases which are not as common as the ones explained here.
Популярность системы виртуализации Proxmox-VE растет с каждым днем во многом благодаря ее разносторонним возможностям. Иногда возникает необходимость в перемещении ряда гостевых машин из одной среды виртуализации в другую. Как переместить KVM виртуальную машину с диском формата qcow2 я показывал ранее в статье — Импорт kvm виртуалок в Proxmox. Теперь хотелось бы рассказать как осуществить аналогичный процесс из среды vSphere. Не часто, но такая необходимость может возникнуть у любого системного администратора. Сама миграция в целом технически не сложная, однако требует знания определенных нюансов, для получения нужного результата. Как учесть эти тонкости и по шагам провести процесс транзита виртуальных машин из VMware в Proxmox показано далее в статье.
Server self-migration
It is also possible to migrate without the need to export each VM separately including virtual disks.
This way, you can convert a server from vSphere to Proxmox VE without the need of a second server.
For this process your vSphere should use VMFS6 and you need at least one empty HDD.
1. Export the VM information without the disks using ovftool (you still need to configure the network configuration for each VM).2. Install Proxmox VE on some disk that does not contain any important data. You don't need vSphere anymore at this point. If you have an OS disk with only vSphere on it, then you can now overwrite it with Proxmox VE.
3. Create a directory on the above mention spare HDD.
4. Install vmfs6-tools which you need to mount (ready-only) the VMFS-formatted drives with the vSphere virtual disks.5. List all available drives to identify the VMFS formatted ones
6. Mount the VMFS disk partition (note it is read only)
7. Convert the vSphere disk to a suitable format for Proxmox VE
8. While the conversion is in progress you may create the 1st VM from ovf
9. As soon as the conversion is finished you may mount the new Proxmox VE disk image to the VM.
If all VM images have been moved away from a VMFS6 disk, you can format it and use it at Proxmox VE
Заключение
Небольшая статья показывает основные моменты для импорта виртуальных машин kvm в гипервизор Proxmox. Хотя, в гипервизоре есть удобный веб интерфейс для управления, однако, все основные действия в данном случае приходится делать с помощью утилит командной строки. С учетом того, как хорошо развивается проект Proxmox VE в целом, можно предположить, что в скором будущем данный функционал будет доступен и в веб интерфейсе.
никак. создай виртуалку в проксе и загугли как переносить виртуалки через rsync (или dd поверх ssh).
Ну с я zfs работаю но думаю можно и на LVM провернуть
1. Конвертируем диск
2. Создаем новую виртуалку правим конфиг
3. Запускаем устанавливаем все дрова
4. Проверяем, останавливаем, делаем бекаб средствами proxmox
5. Разварачиваем бекап по новой на zfs ну у вас LVM
6. Готово.
.. Радуемся.мигрировать виртуалку с vmware workstation (.vmdk) на proxmox
я нифига не понимаю, как напрямую через SSH закинуть vmdk на LVM раздел
напрямую закинуть vmdk на LVM разделтебе мигрировать или перенести? ты уж определись.
А что, virt-v2v в проксмоксе нету?
(.vmdk) на proxmox. (raw)
закинуть vmdk на LVM разделТак raw или lvm ?
qemu-img convert для преобразования образа. Остальное выше сказали.
targitaj ★★★★★ ( 12.12.17 05:06:57 )
Последнее исправление: targitaj 12.12.17 05:07:45 (всего исправлений: 1)Если proxmox использует lvm как хранилище (каждый образ диска виртуальной машины — логический том lvm), то преобразуешь в raw при помощи qemu-img, как сказали выше, а дальше при помощи dd заливаешь в нужный logical volume.
, как напрямую через SSH закинуть vmdk на LVM раздел
Напрямую vmdk не уверен, что можно (кажется, qemu-img не умеет конвертить в стандартный вывод). А полученный raw через конвейер ssh легко закидывается:
/dev/vg/lv — соответственно твой lvm-том, который используется в качестве диска виртуалки. Если ошибку выдаёт, то попробовать lvchange -ay /dev/vg/lv
clonezilla позволяет склонировать диски напрямую из одной виртуалки в другую.
Нужно загрузиться на обеих c live-cd и кидать по сетке содержимое хардов.
Что под капотом - можно выбрать. В том числе, как здесь предлагали, и dd-over-ssh. Но это не точно ^_-
Читайте маны, дети, будете здоровы
qemu-img dd [-f fmt] [-O output_fmt] [bs=block_size] [count=blocks] [skip=blocks] if=input of=output
dd copies from input file to output file converting it from fmt format to output_fmt format.
qemu-img dd -f vmdk -O raw if=image.vmdk of=/dev/vg1/lv1
+1 за dd over ssh, проверено собаководами
Заработало. просто я не особо понимал, как пользоваться LVM. Почитал маны, все понял.
Миграция windows виртуалки с VMware на proxmox
Не претендую на точно рабочий вариант вариант, просто в качестве дополнения.
1. - Не обязателен, снести можно и потом.
2-3 - Не относиться конкретно к виртуалкам, так делали и при переносе с одной железки на другую. Общий смысл, сменить дрова на ide. Это можно сделать из «манагера устройств» винды. Но безусловно нюансов тут чуть больше чем дофига.
Если говорить про vmware, Я делал так:
Поменял дрова в винде «манагер устройств»
Поменял устройство в VMWare
Загрузились, убедились, что все хорошо и работаем через ide.
Пункты 4. и далее уже по вкусу. Главное заставить эту дрянь изначально работать через ide.
Смена дровов на virtio (разных) и необходимость это отдельная тема.Переносил Windowx XP с VMWARE Workstation на Proxmox 6 [Получилось так (может коряво):]
- 1. Загружаем Windows XP, вместо контроллера Intel IDE ставим контроллер Standart IDE через Диспетчер устройств (правая кнопка Обновить драйвер)
- 2. Загружаемся с установочного диска Windows 7 и выше. Подойдет Admin PE Далее нажимаем SHIFT + F10 Вводим:
bootsect /nt52 ALL /force /mbr
bootsect /nt60 ALL /force /mbrУ кого-нибудь был опыт в миграции ВМ из Esxi 5.1 в Proxmox ? Как сделать правильно ?
То есть нужен vmware-vdiskmanager.exe ? Его нужно установить локально и скачать vmdk ? А у меня ВМ для миграции много весят, не вариант скачивать vmdk.
винду мигрировать нужно ?
В основом винда, но есть и Linux
Можешь юзать qemu-img
То есть по scp копируем с ESXi и на Proxmox запускаем qemu-ing ?
А как бы это автоматизировать ?
Но тут я должен вводить каждый раз путь до диска на Esxi, и имя диска для конвертирования.
Есть идеи как это можно улучшить ?
Есть идеи как это можно улучшить ?
Это типа такая шутка юмора была? Тогда я продолжу, дополните таким кодом:
То есть невозможно автоматизировать задачу массовой миграции ?
Т.е. вы неспособны скрипт из 3х строчек написать.
О чем вам anc жирно так намекнул.автоматизировать задачу массовой миграции ?
«День сурка» попал на первое апреля и не отпускает? О какой автоматизации вы говорите, если пока даже одну в ручном режиме не осилили?
Идея такая скопировать по scp , конвертировать , скопировать с помощью dd на диски созданные в ВМ. Диски ESXI и Proxmox будут браться из файла.
Тут только один диск конверитурется, а когда dd то dd: unrecognized operand ‘/dev/vg_ibm_01-1/TEST_VM_DISKS/TEST_CentOS-flat.vmdk.raw’
Еще раз для «альтернативно одаренных». Для начала осильте одну/one/uno/un VM, а уж потом беритесь за автоматизацию.
А кто вам сказал, что есть проблема в одной ВМ.
Это получилось вручную.
Проблема, когда их больше одной.
Уважаемый anc, если у вас нет идей, то просьба не спамить в теме. Спасибо за понимание.
Мигрировал так.
1. На proxmox, или сетевой шаре, расшариваем диск (директорию) по nfs
2. На esxi моунтим шару с nfs
3. На esxi мигрируем диски на новую шару. (Если у вас поднят vSphere то можно на живую)
4. Диски у вас уже на proxmox или сетевой шаре, и все работает пока на esxi
5. promxox 5.4 да помоему и вся 5.x уже держит формат vmdk
6. Можно прям так диски подсунуть, правда тормоза будут. Но потом бекап и развернуть на lvm или zol (отпадет пункт 7 конвертация)
7. Конвертнуть все диски да не вопрос fidn вам в помощь ну и цикл можно, и в несколько потоков (& в помощь), но io увас точно просядет до -99
8. ПрофитПроцесс миграции
Из имеющихся возможных вариантов проведения перевода виртуальной машины из среды vSphere в среду Proxmox покажу простейший и как мне кажется наиболее прямолинейный способ.
Во-первых, с помощью веб интерфейса клиента vSphere проводим экспорт виртуальной машины в виде OVF темплейта. Для этого в контекстном меню данной виртуальной машины выбираем Template -> Export OVF Template. Перед выполнением данного действия необходимо убедиться, что сама ВМ находится в выключенном состоянии. В результате выполнения операции экспорта на рабочий компьютер загрузится несколько файлов данной ВМ (ovf, vmdk, nvram, mf).
Во-вторых, загружаем все файлы, полученные в результате предыдущей операции, на сервер Proxmox. Это можно сделать с помощью команды scp в Linux/MacOS или pscp в Windows.
В-третьих, когда все файлы будут загружены, можно начать импорт этих файлов в Proxmox-VE. Пример команды в CLI для импорта ВМ приведен ниже.
Так 101 — это номер создаваемой виртуалки в Proxmox, a local-lvm — датастор, на котором будут находиться файлы данной ВМ. После того, как импорт будет полностью завершен, рекомендую выполнить следующие действия со вновь созданной виртуалкой:
- Установить в настройках жестких дисках параметр discard=on.
- Добавить необходимые сетевые адаптеры.
- Выставить параметр QEMU guest agent в Enabled.
- Отредактировать название ВМ в случае необходимости.
В-четвертых, пришло время запускать импортированную нами виртуальную машину. Так как в средах vSphere и Proxmox наименование сетевых адаптеров различается, необходимо через VNC консоль гипервизора произвести их переконфигурацию. После этого должна появиться связь с виртуальной машиной из сети. Соответсвенно можно будет заходить на нее удаленно и выполнять дальнешие действия через SSH или RDP. В ряде случаев для нормального функционирования определенных сервисов потребуется перезагрузка гостевой машины.
В-пятых, нам необходимо отключить vmware-tools, и включить qemu agent. Так, например, в случае с использованием Ubuntu Linux в качестве гостевой ОС, нам нужно выполнить две команды в шелле виртуальной машины.
В-шестых, после процедуры импорта, все диски гостевой машины в Proxmox будут занимать полное место на датасторе, вне зависиомсти от использования функионала Thin Provisioning. Если мы используем данную технологию, то необходимо в шелле гостевой машины выполнить следующую команду, чтобы освободить на датасторе неиспользуемое место.
В-седьмых, после того, как все необходимые действия по переносу будут выполнены, рекомендую удалить полностью первоначальную ВМ из среды vSphere. Кроме этого удаляем все ненужные файлы, которые создавались или копировались в процессе проведения работ по миграции. На этом операцию по миграции можно считать успешно выполненной и полностью завершенной.
Exporting
In VMware ESXi navigate to your virtual machine in the tree on the left. Choose Actions->Export. This will download disk images and information about your virtual machine in the .ovf format in the browser. Move those files to a storage that is accessible by your Proxmox VE host.
Install VMware's ovftool on your Proxmox VE host. ovftool version 4.4 has been reported to work with the following versions of ESXi: 6.5 and 6.7. Others (for example, 6.0) might crash with an unhelpful error message
Remove any attached disk or ISO from your ESXi VM and run
to export a virtual machine from ESXi directly into your current directory.
You can replace the dot with any other path, for example "/mnt/pve/". This way you can export directly to a storage that you created in Proxmox VE.With some configurations you get a single (.ova) archive file that contains all .vmdk disk images and the small XML description .ovf file. If this is the case, then you have to extract it before you continue with qm importovf .
VMware
This explains the migration from a VMware ESXi 6.7 hypervisor to Proxmox VE 6.1. It is tested with guests with the following operating systems:
- Debian 10
- Windows 10 Pro
- Windows Server 2016 Standard
Резюме
Алогиртм, расписанный в этой статье, сам по себе не сложный и позволяет в случае необходимости плавно перенести нужное количество гостевых машин из среды VMware в среду Proxmox-VE. Однако, надо понимать, что большая часть задач требует ручного выполнения и отнимает определенное время. В остальном, процесс миграции не должен вызвать затруднений у читателей моего блога.
Система виртуализации на базе Proxmox все больше набирает популярность при создании IT инфраструктуры в последнее время. Данное решение объединяет в себе черты профессиональной системы виртуализации с возможностью создания кластеров и централизованного управления с одной стороны. А также все свойства Open Source продукта с другой стороны. При миграции на данную систему управления виртуализации Вам скорее всего придется столкнуться с задачами импортирования виртуальных машин как из среды VMware, так и работающих под управлением гипервизора kvm. Как это сделать легко и просто со вторым типом виртуальных машин, используемых в open source среде хочется рассказать поподробнее.
Clonezilla Live CDs
This method is fast, reliable and OS independent as it uses live CDs.
- Get a live Linux CD like Clonezilla.
- Prepare the source host, make sure that you have standard IDE drivers enabled (for WinXP/Win2003 use the mergeide.reg (File:Mergeide.zip) ), for W2k I followed this link (solution 2 worked for me): [1]
- Now, boot the physical host with Clonezilla, go for beginner mode and select device - device and then remote, just follow the wizard
- On the Proxmox VE host, prepare a KVM guest, make sure you got a big enough IDE disk assigned (add 1 GB extra to be on the safe side) and also boot this KVM guest with the live CD and execute a shell.
- Become root and run fdisk (fdisk /dev/sda/) to make sure that sda is here, exit fdisk with 'w'. this was essential.
- Now enter all commands from the wizard on the source server tells you (configure network and request the copy process)
- After success (the wizard just copies the data, means I got a 80 GB disk but only 5 GB data on it so it was just a few minutes for the whole process on a gigabit network) just change the boot device to the hard disk and start the VM. Windows will install all needed drivers automatically, just the Intel NIC drivers for e1000 must be loaded from ISO (I got one big driver ISO from Intel containing all NIC drivers).
Читайте также: