一、前言

基于VMware ESXi环境,考虑到特殊业务需求,需要直接将磁盘数据提供给虚拟机使用。
本文主要介绍,如何配置磁盘直通,将磁盘裸映射提供给虚拟机使用。

二、配置过程

1、通过VMware vSphere Client查看新增磁盘名称,对比ESXi后台/vmfs/devices/disks/确定新增磁盘对应ID为naa.61866da0692804002855fa603ff25fd9naa.61866da0692804002857277b3277bf87naa.61866da069280400285727ff3a59e706naa.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
3、编辑虚拟机,添加虚拟磁盘文件到虚拟机上,之后重启虚拟机即可看到映射磁盘

在这里插入图片描述

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