virtualization tag-unsupported tag-homelab tag-nuc" id="post-17198" style="padding: 0px; margin: 0px; word-break: break-all; color: rgb(51, 51, 51); font-family: Tahoma, Arial, Helvetica, sans-serif; white-space: normal; border: 0px; vertical-align: baseline; position: relative; width: 660px;">
最近拿到一个较老的DELL服务器,上面的硬盘居然只有130G的存储空间,完全不够用。找IT拿了一个1T的移动硬盘,想着直接当做硬盘用,但是插到服务器上之后看,没有被识别为硬盘。类型为“enclosure”,添加不了。
按照“http://www.virten.net/2015/10/usb-devices-as-vmfs-datastore-in-vsphere-esxi-6-0/”上把硬盘格式为硬盘。还是可以使用。
原文链接:https://blog.csdn.net/linuxshadow/article/details/68923771
the last years I've seen many requests in forums and blogs where people are trying to use USB devices like USB sticks or external hard disks as VMFS formatted datastore. It was actually possible in vSphere 5, but very picky. Some USB flash drives were working, others not. In vSphere 6, this behavior has been changed obviously. This post explains how you can use USB devices as datastore on your ESXi host. Of course, this is neither a supported, nor a performant storage solution, so use at your own risk.
[Update: If you are looking for USB VMFS Datastores in vSphere 6.5, read this article.]
Create VMFS Datastore on USB drives
Connect to the ESXi host with SSH
Stop the USB arbitrator service. This service is used to passthrough USB device from an ESX/ESXi host to a virtual machine. (When disabling it, you can no longer passthrough USB devices to VMs)
~ # /etc/init.d/usbarbitrator stop
(optional) Use this command to permanently disable the USB arbitrator service after reboot.
~ # chkconfig usbarbitrator off
Plug in the USB Device to your ESXi host
Get the device identifier (mpx.vmhbaXX). You should see the USB Device in /dev/disks/:
~ # ls /dev/disks/
Write a GPT label to the device (Assuming that the Device ID is mpx.vmhba36)
~ # partedUtil mklabel /dev/disks/mpx.vmhba36\:C0\:T0\:L0 gpt
To create a partition you need to know the start sector, end sector, which depends on the device size and the GUID.
The start sector is always 2048
The GUID for VMFS is AA31E02A400F11DB9590000C2911D1B8
The end sector can be calculated with the following formula (Use the numbers from getptbl):
~ # partedUtil getptbl /dev/disks/mpx.vmhba36\:C0\:T0\:L0
gpt
1947 255 63 31293440
1947 * 255 * 63 - 1 = 31278554
You can also calculate the endsector with the following command:
~ # eval expr $(partedUtil getptbl /dev/disks/mpx.vmhba36\:C0\:T0\:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
31278554
Create the VMFS partition (Replace with your endsector)
~ # partedUtil setptbl /dev/disks/mpx.vmhba36\:C0\:T0\:L0 gpt "1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0"
Format the partition with VMFS5
~ # vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba36\:C0\:T0\:L0:1
The USB-Stick should now appear in your datastores view.
And the final proof is a virtual machine running on it:
This is how your command output should look like:
~ # partedUtil mklabel /dev/disks/mpx.vmhba43\:C0\:T0\:L0 gpt
~ # eval expr $(partedUtil getptbl /dev/disks/mpx.vmhba43\:C0\:T0\:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
31278554
~ # partedUtil setptbl /dev/disks/mpx.vmhba43\:C0\:T0\:L0 gpt "1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0"
gpt
0 0 0 0
1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0
~ # vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba43\:C0\:T0\:L0:1
create fs deviceName:'/dev/disks/mpx.vmhba43:C0:T0:L0:1', fsShortName:'vmfs5', fsName:'USB-Stick'
deviceFullPath:/dev/disks/mpx.vmhba43:C0:T0:L0:1 deviceFile:mpx.vmhba43:C0:T0:L0:1
ATS on device /dev/disks/mpx.vmhba43:C0:T0:L0:1: not supported
.
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
Creating vmfs5 file system on "mpx.vmhba43:C0:T0:L0:1" with blockSize 1048576 and volume label "USB-Stick".
Successfully created new volume: 56226b60-118f2e3f-04ba-001b2193b3b0
Performance
You cant expect much performance out of usb flash drives. To see what's possible I've connected a Samsung mSATA SSD (840 EVO 250GB) to my Intel NUCs (NUC5i5MYHE) USB3 port and created a VMFS datastore on it.
Unfortunatelly it's detected as USB 2 device. There is a USB 3.0 hub, but it is not utilized. That seems to be a common problem, I don't know if it's actually possible at the moment.
[Update: October 19. 2015 - Figured out why devices are detected as USB 2. Devices now with full USB 3.0 performance. Performance test results updated.]
Max Write Throughput: 301.91 MB/s
Max Read Throughput: 308.78 MB/s
Max Write IOPS: 8159.31 CMDS/s
Max Write IOPS: 8228.49 CMDS/s
Throughput Test:
vmware-io-analyzer-1.5.1-max-read-throughput.png" style="padding: 0px; margin: 0px; text-decoration-line: none; color: rgb(111, 140, 24); border: 0px; vertical-align: baseline; outline: none;">
IOPS Test:
Mixed IO Test (I/O Analyzer Exchange 2007):
Is it possible with ESXi 5.x?
USB Devices in ESXi 5.x are a little bit picky. Some devices work, others not. I couldn't figure out why, but it is definitely related to ESXi 5.x. I've use the same procedure on the same hardware with the same flash drives. ESXi 6.0 takes all devices without any Issues, ESXi 5.5 takes some, others not.
In ESXi 5.5 the output for non working devices looks like this:
/dev/disks # partedUtil mklabel mpx.vmhba38\:C0\:T0\:L0 gpt
/dev/disks # eval expr $(partedUtil getptbl mpx.vmhba38\:C0\:T0\:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
31278554
/dev/disks # partedUtil setptbl mpx.vmhba38\:C0\:T0\:L0 gpt "1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0"
gpt
0 0 0 0
1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0
/dev/disks # vmkfstools -C vmfs5 -S terra mpx.vmhba38\:C0\:T0\:L0:1
create fs deviceName:'mpx.vmhba38:C0:T0:L0:1', fsShortName:'vmfs5', fsName:'terra'
deviceFullPath:/dev/disks/mpx.vmhba38:C0:T0:L0:1 deviceFile:mpx.vmhba38:C0:T0:L0:1
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
Creating vmfs5 file system on "mpx.vmhba38:C0:T0:L0:1" with blockSize 1048576 and volume label "terra".
Usage: vmkfstools -C [vmfs3|vmfs5] /vmfs/devices/disks/vml... or,
vmkfstools -C [vmfs3|vmfs5] /vmfs/devices/disks/naa... or,
vmkfstools -C [vmfs3|vmfs5] /vmfs/devices/disks/mpx.vmhbaA:T:L:P
Error: vmkfstools failed: vmkernel is not loaded or call not implemented.
To workaround that, I've tried to create the datastore with ESXi 6, and plugged it into an ESXi 5.5 host. No success. The datastore is recognized but appears as "inactive/unmounted".
vmkernel.log:
2015-10-16T19:44:08.410Z cpu3:33315)WARNING: LinScsiLLD: scsi_add_host:573: vmkAdapter (usb-storage) sgMaxEntries rounded to 255. Reported size was 65535
2015-10-16T19:44:08.410Z cpu3:33315)DMA: 612: DMA Engine 'vmhba38' created using mapper 'DMANull'.
2015-10-16T19:44:08.411Z cpu3:33315)<6>usb-storage 1-1.2:1.0: interface is claimed by usb-storage
2015-10-16T19:44:08.411Z cpu3:33315)<6>usb 1-1.2: device is not available for passthrough
2015-10-16T19:44:08.411Z cpu3:33315)<6>usb 1-1.2: usbfs: registered usb0107
2015-10-16T19:44:08.422Z cpu2:32809)ScsiNpiv: 1504: GetInfo for adapter vmhba38, [0x410897b96400], max_vports=0, vports_inuse=0, linktype=0, state=0, failreason=0, sts=bad0020
2015-10-16T19:44:08.422Z cpu2:32809)ScsiNpiv: 1504: GetInfo for adapter vmhba32, [0x410897bda600], max_vports=0, vports_inuse=0, linktype=0, state=0, failreason=0, sts=bad0020
2015-10-16T19:44:09.436Z cpu0:37002)usb-storage: detected SCSI revision number 0 on vmhba38
2015-10-16T19:44:09.436Z cpu0:37002)usb-storage: patching inquiry data to change SCSI revision number from 0 to 2 on vmhba38
2015-10-16T19:44:09.436Z cpu2:37003)ScsiScan: 976: Path 'vmhba38:C0:T0:L0': Vendor: ' ' Model: 'Patriot Memory ' Rev: 'PMAP'
2015-10-16T19:44:09.436Z cpu2:37003)ScsiScan: 979: Path 'vmhba38:C0:T0:L0': Type: 0x0, ANSI rev: 2, TPGS: 0 (none)
2015-10-16T19:44:09.436Z cpu2:37003)ScsiUid: 273: Path 'vmhba38:C0:T0:L0' does not support VPD Device Id page.
2015-10-16T19:44:09.436Z cpu2:37003)ScsiScan: 1105: Path 'vmhba38:C0:T0:L0' : No standard UID: Failure. ANSI version 'SCSI-2' (0x2).
2015-10-16T19:44:09.437Z cpu1:37003)VMWARE SCSI Id: Could not get disk id for vmhba38:C0:T0:L0
2015-10-16T19:44:09.437Z cpu1:37003)ScsiScan: 1503: Add path: vmhba38:C0:T0:L0
2015-10-16T19:44:09.437Z cpu1:37003)ScsiPath: 4695: Plugin 'NMP' claimed path 'vmhba38:C0:T0:L0'
2015-10-16T19:44:09.981Z cpu0:37002)usb-storage: detected SCSI revision number 0 on vmhba38
2015-10-16T19:44:09.981Z cpu0:37002)usb-storage: patching inquiry data to change SCSI revision number from 0 to 2 on vmhba38
2015-10-16T19:44:09.981Z cpu3:37003)ScsiUid: 273: Path 'vmhba38:C0:T0:L0' does not support VPD Device Id page.
2015-10-16T19:44:09.981Z cpu3:37003)VMWARE SCSI Id: Could not get disk id for vmhba38:C0:T0:L0
2015-10-16T19:44:09.981Z cpu3:37003)vmw_psp_fixed: psp_fixedSelectPathToActivateInt:479: Changing active path from NONE to vmhba38:C0:T0:L0 for device "Unregistered Device".
2015-10-16T19:44:09.981Z cpu3:37003)StorageApdHandler: 698: APD Handle Created with lock[StorageApd0x410897]
2015-10-16T19:44:09.981Z cpu3:37003)ScsiEvents: 501: Event Subsystem: Device Events, Created!
2015-10-16T19:44:09.982Z cpu3:37003)VMWARE SCSI Id: Could not get disk id for vmhba38:C0:T0:L0
2015-10-16T19:44:09.982Z cpu3:37003)ScsiDeviceIO: 7410: Get VPD 80 Inquiry for device "mpx.vmhba38:C0:T0:L0" from Plugin "NMP" failed. Not supported
2015-10-16T19:44:09.982Z cpu3:37003)ScsiDeviceIO: 7420: Get VPD 83 Inquiry for device "mpx.vmhba38:C0:T0:L0" from Plugin "NMP" failed. Not supported
2015-10-16T19:44:09.982Z cpu3:37003)ScsiDeviceIO: 7456: Get VPD 86 Inquiry for device "mpx.vmhba38:C0:T0:L0" from Plugin "NMP" failed. Not supported
2015-10-16T19:44:09.983Z cpu3:37003)ScsiDeviceIO: 6170: Could not detect setting of QErr for device mpx.vmhba38:C0:T0:L0. Error Failure.
2015-10-16T19:44:09.983Z cpu2:32787)NMP: nmp_ThrottleLogForDevice:2322: Cmd 0x1a (0x412e80846d40, 0) to dev "mpx.vmhba38:C0:T0:L0" on path "vmhba38:C0:T0:L0" Failed: H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x24 0x0. Act:NONE
2015-10-16T19:44:09.983Z cpu2:32787)ScsiDeviceIO: 2338: Cmd(0x412e80846d40) 0x1a, CmdSN 0x89a from world 0 to dev "mpx.vmhba38:C0:T0:L0" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x24 0x0.
2015-10-16T19:44:09.984Z cpu3:37003)ScsiDeviceIO: 6684: Could not detect setting of sitpua for device mpx.vmhba38:C0:T0:L0. Error Failure.
2015-10-16T19:44:10.004Z cpu3:37003)ScsiDevice: 3443: Successfully registered device "mpx.vmhba38:C0:T0:L0" from plugin "NMP" of type 0
This is a great article, great for tinkerers. Florian, way to go!
Just had somebody asking me about this last week, now I know where to point him ;-)
Great web site!
Question,
Is it possible to have more than one datastore on multiple usb drives?
Thanks
Actually it is possible to have multiple datastores on an USB. You just have to partition the drive not on the ESXi host itself. For example this is how I'm booting from the USB and using it for scratch partition: http://www.horizonbits.com/2017/02/19/squeezing-esxi-on-usb/
I could have created more partitions if I wanted :)
Each USB drive can have one datastore.
Thx mate! That worked seamlessly. Having HP ProLiantmicroserver with ESXi on SD-card and FreeNAS on USB :)
Thanks for sharing, this is what I am looking for so I can pass all onboard SATA controller to FreeNAS.
Just wondering if I stop the USB arbitrator, that means I won't be able to pass any usb to VMs(keyboard, mouse, etc), what's the workaround? (extra pcie usb card?)
New to the ESXi world, still learning.
Great discussion. So it would seem you're saying that even when using VT-d to pass an entire PCIe USB 3.0 adapter through to a VM such as I describe here https://tinkertry.com/usb3speed
stopping the USB arbitrator would also stop the pass through of those USB 3.0 devices to the VM, correct? I'm just curious, as I'm not using that particular configuration any longer, yet found this conversation quite interesting.
Morning fgrehl
Thanks for the reply, you're saying "you can simply enable the usb arbitration service after connecting the USB VMFS datastore."
I'm trying to understand your statement, do you mean after I successfully create the USB VMFS datastore I can re-enable the usb arbitration service for device passthrough and at the same time the USB VMFS datastore attached will still function?
Looks like I want to sell the cow and drink the milk at the same time :D
Yes. You can no longer use usb passthrough to connect usb devices to virtual machines. Of course you can simply enable the usb arbitration service after connecting the USB VMFS datastore. An extra PCIe usb card will not work as expected. It is also affected by the arbitration service like any other device.
Thanks for the great tips. After successfully creating a data storage in thumb drive, I made a reboot,then esxi didn't recognize the data storage any more and even not listed in /dev/disks, unless I stop the usb service from ssh,then reinsert it. Any idea?
Hey man, appreciate your great guide! I just tested this with a new Kingston 3.0 32 GB Flash Drive I bought. I'm booting ESXi 6.x via another USB stick on my main rig. I was a little nervous running some of these partitioning commands but I was pretty certain I wouldn't mess up my dual boot MBR!
Anyway, I managed to get the stick formatted with VMFS and it showed up in vSphere as usable disk storage! However, after rebooting it just showed the USB storage as 0 GB and greyed out in vSphere. I was hoping since I kept the USB stick in the same slot it would recognize it after a reboot. I stopped the USB arbitration service and then went back into vSphere but still didn't show it as usable disk storage. So, I ran ls /dev/disks/ and noticed it wasn't showing up at all for some reason.. So, I removed the USB and re-inserted it and it came up as mpx.vmhba40:C0:T0:L0 / mpx.vmhba40:C0:T0:L0:1
When I first did the procedure you provided my USB stick was vmhba39... So, do you know why that happened and if their is any way I can keep it as vmhba39 or vmhba40 or whatever it is when I format it and put the file system on?
Thanks for an awesome how-to!
Hello, it's working very well. Just for you, the last line of USB-stick vmfs creation, you missed "/dev/disks/" before the unit ;o)
Format the partition with VMFS5
~ # vmkfstools -C vmfs5 -S USB-Stick mpx.vmhba36\:C0\:T0\:L0:1
Thanks - Fixed that typo. I'm typically in the correct directory ;-)
It works ! thank you
For noobs : replace the last line with :
vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba39\:C0\:T0\:L0:1
Good luck
I know its a year later but it works. when looking for your end sector use this command the Arthur posted.
eval expr $(partedUtil getptbl /dev/disks/mpx.vmhba34\:C0\:T0\:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
I want to know if it's possible to install ESXi and Datastore in the same USB DISK ?? like a HDD the ESXI boot and datastore in the same HDD ?
Regards
Hey brothers I'm following this tutorial but at the command:
vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba36\:C0\:T0\:L0:1
I'm getting this error message:
Error: vmkfstools failed: vmkernel is not loaded or call not implemented
Please someone can throw me a bone here?
Thanks in advance.
Thanks for answering, it's ESXi 5.1 host, any advice?
The problem in 5.x was that some devices work, others not. I've spent hours to figure out why, but never found a solution. It's 100% reproducible. The only solution you have is to try another USB device, or upgrade to 6.0 where all devices are working.
I known this problem from ESXi 5.x host only. Is this an ESXi 6 Host?
The problem in 5.x is that some devices work, others not. I don't know why, but it's reproducible.
Wanted to get your thoughts on this. I have ESXi 6.x installed to a USB 3.0 USB drive in my lab. When you format the local datastore (500GB local drive in my case) it creates the scratch partition on that drive. Without creating that scratch partition, you will see 4GB of RAM being eaten on your host for a RAMdrive for the Scratch Partition. Now my challenge is that I want to use the USB drive as the ESXi install drive and ALSO host the scratch partition there. I want to run VSAN in my lab, and I can't do that with the scratch partition on the datastore.
So, thoughts on how I could get my system booting from the USB drive and also show up as a datastore so I could write the scratch partition to this?
I had the same challenge, here is how I did it:
http://www.horizonbits.com/2017/02/19/squeezing-esxi-on-usb/
hi
i have this error:
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
Creating vmfs5 file system on "mpx.vmhba41:C0:T0:L0" with blockSize 1048576 and volume label "USB-Stick".
/dev/disks/mpx.vmhba41:C0:T0:L0: Permission denied. (Have you set the partition type to 0xfb?)
Error: Permission denied
Amazing article, was able to attach my 2TB USB 3.0 disk as a VMFS datastore thanks to this !
How long does this usually take? my backup seems to take forever.
Creating the datastore takes long, or transfering data to it? USB3 or USB2?
Hi,
Thanks for this post.
I did exactly similar steps, and my usb drive can be seen in the devices section on vsphere client (as mounted ). However, I can not see it under the datastores section.
it only shows the other usb drive in datastores section, which has the esxi host installed on it !
When i try to add a new datastore it shows up the option of local hard disk, which i do not want to touch. I want to run my VM on this external usb drive that can not be seen as datastore on vsphere client.
Can you suggest something here ? I did not get any errors while mounting the usb drive on esxi host as per steps mentioned above
Thanks
Hi,
I followed the steps above and can see my USB3 drive in datasores. But I'm not able to use a USB dongle in the VMs.
I restarted usbarbitrator and reboot the server and now I see the dongle, but not the drive.
Isn't it possible to use both?
Regards
Thiemo
Thank you man.
Thanks Bro
Great tutorial it helps me a lot in my VM infra
Thanks
I couldn't find my device so I ran "fdisk -l" without the external HDD plugged in then plugged in the external HDD and ran "fdisk -l" again.
I compared the results and found this, which also matched my expectations of 1TB HDD:
***
*** The fdisk command is deprecated: fdisk does not handle GPT partitions. Please use partedUtil
***
Disk /dev/disks/mpx.vmhba41:C0:T0:L0: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/disks/mpx.vmhba41:C0:T0:L0p1 1 121602 976759808 7 HPFS/NTFS
Found valid GPT with protective MBR; using GPT
Hi. I tried this as well with my external SSD on USB. I can see adapter, seems that I can do the partition. But on the last step, i get an error :
Usage: vmkfstools -C [vmfs5|vfat] /vmfs/devices/disks/vml... or,
vmkfstools -C [vmfs5|vfat] /vmfs/devices/disks/naa... or,
vmkfstools -C [vmfs5|vfat] /vmfs/devices/disks/mpx.vmhbaA:T:LRazz
Error: Connection timed out
Any idea for me? It is shown now in esx, but also there I cannot format :-(
I was using a cheap external hard disk enclosure and started timing out after I set it up. I switched to a better enclosure and am working fine now.
Excellent! This is great for using a USB drive as a ghettoVCB backup destination! I needed such a solution and happened to find this great article. Works like a charm
You rock... and damn you're clever.
This is a great post, however, fell short of my desired goal. I managed to get the USB to present as a Datastore but as soon as I started the arbitrator service again it went. My Plex library is presented to to the VM over USB and it seems I cant have the best of both worlds :-(
Thanks for this great write-up!
This has worked fantastic for six months, but suddenly two USB disks in my datastore are unavailable - instead they are visible as usb-storage - like shown here:
https://dl.dropboxusercontent.com/u/21766330/USB2.png
The USB-enclosure works fine and the disks show no errors?
In the datastore the usb-disks are visible as extents:
https://dl.dropboxusercontent.com/u/21766330/USB1.png
Here's how one of the(now) usb-disks are presented:
https://dl.dropboxusercontent.com/u/21766330/USB3.png
Any clues? Is there a remedy?
Very good post, and I got 25% (1 of 4) of my USB Drives working. :)
I have 1x 2TB-SSD and 3x 4TB-HD, that I want to use as datastores.
- the SSD is working fine, with this method. I can reboot the host and everything still works. :)
But the 3x HD's is a different story.
All drives is giving errors in the log, but the 2TB-SSD is working, and I can also see the drive under /dev/disks/.
I've partitioned the 2TB-SSD, as described in this post, and it is working great.
Now to the 3x 4TB-HD's. They are also giving errors in the log, but unlike the SSD they are not showing the size of the drive. I have tried to disconnect all 4x drives, and use fdisk (ubuntu) to ensure I have the same content, and still only the SSD is working and showing it's size.
- See below from # ls -la /dev/disks/
-rw------- 1 root root 0 Oct 13 22:47 mpx.vmhba32:C0:T0:L0
-rw------- 1 root root 2000398934016 Oct 13 22:47 mpx.vmhba33:C0:T0:L0
-rw------- 1 root root 0 Oct 13 22:47 mpx.vmhba34:C0:T0:L0
-rw------- 1 root root 0 Oct 13 22:47 mpx.vmhba35:C0:T0:L0
I've tried to connect 1 HD at the time, tried different USB3 ports. Non of this helped.
I thought this might be a special thing for "non-SSD", to I attached older HD's of different brands. Some of them is also showing size=0, and others is showing correctly with 1TB and 2TB.
- So it seems there is something unique with the 3x drives here (Seagate Expansion models) that is causing the ESXi6 to just display "0" as the size.
My question here is, how do I get the 3x 4TB-HD's working?
- Anyone that can help me with some good ideas here, of how to fix this? :)
Alternatively, I'm also interested in presenting my 1x 2TB-SSD and 3x 4TB-HD directly (raw) to an Ubuntu VM, as this is my file server. :)
- What might be possible, best and easiest.
Johnny
Hei guys,
I have an urgent request.
After step 6 (the partedUtil) command I get the error "device has zero length and can't possibly store a file-system.."
My external device is "WD Elements 25A3" with 3TB.
I've googled this problem and found out that this device is not compatible with my VMWare ESXI 6.
Do you know any external drive that is compatible?
same issue here with
https://www.amazon.com/Seagate-Expansion-Desktop-External-STEB8000100/dp/B01HAPGEIE/ref=sr_1_1?ie=UTF8&qid=1477504014&sr=8-1&keywords=seagate+8tb+hard+drive
Hi alex,
even though it's been quite a while that you posted the comment, I'd like to add my feedback as I made some similar observations recently.
I tried to connect a Maxtor/Seagate M3 Portable 4TB drive (HX-M401TCB/GM) to my ESXi (v6.0U3) and received the very same error message. From the GUI I could see that the interface was recongnised correctly.
A couple of months ago I had come across a similar issue - using an Acronis recovery disk. The Linux system used there failed to access any disk that exceeded a 2TB limit. (I didn't do a Google search on that, I have to admit.)
With that in mind I just got me a Seagate Expansion Portable drive with 2TB capacity (SRD0NF1). This drive did work as expected, so it could be assumed that it's an issue handling USB disks/storage that exceed a certain capacity.
I might test this with an ESXi v6.5U1 at some point, but as for the v6.0U3 it seems to be a limitation to address(?) more than 2TB(?).
Cheers,
Gunter
we are trying to connect a Seagate expansion 8TB desktop external hard drive
usb 3.0 to the EXSI
https://www.amazon.com/Seagate-Expansion-Desktop-External-STEB8000100/dp/B01HAPGEIE/ref=sr_1_1?ie=UTF8&qid=1477504014&sr=8-1&keywords=seagate+8tb+hard+drive
But at the stage 6 we get an error saying "the device has zero length"
Is it because this drive is not supported or any other reason ?
Please help,
we are also facing the problem like
"The device /dev/disks/mpx.vmhba33:C0:T0:L0 has zero length, and can't possibly store a file system or partition table. Perhaps you selected the wrong device?
Unable to get device /dev/disks/mpx.vmhba33:C0:T0:L0"
At the stage 5 we can see the device.
A great post,
my question is can we make 1partition 2gb as esxi bootable and remaining partition as vmfs5 to transfer the data ?
Esxi6.5 completely rejected USB Storage.
In esxi6.0 esxi can be installed directly in the USB Storage, and then directly in the web space in the remaining space to create VMFS, but esix6.5 upgrade to the device partition can see VMFS, esxi6.5 will not mount it .
@ gamexg
Where did you get the information for that?
I've only read that devices with over 2TB aren't compatible
I also tried an 8TB drive (External Trancend), but received a different error message. (The message said that the partitioning tool did not properly support 4094 byte cluster disks).
Followed the steps and the device showed up but it said 0 length. TI should be 4 TB
0 Dec 10 07:24 mpx.vmhba39:C0:T0:L0
Hi,
I am getting "Permission denied" error in the last step. Here is the error message :
[root@localhost:~] vmkfstools -C vmfs5 -S USB-ISO /dev/disks/mpx.vmhba33\:C0\:T0\:L0:1
create fs deviceName:'/dev/disks/mpx.vmhba33:C0:T0:L0:1', fsShortName:'vmfs5', fsName:'USB-ISO'
deviceFullPath:/dev/disks/mpx.vmhba33:C0:T0:L0:1 deviceFile:mpx.vmhba33:C0:T0:L0:1
ATS on device /dev/disks/mpx.vmhba33:C0:T0:L0:1: not supported
.
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
Creating vmfs5 file system on "mpx.vmhba33:C0:T0:L0:1" with blockSize 1048576 and volume label "USB-ISO".
/dev/disks/mpx.vmhba33:C0:T0:L0:1: Permission denied. (Have you set the partition type to 0xfb?)
Error: Permission denied
Can anyone help me on this?
Best Regards,
Prashant
Hi, I can confirm that it works on ESXi 6.5!
It has different naming convention of /dev/disk.
For example:
ls /dev/disks/
.
.
.
t10.JMicron_USB_to_ATA2FATAPI_bridge
t10.JMicron_USB_to_ATA2FATAPI_bridge:1
So first I have created the VMFS partition on whole device:
partedUtil mklabel /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge gpt
partedUtil getptbl /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge
gpt
60801 255 63 976773168
partedUtil setptbl /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge gpt "1 2048 976768064 AA31E02A400F11DB9590000C2911D1B8 0"
then I have did following to file system USB drive:
vmkfstools -C vmfs5 -S USB-Stick /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge:1
If I wouldn't type :1 at the end, it will fail with this error:
/dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge: Permission denied. (Have you set the partition type to 0xfb?)
So watch carefully what do you have in device list!
Any chance one of you guys could hold a noobs hand? I've bought a 500gb USB 3.0 SSD. I boot my ESXi VM, disable the artbitrator service, plug in the drive and it's detected by VMWare Workstation , I attach it to my ESXi VM, but after that, i can't SSH to my ESXi host and it seems to hang/crash?!
MyKE,
thank you so much!!!!
with your little but fundamental detail ':1' you made my day !
Now i can see my external HD as datastore.
I guess in this case it possible to apply the rule :
"there are 10 types of people in this world, those who understand binary
and those who dont" :-)
thank you again, Bruno.
Hi,
thanks for this great article.
Anyway i get same error of Prashant while formatting :
- ATS on device ... not supported
and
- Permission denied. (Have you set the partition type to 0xfb?)
any help is more than appreciated,
Bruno.
[root@localhost:~] vmkfstools -C vmfs5 -S EXT-Ina /dev/disks/mpx.vmhba33\:C0\:T0\:L0
create fs deviceName:'/dev/disks/mpx.vmhba33:C0:T0:L0', fsShortName:'vmfs5', fsName:'EXT-Ina'
deviceFullPath:/dev/disks/mpx.vmhba33:C0:T0:L0 deviceFile:mpx.vmhba33:C0:T0:L0
ATS on device /dev/disks/mpx.vmhba33:C0:T0:L0: not supported
.
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
Creating vmfs5 file system on "mpx.vmhba33:C0:T0:L0" with blockSize 1048576 and volume label "EXT-Ina".
/dev/disks/mpx.vmhba33:C0:T0:L0: Permission denied. (Have you set the partition type to 0xfb?)
Error: Permission denied
Thanx bro,
Great article its work for me
How can I find the start of the partition if is not The starting at sector 2048 ?
I want to create a datastore using the rest free space from an a SD card where esxi 6.5 is installed. I want to use that datastore to store ISO images and vm templates for my home lab.
Thank you for the reply. I'll try it and give an update if it worked.
I met the same problem, but I fixed it by creating the partition on a Ubuntu laptop with gnome-disk-utility. Just need create the partition (no matter FAT or EXT4 and no need to format it), then check if the partition is visible in "ls /dev/disks/", if yes, format it to VMFS by command vmkfstools. Hope this can help you.
I tried but I get :
[root@localhost:~] partedUtil setptbl /dev/disks/mpx.vmhba35:C0:T0:L0 gpt "10 7086080 15518789 AA31E02A400F11DB9590000C2911D1B8 0"
gpt
0 0 0 0
10 7086080 15518789 AA31E02A400F11DB9590000C2911D1B8 0
Error: Read-only file system during write on /dev/disks/mpx.vmhba35:C0:T0:L0
SetPtableGpt: Unable to commit to disk
Never done that but you can print the partition table with
partedUtil getptbl /dev/disks/...
. The third number for each partition entry is the end sector. Just add +1 and you have your new start sector.Thank you! very much for sharing, for someone who is new to EXSi this very useful.
[root@host1:~] partedUtil mklabel /dev/disks/mpx.vmhba34:C0:T0:L0 gpt
Warning: Device /dev/disks/mpx.vmhba34:C0:T0:L0 has a logical sector size of 4096. Not all parts of GNU Parted support this at the moment, and the working code is HIGHLY EXPERIMENTAL.
Error: Input/output error during read on /dev/disks/mpx.vmhba34:C0:T0:L0
WriteNewPtable: Unable to commit to device /dev/disks/mpx.vmhba34:C0:T0:L0
Please help to resolve this issue . I am using segate 3 TB hdd
I am following this post - WD USB 3.0 external hard drive. At the partedUtil step, I am getting a read-only file system error. Struggling to figure this out. Any input would be appreciated. (do I need to format the drive before attaching to the host? What format?) Thanks in advance
Hi,
great job, you make my day, but here is a question :
you have stopped and disabled the usbarbitrator process, why if you want to use a USB device (stick or whatever) into your VM? For that you need to get usbarbitrator back, then you are loosing wmfs partition.
Thank you for your feedbacks
It's getting tricky when you want to use both, USB datastores, and USB paththrough to virtual machines. When the USB datastore is mounted, you can switch usbarbitrator back on and you will not lose your VMFS datastore. But when you reboot your ESXi host, you have either usbarbitrator running (VMFS Datastore is not available) or off (paththrough not working).
Thank you for the great tutorial for esxi 6. Will I be able to maintain my USB datastore if I update my esxi 6u3 to esxi 6.5u1? Or will i have to do a fresh install of a new esxi 6.5u1?
You don't need a fresh install but in rare cases, there might be a problem with datastores detected as snapshots as explained here: http://www.virten.net/2016/11/usb-devices-as-vmfs-datastore-in-vsphere-esxi-6-5/
No problem though
does anybody know if problem with 2Tb limitation for usb hdd is still present ?
Get article. Many thanks
Tks for the article, but i have a doubt, i have to copy some vms from one esxi 6 server to a esxi 6.5 host....how can i map the USB datastore to the another server?
Awesome post! Thank for this great article. Tested this on ESXi 6.0 and works like a charm. Now need to install USB 3.0 PCIe card on the ESXi host and backup all virtual machines. Thank you again!
Has anyone managed to use this with a drive greater than 2 To ?
Was able to get our setup working with the following:
# Set Variables
# NOTE: Change the VDISK name below to match your setup
VDISK=/dev/disks/mpx.vmhba34:C0:T0:L0
VNAME=gpt
# Set name of disk to $VNAME
partedUtil mklabel $VDISK $VNAME
# Set partition table info
partedUtil setptbl $VDISK $VNAME "1 2048 `partedUtil getUsableSectors $VDISK | awk '{print $2}' | tail -1` AA31E02A400F11DB9590000C2911D1B8 0"
# Format partition
vmkfstools -C vmfs5 -S $VNAME $VDISK:1
Great post! Worked on Esxi 6.5.