複製鏈接
請複製以下鏈接發送給好友

RDM

(Raw Device Mappings)

鎖定
RDM是(Raw Device Mapping)的簡稱,是VMware服務器虛擬化環境中,用以允許一個虛擬機直接訪問SAN(Storage Area Networking)中的一個存儲LUN(Logical Unit Number)。
從VMware ESX 2.5開始,RDM(Raw Device Mapping)允許VMFS文件卷中一個特殊的文件當作一個Raw Device (裸設備)的代理。
RDM也可以叫做裸設備映射,虛擬機直接使用存儲中的LUN,而不經過虛擬化層。 [1] 
中文名
裸設備映射
外文名
RDM
全    稱
Raw Device Mapping
起    點
VMware ESX 2.5

RDMRDM簡介

What Is Raw Device Mapping?
Introduced with ESX Server 2.5, raw device mapping allows a special file in a VMFS volume to act
as a proxy for a raw device. The mapping file contains metadata used to manage and redirect
disk accesses to the physical device. The mapping file gives you some of the advantages of a
virtual disk in the VMFS file system, while keeping some advantages of direct access to physical
device characteristics. In effect, it merges VMFS manageability with raw device access.
In prior releases, ESX Server has supported using raw disks as storage for virtual machines in
addition to virtual disk files stored in a VMFS volume. While VMFS is recommended for most
virtual disk storage, there is sometimes a need for raw disks. The most common use is as data
drives for Microsoft Cluster Services (MSCS) configurations using clusters between physical
machines, or between physical and virtual machines
With ESX Server 2.5, VMware is encouraging the use of raw device mapping in the following
situations:
· When SAN snapshot or other layered applications are run in the virtual machine. Raw
device mapping better enables scalable backup offloading systems using the features
inherent to the SAN.
· In any MSCS clustering scenario — virtual to virtual clusters as well as physical to virtual
clusters. VMware now recommends that cluster data and quorum disks be configured as
raw device mappings rather than as files on shared VMFS.
Until now, raw disks were difficult to manage for systems administrators. ESX Server 2.5 changes
this with raw device mappings. A raw device mapping is effectively a symbolic link from a VMFS
to a raw LUN. This makes LUNs appear as files in a VMFS volume. The mapping file — not the raw
LUN — is referenced in the virtual machine configuration. The mapping file contains a reference
to the raw LUN. Some important benefits of raw device mappings are:
· VMotion can now be used to migrate virtual machines using raw LUNs
· The process of adding raw LUNs to virtual machines is now simplified, both in the VMware
Management Interface and in the VMware VirtualCenter client.
· Distributed file system features such as file locking, permissions and naming become
available.
There are two compatibility modes for raw device mappings, virtual and physical. Virtual
compatibility mode allows a mapping to act exactly like a virtual disk file, including the use of
redo logs. Physical compatibility mode allows direct access to the SCSI device, for those
applications needing lower level control.
With raw device mappings, VMware now has the most flexible storage capability for virtual
machines in the industry.

RDM工作原理

使用RDM,VMkernel不會對LUN進行格式化,而是由虛擬機客户操作系統對LUN執行格式化。每個RDM是一塊單獨的虛擬機硬盤,而且通常只關聯到單個虛擬機。RDM存儲虛擬機的磁盤內容而非虛擬機文件,構成虛擬機的文件需要存放在RDM之外的數據存儲上。
部署RDM通常基於RDM能夠提供更好的性能這一理念,因為其開銷要比VMFS上的VMDK文件低。但是在某些情況下,RDM要比VMFS的性能還要差一些。如果虛擬機需要最佳的磁盤性能,那麼可以在數據存儲上存放VMDK文件。 [2] 

RDM數據恢復

使用Vizioncore的vcbRestore文件將鏡像手動恢復到ESX主機。由於服務器信息塊(SMB/CIFS)不能正常工作也失敗了。我的方法是使用下面的命令恢復所有文件:
/tmp/vcbrestore -D -I ./VM_4.tvzc -O /dev/stdout | tar -xvf -
不幸的是這也不起作用。(偶然發現這時可以將vcbRestore文件移動到不同的邏輯單元號,並嘗試用這樣的方式執行恢復,不過我沒有足夠的LUN空間。)
接下來,我嘗試從ESX主機的服務控制枱重新創建Linux logical volume manager (LVM) 2文件系統。但那樣的努力在我重新啓動虛擬機時也失敗了:
# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel.
更改只保留在內存裏,除非你決定寫入它們。當然,先前的內容不能恢復。
The number of cylinders for this disk is set to 39162.
這樣做沒錯,但這比1024大,並且在某些設置下可能會導致兩個方面的問題:在啓動時間運行軟件(如LILO的舊版本(或者從其他操作系統)(如DOS FDISK和OS/2 FDISK))啓動或劃分軟件。 [3] 

RDM侷限

有兩種類型的RDM:虛擬兼容模式RDM和物理兼容模式RDM。尤其是物理兼容模式RDM有一些相當重要的侷限:
  • 不能使用VMware快照
  • 不支持VCB,因為VCB需要VMware快照
  • 使用物理模式RDM不能克隆虛擬機
  • 在模板裏使用物理模式RDM不能轉換虛擬機
  • 如果遷移包括複製磁盤,使用物理模式RDM不能遷移虛擬機
  • 物理模式RDM不能使用VMotion功能 [4] 
參考資料