VMware Cloud Community
AyKay86
Contributor
Contributor

Connect USB Drive from Client to ESXi Host

Hi everyone,

i want to connect a usb drive via powecli or any command tool to a vm on my vcenter. it work thru the gui of the vmrc easy but i didnt found any solution thru command. I need that to automate a test with a product of my company.

Does Onyx give me maybe the answer?

Thanks in advance

0 Kudos
7 Replies
LucD
Leadership
Leadership

0 Kudos
AyKay86
Contributor
Contributor

Hi LucD,

yes thanks i already tried that with no success. I always get the Error: "Cannot connect "path:1/0/0/1 host:mypc.mydomain.com version:2"to this virutal machine. The device was not found.

i connected more devices to that port and checked the portnumber thru the vcenter webclient on edit the machine. The port was always the same. So i think my port should be correct... What is about the host. What do i need to enter there? i always entered "mypc" (where the usb device is connected to).

0 Kudos
LucD
Leadership
Leadership

The HostId is to be found in $vmhost.ExtensionData.Hardware.SystemInfo.Uuid


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AyKay86
Contributor
Contributor

Hey,

yes i know that the hostid can be found there. But the problem of my understanding to the script is that:

In row 21 he use

$myhost = "mypc.mydomain.com"


$vmhost = get-vmhost $myhost


My PC isnt a VMhost, so how should that work?

0 Kudos
LucD
Leadership
Leadership

In $myhost is the hostname of the the ESXi node from where you want to connect the USB device in pass through mode.

You're apparently looking for the other way round, a USB device from your PC, and connect that to the ESXi node.

Not sure if that is possible


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AyKay86
Contributor
Contributor

The question is why it should not be possible?

It works with VMRC with the GUI. But in my case i need to automate it for some product tests and dont want to create a script where i automate something with a GUI...

But thanks for your feedback.

It also works with the FAT Client. Would be nice to know what does vmware do in their C# Client. Then we will know how it works...

0 Kudos
sumann7
Contributor
Contributor

I have the same question now as have a requirement 

Is this possible? did you find something on this ?

0 Kudos