免费预览已结束,剩余8页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
ESX用本地磁盘做RDM的方法由于本地磁盘的标识号很复杂,所以建议用SSH连接,推荐用putty,后面附上putty的使用,最主要的是红色的部分VMTN Communities forum users have recently been asking how to make use of a LUN or partition on your local host within a virtual machine (VM) the same way you would if you had a SAN available. This is a more difficult task than some, and not every RAID controller allows this when using the VMware Infrastructure Client. We have to resort to command-line methods to make this happen.A VM with a raw disk or raw disk map (RDM) allows the guest OS to write directly to the LUN or disk partition within a LUN assigned to it, utilizing a pass-through mechanism. Using a raw disk or RDP wont result in a noticeable performance gain, but there is often an improvement in management. In general, when a VMDK grows past a certain size set by the administrator, the administrator will opt to use a raw disk or RDM.With VMware ESX v2.5 and ESX v3.0 it took a few simple VM configuration file edits to enable a raw disk when using local storage. Unfortunately, those methods no longer work on VMware ESX v3.5. There is, however, a solution. It is not very elegant, but it will work.The solution is to use vmkfstools to import or copy a virtual machine disk file to the LUN or partition to use for the raw device. Here is an example that I just tested and seems to work. First, I needed to find out which device held the LUN I was going to assign to my VM.1. Run fdisk -l to find the LUN.# fdisk -lDisk /dev/cciss/c0d0: 146.8 GB, 146807930880 bytes255 heads, 63 sectors/track, 17848 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/cciss/c0d0p1 * 1 13 104391 83 Linux/dev/cciss/c0d0p2 14 650 5116702+ 83 Linux/dev/cciss/c0d0p3 651 1287 5116702+ 83 Linux/dev/cciss/c0d0p4 1288 17848 133026232+ f Win95 Extd (LBA)/dev/cciss/c0d0p5 1288 1924 5116671 83 Linux/dev/cciss/c0d0p6 1925 2561 5116671 83 Linux/dev/cciss/c0d0p7 2562 3198 5116671 83 Linux/dev/cciss/c0d0p8 3199 3453 2048256 82 Linux swap/dev/cciss/c0d0p9 3454 17835 115523383+ fb Unknown/dev/cciss/c0d0p10 17836 17848 104391 fc UnknownDisk /dev/cciss/c0d1: 440.4 GB, 440430842880 bytes255 heads, 63 sectors/track, 53546 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/cciss/c0d1 doesnt contain a valid partition table2. Run esxcfg-vmhbadevs to find the vmhba device associated with the LUN.# esxcfg-vmhbadevsvmhba0:0:0 /dev/cciss/c0d0vmhba0:1:0 /dev/cciss/c0d13. Create the VM with a standard virtual disk (VMDK).4. Use vmkfstools from the command-line interface to import the VMDK into the vmhba device associated with the LUN using a disk target of RAW. Kill the import after you hit 1%.# vmkfstools -i OpenFiler.vmdk -d raw:/vmfs/devices/disks/vmhba0:1:0:0 OpenFiler_1.vmdkDestination disk format: raw disk out of /vmfs/devices/disks/vmhba0:1:0:0Cloning disk OpenFiler.vmdk.Clone: 1% done.5. Review the resultant VMDK metadata file. Note that the size of the LUN is references. For size take 860216490 and multiply by 512 for 410 GBs.# cat OpenFiler_1.vmdk# Disk DescriptorFileversion=1CID=c0699ec2parentCID=ffffffffcreateType=vmfsRaw# Extent descriptionRW 860216490 VMFSRAW /vmfs/devices/disks/vmhba0:1:0:0# The Disk Data Base#DDBddb.virtualHWVersion = 4ddb.uuid = 60 00 C2 97 5c a6 e9 59-f3 de ba f6 83 ed 15 73ddb.geometry.cylinders = 1044ddb.geometry.heads = 255ddb.geometry.sectors = 63ddb.adapterType = lsilogic5. Using the VMware Infrastructure Client (VIC), add an existing disk into the VM or add the following lines to the VMX file. (Note that you want to use a virtual SCSI controller not already in use. Also, the VM you make these changes to should be powered off and perhaps even unregistered if you are doing this from the CLI. If you use the VIC add the device following the red arrow path in the diagram below.)scsi1.present = truescsi1.sharedBus = nonescsi1.virtualDev = lsilogicscsi1:0.present = truescsi1:0.fileName = OpenFiler_1.vmdkscsi1:0.deviceType = scsi-hardDiskNow you have a VM that can directly access the local LUN on your VMware ESX host. I imagine this will work the same way for ESXi. Comment RSS Feed Email a friend rootESX4 DMD# vmkfstools -i DMD.vmdk -d rdm:/vmfs/devices/disks/naa.6001e4f041f7050015e9fba399c85dfc DMD_2.vmdkDestination disk format: raw disk mapping to /vmfs/devices/disks/naa.6842b2b005a6c60013d484842dec949b *1.1 运行命令前先进入虚拟机的目录,一般在“/vmfs/vomules/”下,你的“数据存储标识”名,然后是虚拟机目录下(如:/vmfs/vomules/disk1/DMD),里面应该有一个DMD.vmdk文件*1.2 naa.6842b2b005a6c60013d484842dec949b是存储适配器看到的标识号,*1.3 DMD.vmdk是运行命令前前建立的磁盘文件,可随意建一个最后再删除,*1.4 DMD_2.vmdk是新的镜像后的磁盘文件*1.5 下面的Clone: 1% done.指建立的过程见到 1%就可以按Ctrl+c跳过,不用等待100%完成*1.6 完成后就生成一个DMD_2.vmdk的磁盘文件,在添加磁盘时过程中选择“使用现有虚拟磁盘”即可*下面的命令只是查看建立是否成功而已,可不执行Cloning disk DMD.vmdk.Clone: 1% done.rootESX4 DMD# pwd/vmfs/volumes/datastore1/DMDrootESX4 DMD# cd /rootESX4 /# cd vmfs/rootESX4 vmfs# cd volumes/rootESX4 volumes# cd LUN1rootESX4 4c47045a-2f757741-7058-00248ca4317f# cd /rootESX4 /# cd vmfs/rootESX4 vmfs# lsdevices volumesrootESX4 vmfs# cd volumes/rootESX4 volumes# ls4c443110-36403f70-45f6-842b2b1898ed datastore14c443111-35cf0740-2aa4-842b2b1898ed datastore24c46dcff-43db1cba-d45c-00248ca4317f LUN14c47045a-2f757741-7058-00248ca4317f Storage1rootESX4 volumes# cd datastore1rootESX4 datastore1# lsDMDrootESX4 datastore1# cd DMD/rootESX4 DMD# lsDMD_1-rdmp.vmdk DMD_2-rdm.vmdk DMD-flat.vmdk DMD.vmdk DMD.vmx vmware.logDMD_1.vmdk DMD_2.vmdk DMD.nvram DMD.vmsd DMD.vmxfrootESX4 DMD# cat DMD_2.vmdk# Disk DescriptorFileversion=1encoding=UTF-8CID=622c87e1parentCID=ffffffffcreateType=vmfsRawDeviceMap# Extent descriptionRW 4294940672 VMFSRDM DMD_2-rdm.vmdk# The Disk Data Base#DDBddb.deletable = trueddb.virtualHWVersion = 7ddb
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年驱动开发工程师招聘面试题库及参考答案
- 2025年市场顾问招聘面试参考题库及答案
- 2025年远程客户支持招聘面试题库及参考答案
- 2025年企业社交媒体专员招聘面试题库及参考答案
- 2025年电商运营主管招聘面试参考题库及答案
- 2025年视觉效果设计师招聘面试题库及参考答案
- 2025年战略合作专员招聘面试题库及参考答案
- 2025年电子商务运营招聘面试参考题库及答案
- 2025年导演招聘面试参考题库及答案
- 2025年影视后期制作师招聘面试题库及参考答案
- 干眼症课件资料
- 电网QC比赛项目汇报答辩课件
- 工会安全知识培训内容课件
- 污染溯源课程标准解读
- 外来人员滋扰暴力事件应急预案
- 6.1 正视发展挑战(导学案) 2025-2026学年度道德与法治九年级上册 统编版
- 耕地非粮化培训课件
- 专题17 基因工程-2025年高考《生物》真题分类汇编
- 民非单位内控管理制度
- 高一物理第一次月考卷【测试范围:人教版第1~2章】(考试版A3)
- 2025年医疗器械供货、培训方案及质保措施投标方案
评论
0/150
提交评论