Некоторые смонтированные в стойке машины HP, что я продолжил работать в прошлом, как было известно, выполняли свои вентиляторы изо всех сил, пока собственный драйвер или пакет программного обеспечения не загружаются в ОС. Затем они были бы ослаблены вниз.
Что ОС Вы используете? Вы установили все рекомендуемые драйверы/пакеты?
Вы могли возможно передать вывод по каналу от dd до туннеля SSH к Вашей целевой машине. Я знал, что это сделано относительно успешно в виртуальную машину VMware.
Хорошие детали в основном ответе здесь, и предоставляют инструкции для того, что сделать, если SSH не работает (много liveCDs имеют сервер SSH на них так или иначе, так не должна быть проблема): Как настроить клонирование дисков с dd, netcat и туннелем ssh?
Можно скопировать образы дисков в логические тома LVM и обеспечить это как образ диска для VM. Удостоверьтесь, что Вы отключаете NTP и NTPDATE на виртуальных серверах.
Я преобразовал некоторое старое использование изображений Mondo для создания загрузочных изображений восстановления. Это позволило мне изменять размер разделов во время, переустанавливают.
P
с Debian Wheezy 7.11 на V
KVM на Proxmox VE v5 .4 P
диски на KVM диски virtio P
дисков на меньшие V
диски ] Целью этих шагов было взять физический узел Linux P
, работающий в реальном времени, и виртуализировать его. Без необходимости создавать и выделять многотерабайтные диски или использовать md raid в гостевой системе V
, поскольку целевой гипервизор (Proxmox 5) использовал ZoL / ZFS. Также хотел уменьшить время простоя / перезагрузки на работающем узле P
.
Эти шаги могут быть не идеальными, но они должны приблизить вас к решению и цитировать полезные ссылки, которые я нашел по ходу дела.
] Я решил опубликовать ответ на этот вопрос после тщательного поиска в Google на https://unix.stackexchange.com и https://serverfault.com . Это показалось мне наиболее подходящим для моего ответа, хотя на момент написания статьи ему было 9+ лет.
Вот некоторые связанные вопросы, которые я обнаружил, и этот ответ также призван решить:
P2V с rsync
Как создать виртуальную машину из живого сервера?
Как перенести физическую систему на виртуальный сервер KVM с доступом только к сети?
Преобразование физической машины в виртуальную без ее выключения
Миграция физической машина в KVM
преобразование vmware физическая машина linux
Как перенести установку Linux с нуля на виртуальную машину
# On the P node
# check the kernel has the virtio support
grep -i virtio /boot/config-$(uname -r)
# when no, that is an issue out of scope of these instructions. contact me.
# if lsinitrd is available, check if the initramfs already has the modules
lsinitrd /boot/initrd.img-$(uname -r) | grep virtio
# when yes, your virtio is already in the initramfs, continue to next step
# when no, add the modules to the initramfs
# backup existing initrd.img
cp -iv /boot/initrd.img-$(uname -r) /boot/BACKUP_initrd.img-$(uname -r)
# non Debian way
mkinitrd --with virtio_console --with virtio_pci --with virtio_blk -f /boot/initrd.img-$(uname -r) $(uname -r)
# The Debian way
# https://wiki.debian.org/DebianKVMGuests
echo -e 'virtio_console\nvirtio_blk\nvirtio_pci' >> /etc/initramfs-tools/modules
# check correctly append new lines etc, correct manually if needed
cat /etc/initramfs-tools/modules
# compile new initramfs
update-initramfs -u
# OPTIONAL if safe
# !!! WARNING DOWNTIME -- reboot P node to test everything is ok with the new initramfs
shutdown -r now
# boot a new KVM guest on SystemRescueCD or similar
# create the BIOS/UEFI partition(s)
# https://help.ubuntu.com/community/DiskSpace#BIOS-Boot_or_EFI_partition_.28required_on_GPT_disks.29
# https://help.ubuntu.com/community/Installation/UEFI-and-BIOS/stable-alternative#Create_a_partition_table
# follow the linked guides above to create the relevant BIOS partitions/disks.
# BOOT partition
# inspect the P boot partition - note the parameters
# CRITICAL the new V boot partition should be identical to the partition on the P.
# make the V boot partition using your preferred partitioning tool
# on P node, make a copy of the boot partition
# umount the boot fs for backup
umount /boot
# backup boot partition
gzip --stdout /dev/md1 > ~user/boot.disk.md1.img.gz
# re-mount boot fs
mount /boot
# on the KVM live CD
cd /tmp # or somewhere with > some space for the boot image
scp user@hostname.com:boot.disk.md1.img.gz .
gunzip boot.disk.md1.img.gz
# copy the P boot partition to the V boot partition
dd if=boot.disk.md1.img of=/dev/vda1
# verify consistency
fsck.ext3 /dev/vda1
# list the detected file systems, visual check for the expected results
fsarchiver probe simple
# on the KVM live CD make your data partitions, the size you wish
# mirroring the P is not required, obviously needs to be enough space for the data.
# CRITICAL the binaries/tools used to make the data file systems must be for the same kernel generation i.e. from the node being converted, otherwise the system will fail to mount the rootfs during boot.
# https://unix.stackexchange.com/questions/267658/
# CRITICAL target file systems must have enough inodes
mkefs -t ext4 -N 1500000 /dev/vda2
mkefs -t ext4 -N 1500000 /dev/vda3
cd /mnt/
mkdir linux
mount /dev/vda2 linux/
cd linux/
mkdir -p var boot
mount /dev/vda3 var/
# consider mounting the fs ro, or at the very least stopping services for the final rsync
nohup rsync --bwlimit=7m --human-readable --itemize-changes --verbose --archive --compress --rsync-path='sudo rsync' --rsh='ssh -p22345' --exclude=/mnt --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/run --exclude=/boot --exclude=/var/spool user@hostname:/ . 1>../rsync.stdout 2>../rsync.stderr
# check the logs are ok, and as expected
# final sync, stop services, and/or ro the fs(s)
rsync --bwlimit=7m --human-readable --itemize-changes --verbose --archive --compress --rsync-path='sudo rsync' --rsh='ssh -p22345' --exclude=/mnt --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/run --exclude=/boot --exclude=/var/spool user@hostname:/ .
mount /dev/vda1 boot/
mkdir -p proc dev sys
mount -o bind /proc /mnt/linux/proc
mount -o bind /dev /mnt/linux/dev
mount -o bind /sys /mnt/linux/sys
chroot /mnt/linux /bin/bash
export PATH=$PATH:/bin:/sbin:/usr/sbin/ # check what is required for your P
grub-install /dev/vda
grub-install --recheck /dev/vda
update-grub
# update /etc/fstab with the new id/names/options
vim /etc/fstab
# Only required if you're P node had md RAID
# https://dertompson.com/2007/11/30/disabling-raid-autodetection-in-ubuntu/
aptitude purge mdadm
# required mount points
mkdir -p /mnt /proc /sys /dev /run
# required because I didn't rsync /var/spool
mkdir -p /var/spool/cron/atspool /var/spool/cron/crontabs /var/spool/cron/atjobs /var/spool/postfix /var/spool/rsyslog
# reboot to KVM guest normal boot disk
# fix a screen bug that appeared after P2V
aptitude reinstall screen
# ensure boot logging is enabled
# https://wiki.debian.org/bootlogd
aptitude install bootlogd
# networking
# check that the MAC address assigned to the KVM matches what the KVM kernel reports
ip link
# modify net interfaces, taking note of the interface name with the correct MAC address
vim /etc/network/interfaces
# update DNS if required
vim /etc/resolv.conf
# update apache2 envvars if required
vim /etc/apache2/envvars
# update hosts
vim /etc/hosts
# reboot
shutdown -r now
#### post reboot
# check dmesg and/or kvm console for boot it issues
dmesg -x
dmesg -x --level=err --level=warn
# check boot log for issues, useful if physical console cannot be easily viewed
# formatting: https://stackoverflow.com/q/10757823
sed 's/\^\[/\o33/g;s/\[1G\[/\[27G\[/' /var/log/boot |less -r