一、前言
基于VMware Exsi环境,考虑到特殊业务需求,需要直接将磁盘数据提供给虚拟机使用。
本文主要介绍,如何配置磁盘直通,将磁盘裸映射提供给虚拟机使用。
二、配置过程
1、通过VMware vSphere Client查看新增磁盘名称,对比Exsi后台/vmfs/devices/disks/
确定新增磁盘对应ID为naa.61866da0692804002855fa603ff25fd9
、naa.61866da0692804002857277b3277bf87
、naa.61866da069280400285727ff3a59e706
、naa.61866da0692804002857290f4a8b4bfc
[root@localhost:~] ls /vmfs/devices/disks/
naa.5000c500a323807b naa.50014ee0aeb167e9:8 vml.020000000050014ee0aeb167e9574443205744:1
naa.5000c500a323807b:1 naa.50014ee0aeb167e9:9 vml.020000000050014ee0aeb167e9574443205744:2
naa.5000c500a3264fe7 naa.61866da0692804002855fa603ff25fd9 vml.020000000050014ee0aeb167e9574443205744:3
naa.5000c500a3264fe7:1 naa.61866da0692804002857277b3277bf87 vml.020000000050014ee0aeb167e9574443205744:5
naa.5000c500a39a682b naa.61866da069280400285727ff3a59e706 vml.020000000050014ee0aeb167e9574443205744:6
naa.5000c500a39a682b:1 naa.61866da0692804002857290f4a8b4bfc vml.020000000050014ee0aeb167e9574443205744:7
naa.50014ee0aeb167e9 vml.02000000005000c500a323807b535436303030 vml.020000000050014ee0aeb167e9574443205744:8
naa.50014ee0aeb167e9:1 vml.02000000005000c500a323807b535436303030:1 vml.020000000050014ee0aeb167e9574443205744:9
naa.50014ee0aeb167e9:2 vml.02000000005000c500a3264fe7535436303030 vml.020000000061866da0692804002855fa603ff25fd9504552432048
naa.50014ee0aeb167e9:3 vml.02000000005000c500a3264fe7535436303030:1 vml.020000000061866da0692804002857277b3277bf87504552432048
naa.50014ee0aeb167e9:5 vml.02000000005000c500a39a682b535436303030 vml.020000000061866da069280400285727ff3a59e706504552432048
naa.50014ee0aeb167e9:6 vml.02000000005000c500a39a682b535436303030:1 vml.020000000061866da0692804002857290f4a8b4bfc504552432048
naa.50014ee0aeb167e9:7 vml.020000000050014ee0aeb167e9574443205744
2、通过vmkfstools -z
将新增磁盘映射到数据存储指定虚拟磁盘文件中
[root@localhost:~] vmkfstools -z /vmfs/devices/disks/naa.61866da0692804002855fa603ff25fd9 /vmfs/volumes/datastore/naa.61866da0692804002855fa603ff25fd9.vmdk
[root@localhost:~] vmkfstools -z /vmfs/devices/disks/naa.61866da0692804002857277b3277bf87 /vmfs/volumes/datastore/naa.61866da0692804002857277b3277bf87.vmdk
[root@localhost:~] vmkfstools -z /vmfs/devices/disks/naa.61866da069280400285727ff3a59e706 /vmfs/volumes/datastore/naa.61866da069280400285727ff3a59e706.vmdk
[root@localhost:~] vmkfstools -z /vmfs/devices/disks/naa.61866da0692804002857290f4a8b4bfc /vmfs/volumes/datastore/naa.61866da0692804002857290f4a8b4bfc.vmdk
注:/vmfs/volumes/datastore/中datastore为数据存储路径
[root@localhost:~] ls /vmfs/volumes/datastore/
CentOS-6.5-x86_64-bin-DVD1.iso naa.61866da0692804002857277b3277bf87-rdmp.vmdk naa.61866da069280400285727ff3a59e706.vmdk ubuntu-16.04.6-server-arm64.iso
naa.61866da0692804002855fa603ff25fd9-rdmp.vmdk naa.61866da0692804002857277b3277bf87.vmdk naa.61866da0692804002857290f4a8b4bfc-rdmp.vmdk ubuntu-20.04.2.0-desktop-amd64.iso
naa.61866da0692804002855fa603ff25fd9.vmdk naa.61866da069280400285727ff3a59e706-rdmp.vmdk naa.61866da0692804002857290f4a8b4bfc.vmdk