把 Windows 安装到 SRP 目标¶
你可以创建定制的 Windows Server 2008 安装介质,它允许你把 Windows 直接安装到你的 SRP[^1] SAN 目标。(你无法使用标准安装 DVD-ROM 做到这一点;必须先对其进行定制。)
安装 Windows AIK¶
从 http://www.microsoft.com/downloads/details.aspx?familyid=94BB6E34-D890-4932-81A5-5B50C657DE08 下载并安装适用于 Windows Vista SP1 和 Windows Server 2008 的自动安装工具包(AIK)。
创建安装介质¶
制作可启动的 USB 盘¶
插入 Windows Server 2008 DVD-ROM 和一个空白 USB 盘。启动命令提示符,使用 diskpart 列出系统上的磁盘:
C:\Users\Administrator> diskpart
Microsoft DiskPart version 6.0.6002
Copyright (C) 1999-2007 Microsoft Corporation.
On computer: WIN-8AHI8ZB7YBM
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ---------- ------- ------- --- ---
Disk 0 Online 466 GB 0 B
Disk 1 Offline 40 GB 0 B
Disk 2 Online 3817 MB 0 B
选择 USB 盘:
DISKPART> select disk N
其中 N 是对应于你的空白 USB 盘的磁盘编号(在上面的示例中为 "Disk 2")。在 USB 盘上创建一个新的可启动分区:
DISKPART> clean
DISKPART> uniqueid disk id=12345678
DISKPART> create partition primary
DISKPART> select partition 1
DISKPART> active
DISKPART> format fs=fat32
DISKPART> assign
DISKPART> exit
(其中 12345678 可以是你选择的任何非零 8 位十六进制字符串)。
把 Windows Server 2008 DVD-ROM 的内容复制到 USB 盘:
xcopy /e /f D:\*.* E:\
(其中 D: 是你的 DVD-ROM 驱动器的驱动器号,E: 是你新格式化的 USB 盘的驱动器号)。
准备无人参与安装文件¶
使用记事本创建一个包含以下内容的文件:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup"
processorArchitecture="amd64"
publicKeyToken="31bf3856ad364e35"
language="neutral"
versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>cmd.exe /c for /f %i in ('dir /s /b %WINDIR%\inf\oem*.inf') do drvload %i || echo Ignoring error</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<settings pass="generalize">
<component name="Microsoft-Windows-PnpSysprep"
processorArchitecture="amd64"
publicKeyToken="31bf3856ad364e35"
language="neutral"
versionScope="nonSxS">
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>
</settings>
</unattend>
(如果你使用的是非 64 位版本的 Windows,把 "amd64" 修改为 "x86"),并把它保存为 E:\autounattend.xml(其中 E: 是你的 USB 盘的驱动器号)。
准备 imagex 配置文件¶
使用记事本创建一个包含以下内容的文件:
[ExclusionList]
ntfs.log
hiberfil.sys
pagefile.sys
"System Volume Information"
RECYCLER
Windows\CSC
[CompressionExclusionList]
*.mp3
*.zip
*.cab
\WINDOWS\inf\*.pnf
并把它保存为 E:\wimscript.ini(其中 E: 是你的 USB 盘的驱动器号)。
准备启动镜像¶
从 http://www.openfabrics.org/downloads/WinOF/ 下载正确版本的 Windows OpenFabrics,并解压 .msi 安装程序文件。把驱动程序文件解包到临时位置:
msiexec -a WinOF_2-1_wlh_x64.msi -qb TARGETDIR=%TMP%\WinOF
启动 Windows PE 工具命令提示符(开始->所有程序->Microsoft Windows AIK->Windows PE 工具命令提示符)并挂载启动镜像文件:
mkdir %TMP%\Mount
imagex /mountrw E:\sources\boot.wim 2 %TMP%\Mount
(其中 E: 是你的 USB 盘的驱动器号)。把 imagex 命令和配置文件添加到启动镜像:
copy ..\%PROCESSOR_ARCHITECTURE%\imagex.exe %TMP%\Mount
copy E:\wimscript.ini %TMP%\Mount
把 WinOF 驱动程序添加到启动镜像:
cd %TMP%\WinOF\PFiles\WinOF\Drivers
for /f %i in ('dir *.inf /s /b') do peimg /inf=%i %TMP%\Mount
提交对启动镜像的更改:
imagex /unmount /commit %TMP%\Mount
准备 sanbootconf¶
从 http://git.ipxe.org/releases/sanbootconf/sanbootconf-latest.zip 下载 sanbootconf,并把它保存为 E:\sanbootconf.zip(其中 E: 是你的 USB 盘的驱动器号)。
创建安装镜像¶
启用 SRP 启动支持¶
从你的 USB 盘启动,并把 Windows Server 2008 安装到一台新机器上的空白物理磁盘。(遗憾的是,由于 Windows 安装程序基础设施的限制,这一步是必要的。)
在新安装的 Windows Server 2008 中,从你的 USB 盘安装 sanbootconf。
启动命令提示符,准备机器以捕获安装镜像:
cd %WINDIR%\System32\sysprep
sysprep /oobe /generalize /shutdown /unattend:E:\autounattend.xml
(其中 E: 是你的 USB 盘的驱动器号,可能与之前不同)。
捕获安装镜像¶
从你的 USB 盘启动。在语言选择屏幕上,按 Shift-F10 启动命令提示符窗口并捕获镜像:
cd \
imagex /append C: E:\sources\install.wim "Windows Server 2008 (SRP boot)" "Windows Server 2008 with SRP boot support" /flags "SERVERENTERPRISE"
(根据你安装的 Windows Server 2008 版本,SERVERENTERPRISE 可能需要更改为 SERVERSTANDARD 或 SERVERDATACENTER)。
退出 Windows 安装程序并关闭机器。
转换回 DVD-ROM(可选)¶
你可能想把你的可启动 USB 盘转换回 DVD-ROM。为此,启动 Windows PE 工具命令提示符(开始->所有程序->Microsoft Windows AIK->Windows PE 工具命令提示符)并生成 ISO 镜像文件:
oscdimg -m -n -o -bE:\boot\etfsboot.com E:\ C:\win2k8.iso
(其中 E: 是你的 USB 盘的驱动器号,C:\win2k8.iso 是你想要存储 ISO 镜像文件的位置)。
你可以把这个 ISO 镜像文件刻录到空白 DVD-ROM,或继续使用 USB 盘。任何一种都可以用于安装 Windows Server 2008。
安装到 SRP 目标¶
[^1]: SCSI RDMA 协议(SRP)提高了读取吞吐量方面的性能,对于具有良好局部性的随机读取和顺序读取都有显著提升。\ 远程直接内存访问(RDMA)是从一台计算机的内存直接访问另一台计算机的内存,而不涉及任何一方的操作系统。