我正在尝试虚拟化(P2V)一个非常旧的 Win2K 服务器(IBM x345)及其相关存储:
主 C 盘,运行在由内部 ServeRAID HW 控制器和相关内部 HDD 提供服务的 RAID 5 逻辑阵列之上);
两个不同的附加 LUN(磁盘 S: 和 F:),通过连接到 SAN(其主阵列是 IBM DS-4300)的 QLA2XXX FC-HBA 提供服务。
我的目标是将所有这些迁移到由新的 Xen Server 6.2 平台提供服务的 VM 上。
为了避免源端的任何风险(顺便说一句:该系统或多或少是“关键的”,并且...重新安装它很容易成为一场噩梦,因为它上运行着非常旧的/遗留的/专有的/孤立的软件),我特意选择不是以任何方式更改原始操作系统(无 sysprep、无初步 xen-tools 安装、无任何新 sw 和/或配置)。
因此,我简单地执行了以下步骤:
- 在 XS 上定义一个具有适当 CPU 和内存的新 VM;
- 向这样的虚拟机添加三个不同且大小合适的磁盘;
- 使用 sysrescuecd 重新启动服务器和虚拟机;
- 通过 LAN 对三个源磁盘分别运行“dd”。
一旦“dd”完成:
- 我对虚拟机进行了快照;
- 我(尝试)启动虚拟机。
结果是(......毫不奇怪)这样的:
(顺便说一句:当虚拟机处于这样的环境中时,虚拟机的 CPU 一直处于 100% 的状态!)
因此,我通过使用 Live CD(sysrescuecd)或原始 Win2K 启动 VM 进行了一些健全性检查和修复。详情如下:
- 我可以成功访问三个磁盘上的所有数据,特别是 C: 磁盘;
- 我能够使用 Win2K“iso”启动虚拟机,然后从中启动通常修复文件和修复启动命令,来自恢复控制台;
- 我可以启动 Win2K 的新安装,并要求“修复”当前(并被安装程序正确找到/识别)的 Win2K 安装
- 我运行了 xenserver-linux-fixup-disk.iso(如果我理解正确的话,它应该有助于解决我所面临的问题......)。
上述任何测试(实际上重复多次)都会得到相同的结果:虚拟机甚至无法启动启动过程的早期阶段。
在最好的情况下,我已经成功获得了这一点:
因此操作系统(我猜是引导加载程序)似乎已找到,但……再次无法启动引导过程。同样在这种情况下,虚拟机的 CPU 停留在 100%。
由于启动过程似乎在很早的阶段就中断了(您会发现甚至连常见的基于文本的初始进度条都没有显示,在此期间可以按 F8 来选择高级启动参数/设置!)我确信解决方案应该很简单:可能是一个新的“引导加载程序”和/或一个新的“内核”能够访问 VM 的第一个 HD 上的 Win2K 安装。
最后说明一下:调查过程中,我发现磁盘几何结构不匹配。请注意下面的第 7-10 行:
root@sysresccd /root % sfdisk /dev/xvda
sfdisk: Checking that no-one is using this disk right now ...
sfdisk: OK
Disk /dev/xvda: 13054 cylinders, 255 heads, 63 sectors/track
Old situation:
sfdisk: Warning: The partition table looks like it was made
for C/H/S=*/254/63 (instead of 13054/255/63).
For this listing I'll assume that geometry.
Units: cylinders of 8193024 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/xvda1 0+ 6 7- 55975+ fe LANstep
/dev/xvda2 * 7 8876 8870 70968870 7 HPFS/NTFS/exFAT
/dev/xvda3 0 - 0 0 0 Empty
/dev/xvda4 0 - 0 0 0 Empty
sfdisk: Input in the following format; absent fields get a default value.
<start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s>
Usually you only need to specify <start> and <size> (and perhaps <type>).
sfdisk: /dev/xvda1 :
testdisks 也证实了这种不匹配:
TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <[email protected]>
http://www.cgsecurity.org
Disk /dev/xvda - 107 GB / 100 GiB - CHS 13054 255 63
Current partition structure:
Partition Start End Size in sectors
1 P LANstep 0 1 1 6 247 63 111951
Bad sector count.
Warning: number of heads/cylinder mismatches 254 (NTFS) != 255 (HD)
2 * HPFS - NTFS 6 248 1 8842 47 63 141937740
Bad relative sector.
在完成所有这些之后,出现了一个(很容易预料到的)问题:有人可以帮我启动虚拟机吗?
更新 1:虚拟机的详细信息
[root@xs-cust1 ~]# xe vm-param-list uuid=48b4c627-c06e-5bd9-23e1-28b141c6f948
uuid ( RO) : 48b4c627-c06e-5bd9-23e1-28b141c6f948
name-label ( RW): SRV-Win2K-Cust1
name-description ( RW): Ex Server Windows 2000 - Cust1
user-version ( RW): 1
is-a-template ( RW): false
is-a-snapshot ( RO): false
snapshot-of ( RO): <not in database>
snapshots ( RO): 32489008-869c-c2f4-904c-c90219adc44d
snapshot-time ( RO): 19700101T00:00:00Z
snapshot-info ( RO):
parent ( RO): 32489008-869c-c2f4-904c-c90219adc44d
children ( RO):
is-control-domain ( RO): false
power-state ( RO): halted
memory-actual ( RO): 8325660672
memory-target ( RO): 0
memory-overhead ( RO): 71303168
memory-static-max ( RW): 8589934592
memory-dynamic-max ( RW): 8589934592
memory-dynamic-min ( RW): 8589934592
memory-static-min ( RW): 134217728
suspend-VDI-uuid ( RW): <not in database>
suspend-SR-uuid ( RW): 75f87360-62ac-a9f4-01e7-7ade3d5ab943
VCPUs-params (MRW):
VCPUs-max ( RW): 2
VCPUs-at-startup ( RW): 2
actions-after-shutdown ( RW): Destroy
actions-after-reboot ( RW): Restart
actions-after-crash ( RW): Restart
console-uuids (SRO):
platform (MRW): timeoffset: 0; nx: true; acpi: 1; apic: true; pae: true; viridian: true
allowed-operations (SRO): changing_dynamic_range; changing_shadow_memory; changing_static_range; make_into_template; destroy; export; start_on; start; clone; copy; snapshot
current-operations (SRO):
blocked-operations (MRW):
allowed-VBD-devices (SRO):
allowed-VIF-devices (SRO): 1; 2; 3
possible-hosts ( RO): 371a8bf7-cdcd-4e65-9d68-8d381295b266
HVM-boot-policy ( RW): BIOS order
HVM-boot-params (MRW): order: dc
HVM-shadow-multiplier ( RW): 1.000
PV-kernel ( RW):
PV-ramdisk ( RW):
PV-args ( RW):
PV-legacy-args ( RW):
PV-bootloader ( RW):
PV-bootloader-args ( RW):
last-boot-CPU-flags ( RO): vendor: GenuineIntel; features: 77bee3ff-bfebfbff-00000001-2c100800
last-boot-record ( RO): '('struct' ('uuid' '48b4c627-c06e-5bd9-23e1-28b141c6f948') ('allowed_operations' ('array')) ('current_operations' ('struct' ('OpaqueRef:f7852954-eeae-7c76-ebe8-af3997a75776' 'start'))) ('power_state' 'Halted') ('name_label' 'SRV-Win2K-Curatela') ('name_description' 'Ex Server Windows 2000 - Curatela') ('user_version' '1') ('is_a_template' ('boolean' '0')) ('suspend_VDI' 'OpaqueRef:NULL') ('resident_on' 'OpaqueRef:NULL') ('affinity' 'OpaqueRef:35d77c6a-5a39-3cd4-7dc5-d697974d8c7c') ('memory_overhead' '71303168') ('memory_target' '0') ('memory_static_max' '8589934592') ('memory_dynamic_max' '8589934592') ('memory_dynamic_min' '8589934592') ('memory_static_min' '134217728') ('VCPUs_params' ('struct')) ('VCPUs_max' '2') ('VCPUs_at_startup' '2') ('actions_after_shutdown' 'destroy') ('actions_after_reboot' 'restart') ('actions_after_crash' 'restart') ('consoles' ('array')) ('VIFs' ('array' 'OpaqueRef:09e03a34-7f46-8412-6f21-518458b628f0')) ('VBDs' ('array' 'OpaqueRef:14105d9b-11cc-f0fd-91b2-ddf782f68d5a' 'OpaqueRef:cbfa8007-1f74-9bff-f040-e17731b296a5' 'OpaqueRef:e4aab04e-7556-e267-89bd-745ab52ff9d3' 'OpaqueRef:20c42ac7-db5d-7fc0-2c7d-d23cc5b25e23')) ('crash_dumps' ('array')) ('VTPMs' ('array')) ('PV_bootloader' '') ('PV_kernel' '') ('PV_ramdisk' '') ('PV_args' '') ('PV_bootloader_args' '') ('PV_legacy_args' '') ('HVM_boot_policy' 'BIOS order') ('HVM_boot_params' ('struct' ('order' 'dc'))) ('HVM_shadow_multiplier' ('double' '1')) ('platform' ('struct' ('timeoffset' '0') ('nx' 'true') ('acpi' '1') ('apic' 'true') ('pae' 'true') ('viridian' 'true'))) ('PCI_bus' '') ('other_config' ('struct' ('vgpu_pci' '') ('base_template_name' 'Other install media') ('mac_seed' 'f55b69ea-6990-782b-0ca5-875137642603') ('install-methods' 'cdrom'))) ('domid' '-1') ('domarch' '') ('last_boot_CPU_flags' ('struct' ('vendor' 'GenuineIntel') ('features' '77bee3ff-bfebfbff-00000001-2c100800'))) ('is_control_domain' ('boolean' '0')) ('metrics' 'OpaqueRef:74fb058c-7c16-35d9-9f2f-9196e9427230') ('guest_metrics' 'OpaqueRef:NULL') ('last_booted_record' '') ('recommendations' '<restrictions><restriction field=\"memory-static-max\" max=\"137438953472\" /><restriction field=\"vcpus-max\" max=\"16\" /><restriction property=\"number-of-vbds\" max=\"16\" /><restriction property=\"number-of-vifs\" max=\"7\" /></restrictions>') ('xenstore_data' ('struct' ('vm-data' ''))) ('ha_always_run' ('boolean' '0')) ('ha_restart_priority' '') ('is_a_snapshot' ('boolean' '0')) ('snapshot_of' 'OpaqueRef:NULL') ('snapshots' ('array' 'OpaqueRef:807cb650-f9c6-5f31-8419-d7b60cd20fc9')) ('snapshot_time' ('dateTime.iso8601' '19700101T00:00:00Z')) ('transportable_snapshot_id' '') ('blobs' ('struct')) ('tags' ('array')) ('blocked_operations' ('struct')) ('snapshot_info' ('struct')) ('snapshot_metadata' '') ('parent' 'OpaqueRef:807cb650-f9c6-5f31-8419-d7b60cd20fc9') ('children' ('array')) ('bios_strings' ('struct')) ('protection_policy' 'OpaqueRef:NULL') ('is_snapshot_from_vmpp' ('boolean' '0')) ('appliance' 'OpaqueRef:NULL') ('start_delay' '0') ('shutdown_delay' '0') ('order' '0') ('VGPUs' ('array')) ('attached_PCIs' ('array')) ('suspend_SR' 'OpaqueRef:34a5267c-75cb-b7e6-d7ba-318b26a540fe') ('version' '0') ('generation_id' ''))'
resident-on ( RO): <not in database>
affinity ( RW): 371a8bf7-cdcd-4e65-9d68-8d381295b266
other-config (MRW): vgpu_pci: ; base_template_name: Other install media; mac_seed: f55b69ea-6990-782b-0ca5-875137642603; install-methods: cdrom
dom-id ( RO): -1
recommendations ( RO): <restrictions><restriction field="memory-static-max" max="137438953472" /><restriction field="vcpus-max" max="16" /><restriction property="number-of-vbds" max="16" /><restriction property="number-of-vifs" max="7" /></restrictions>
xenstore-data (MRW): vm-data:
ha-always-run ( RW) [DEPRECATED]: false
ha-restart-priority ( RW):
blobs ( RO):
start-time ( RO): 19700101T00:00:00Z
install-time ( RO): 20141213T10:05:48Z
VCPUs-number ( RO): 0
VCPUs-utilisation (MRO):
os-version (MRO): <not in database>
PV-drivers-version (MRO): <not in database>
PV-drivers-up-to-date ( RO): <not in database>
memory (MRO): <not in database>
disks (MRO): <not in database>
networks (MRO): <not in database>
other (MRO): <not in database>
live ( RO): <not in database>
guest-metrics-last-updated ( RO): <not in database>
cooperative ( RO) [DEPRECATED]: true
tags (SRW):
appliance ( RW): <not in database>
start-delay ( RW): 0
shutdown-delay ( RW): 0
order ( RW): 0
version ( RO): 0
generation-id ( RO):
答案1
我的建议:
安装 Windows 2000 VM。不需要与要迁移的版本完全相同。只需确保所有调整参数都正确即可。磁盘大小与源服务器类似(或略大)。
使用克隆兹拉执行磁盘映像备份和恢复,而不是简单的
dd
。Clonezilla 了解可能导致启动失败的 NTFS 变化。