Jump to content
XPEnology Community

XPEnology on ESXi 6.7 on USB Devices


compuman

Recommended Posts

I am new with ESXi server and virtual machine.

 

With some tutorial I make my hardware works:

  1. now I have ESXi 6.7 load from a internal USB Stick (4Gb)
  2. I create a datastore on external USB Stick (32Gb) where I installa a VM with XPEnology 
  3. I use the internal SATA HDD like phisycal drive on VM (map with vmkfstools -z on a local vmdk )

 

All works with DSM 6.2.2 that was my goal

BUT

my problem is that i HAVE to use also two NTFS HDD connected on external USB3 to share with XPEnology ... 

 

NOW

 

in point 2. (to use a datastore on external USB) I use also command "chkconfig usbarbitrator off"

and I think this is WHY I can't set the external NTFS HDD on virtual machine!

 

if I set "chkconfig usbarbitrator on" after reboot, i can't see the datastore on external USB...

so ESXi not find VM... 

 

what is the correct method to use a datastore on USB AND USB passthrough for my USB NTFS HDD? 

 

The perfect solution (for me) was to use the free USB space on the internal USB stick

Is there a way to use the same USB STICK for boot ESXi and create a datastore for VM in the free space ? 

I not find a tutorial to make this... but only to use a entire USB stick, so I have to use two USB stick: one for boot and one for datastore

 

Thanks

Link to comment
Share on other sites

This isn't really an XPEnology or DSM problem, this is an ESXi problem.  I don't see how you can do it differently than you are without changing hardware.

 

Why not acquire and install another SATA or NVMe datastore so that you don't need the 32GB USB stick and can return the ESXi USB handling to normal?

Link to comment
Share on other sites

On 6/7/2019 at 4:59 PM, flyride said:

This isn't really an XPEnology or DSM problem, this is an ESXi problem.  I don't see how you can do it differently than you are without changing hardware.

 

Why not acquire and install another SATA or NVMe datastore so that you don't need the 32GB USB stick and can return the ESXi USB handling to normal?

thanks,but I can't,

because the hardware that I use is with only ONE SATA controller with space for ONLY two hot swap disk that is used (normally) for two disk in RAID1 (with xpenology)

(a basic NAS hardware that boot from internal USB stick)

 

I'm triing to convert this NAS to ESXi with a VM with XPEnology... and it works well, except for the problem I'm talking about:

-boot fron internat, but need also an external USB stick

-USB passthrough not working with this configuration

 

well, if there is some solution... OK

in there is not... i will stay with OLD XPEnology installed like usually ... 

 

 

Link to comment
Share on other sites

8 hours ago, compuman said:

I'm triing to convert this NAS to ESXi with a VM with XPEnology... and it works well, except for the problem I'm talking about:

-boot fron internat, but need also an external USB stick

-USB passthrough not working with this configuration

 

OK

I found ONE solution that solve both the problem

Now I can use the free space of the internal USB stick (the one with ESX boot) without modify "usbarbitrator" so now I can pass the external USB HDD to the VM (it appear like USB DEVICE in VM editor)  

 

Well, now the REAL test to see if this solution (migrate XPEnology to ESXi VM) can be used for everyday use...

 

 

Link to comment
Share on other sites

On 6/10/2019 at 6:06 PM, bearcat said:

@compuman Care to share the found solution? (in case someone else would like to give it a  try)

no problem

 

BEFORE:

-I installed ESXi in the internal (32Gb) USB stick (I use an external bootable 8Gb USB stick with ESXi ISO injected with Realtek network driver)

-test that the ESXi system boot correctly (without a Datastore)

 

NOW:

