Reply to Message

View discussion in a popup

Replying to:
sibsib
Contributor
Contributor

Hi ,

Here is one answer to your question. I hope that an easier way exists...

First of all, thanks for your information about the --verbose option for usbarbitrator, I did stay on ESXI  5.0 because I dind't find out this information.

For the record, I use a free version of ESXi (for my home server) and, via ssh, from one of my guests, I map an unmap my external USB drive, for backup purpose. But to do that, I need to know some VMware inofrmation that I used to search in usb.log and were missing since version 5.1.

OK, back to your question.

VMware use volatile filesystems for the operating system, and at each boot, these volatile FS are populated from differents files stored in /bootbank. Problem is that these files are not easely manipulated. They seems to be in tar gz format, but they aren't.

I found more information here :

http://www.virtuallyghetto.com/2011/08/how-to-create-and-modify-vgz-vmtar.html

Disclaimer : during my tests, I had once to reboot my ESXi from a CD, so don't try that on a production server ! Also, as I modify a stock ESXi file, I suppose that at every patch application, I probably will have to run the whole process again ! Last but not least, I'm not sure that this solution is supported by VMware Smiley Wink

So, what I did : The tests were made on a completely fresh install of esxi 5.5 (from a DELL CD, as I own a DELL server), the version is 1746974. I also use a running CentOS 5 server to manipulate the file. The server is a 32 bits version, that seems to be OK for tar.

I had to activate local shell and remote ssh for these operations.

On the ESXi :

mkdir /vmfs/volumes/datastore1/s

cp /bootbank/s.v00 /vmfs/volumes/datastore1/s

cd /vmfs/volumes/datastore1/s

zcat s.v00 >s.vmtar

vmtar -x s.vmtar -o s.tar -v

--- copy the s.tar on the linux machine. (maybe the other steps could be done on the esxi ?)

On the Linux box

Important : you need to be root, to be sure that the file are restored with the original owner/group.

mkdir s

cd s

tar xvf {path to the file}/s.tar

vi etc/init.d/usbarbitrator

(I did this change :

USBARBITRATOR_SCHED_PARAM="--verbose ++group=usbArbitrator"

)

touch -r etc/init.d/cdp etc/init.d/usbarbitrator
# it seems that the order of the file is critical

tar tf {path to the file}/s.tar >/tmp/s.filelist

tar -cv -T /tmp/s.filelist  --no-recursion --same-order -f {path to the file}/s1.tar

------------ send s1.tar back to the ESXi in the same folder than s.tar

On the ESXi :

vmtar -c s1.tar -o s1.vmtar -v

gzip -9 -c s1.vmtar >s1.v00

Now, a little check can be useful !

vmtar -t <s.v00 >s.txt

vmtar -t <s1.v00 >s1.txt

Back to the unix machine

retrieve the two files

We have to suppress the date and time :

cat s.txt | awk ' { $4="" ; $5="" ; print } ' >sc.txt

cat s1.txt | awk ' { $4="" ; $5="" ; print } ' >s1c.txt

diff sc.txt s1c.txt

183c183

< -r-xr-xr-x 201/201 4483   etc/init.d/usbarbitrator

---

> -r-xr-xr-x 201/201 4493   etc/init.d/usbarbitrator

OK, only one change, hat is what we expected Smiley Happy

and now, tadaa !!!

cp s1.v00 /bootbank/s.v00

reboot (and cross your fingers !)

It works for me !

Thanks,

Pascal