1.boot GPARTED and create an unformatted partition in the free space of USB stick (I leave some free space between the last used partition and the new one, but i don't know if it is important)

2.using the terminal in GPARTED set the type of partition (if the new partition is /dev/sdb2):

#gdisk /dev/sdb

{press t}
{select partition 2}
{type fb00}
{press w}
{confirm with Y}

 

3.now change the partition number (from 2 to 10) to be sure that it will not be touch in future update

#sfdisk -d /dev/sdb > esxi2.txt

edit the text file and change 

/dev/sdb2 : start= 13500416, size= 16775168, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=50D5FE33-CDC7-413B-AF11-C32BF433AA85

to 

/dev/sdb10 : start= 13500416, size= 16775168, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=50D5FE33-CDC7-413B-AF11-C32BF433AA85

and move the line on the end of text file

Then write back the partition table

#sfdisk --force /dev/sdb < esxi2.txt

 

4.boot ESXi system (from modified USB stick).

From terminal (I use SSH):

check partition

#partedUtil getptbl /dev/disks/mpx.vmhba32:C0:T0:L0

and format it 

#vmkfstools -C vmfs6 -S USB-Stick /dev/disks/mpx.vmhba32:C0:T0:L0:10

THAT's ALL 

 

Now you see in DataStore a new DataStore "USB-Stick" and you can create folder, upload file, create VM, etc... 

WITHOUT change "usbarbitrator"

SO you can attach USB HDD on external port to pass the USB DEVICE to VM 

Edited by Polanskiman
Added code tags.
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

  • 5 years later...

I found a way to do this from inside of vmware thanks to your info above... the source article for that info (*that is only available on the wayback machine on internet archive at this point).

so for step 1-3 you are basically adding an additional partition.

Since the ESXi boot disk numbers partitions 1, 5-9 any partition you make with a third party tool is going to try to be partition 2.

 

so I just applied your method to the vmware took for partitioning:

https://knowledge.broadcom.com/external/article/323144/using-partedutil-command-line-disk-parti.html

 

Turn on ESXi Shell and SSH either from the Console of the server, or start the services from the ESXi web ui.

connect to ESXi using putty

Issue following commands, and use the info they provide to help you craft the solution to match your drive:

ls -ltrh /vmfs/devices disks

get existing partition table using name from above command, using the tab key to complete the name of the device, so we dont have to type the whole thing:

partedUtil getptbl /vmfs/devices/disks/vml.01[tab]

craft the command to “replace” the existing partition table by over writing it with a new table that contains all of the existing table, and appending the new partiton we are wanting to create:

The command above shows the a disk info line for example in my case “31130 255 63 500118192”

Use this last number minus 2096 as the max number of sectors to determine the end of the new partition, and the end of partition 9…

"9 1843200 7086079"

add 1 to start it right after that partition, and specify the type of partition it will be using table found by running command:

partedUtil showGuids

so for example: 

if end of partition 9 is 7086079

and end of the disk is 500118192 (minus 2096 = 500118192) 

and we want to create a vmfs partition type "AA31E02A400F11DB9590000C2911D1B8"

we come up with:

"10 7086080 500118192 AA31E02A400F11DB9590000C2911D1B8 0"

 

partedUtil allows creation of table, deletion of partition, resizing of partition, but no “add partiton” other than printing the existing partition table, and then resetting it using the existing info, and appending the new info.

so in my example, I used the results from "partedUtil getptbl" above, and pasted them into a "partedUtil setptbl" command, putting quotes around each line, removing the text to put it in the right format, and then just added my new partition at the end of the command:

example result:

partedUtil setptbl /vmfs/devices/disks/vml.010000000030313233343536373839323353534b205374 gpt "1 64 8191 C12A7328F81F11D2BA4B00A0C93EC93B 128" "5 8224 520191 EBD0A0A2B9E5443387C068B6B72699C7 0" "6 520224 1032191 EBD0A0A2B9E5443387C068B6B72699C7 0" "7 1032224 1257471 9D27538040AD11DBBF97000C2911D1B8 0" "8 1257504 1843199 EBD0A0A2B9E5443387C068B6B72699C7 0" "9 1843200 7086079 9D27538040AD11DBBF97000C2911D1B8 0" "10 7086080 500116096 AA31E02A400F11DB9590000C2911D1B8 0"

next verify the table changed to match your input, again using the tab key to complete the name of the device, so we dont have to type the whole thing:

partedUtil getptbl /vmfs/devices/disks/vml.01[tab]

then same as above solution format the new vmfs partition:

vmkfstools -C vmfs6 -S USB-Stick /dev/disks/mpx.vmhba32:C0:T0:L0:10

In vCentre or ESXi web interface refresh and then check to see if the new Datastore is showing.

In my case it just showed up I didn't have to do anything else.

 

FYI: for all the datajockey's out there saying DON'T do this... In my case I'm using an NVMe M.2 drive in a NVMe to USB-C cage for a "real" hard drive but plugging it into the USB header inside a server... that back in the day (pre vmware 6.7) was fully acceptable and supported way of booting ESXi.

I understand the normal concern with performance and danger when doing this with a normal USB stick, but in my case vmware recognizing this as USB storage it was refusing to create the datastore, which if this was just in an M.2 port on the server mainboard it would not have even been an issue.

My usage case was to separate the ESXi boot drive from the RAID in the server so the whole RAID in the server is available an segregated from the ESXi boot disk --- but I still wanted to have a Datastore on the NVMe/USB to put ISOs I would use to install os that would be on the RAID Storage.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...