View unanswered posts | View active topics It is currently Mon Jan 23, 2017 8:56 am



Reply to topic  [ 8 posts ] 
 Recover ESXi if USB boot device is VMDirectPath enabled 
Author Message

Joined: Mon Dec 06, 2010 4:04 pm
Posts: 3
Reply with quote
Post Recover ESXi if USB boot device is VMDirectPath enabled
Recover an ESXi if the USB boot device has been enabled for VMDirectPath


You have activated VMDirectPath an all USB interfaces to find the right USB Port ?
Unfortunately, your system was booting from an USB device... (like me... :oops: )



Symptoms after the reboot (needed to enable VMDirectPath):

- The configuration is "read-only" / configuration modifications are lost after reboot
- the local console is frozen.
- ESXi is booting slowly.
- ESXi can't find the VMtools when you try to install it.
- You can't disable VMDirectPath.


The problem is obvious, ESXi makes available the USB booting interfaces for VMDirectPath.
The USB boot drive behind this interface is no more available for the system.
Surprisingly, ESXi don't crash, VM's start as usual (try to remove system drive of Hyper-V).


Which operations have no effect ?

- Any modification through vSphere Client (all settings are stored on the USB flash drive).
- Trying to connect in SSH on host to modify something (there is no more files to edit).
- ...


What can we do ?

Manually edit the configuration for VMDirectPath on the USB Flash drive through a virtual machine.
Let's go:

- Download the last version of Ubuntu (http://www.ubuntu.com/desktop/get-ubuntu/download)
- Load the ISO on hypervisor datastore
- Create a new VM for Ubuntu (no harddrive, no network, 1 vCPU and 512MB is enough).
- Attach the Ubunutu ISO file to virtual CD drive
- Add the VMDirectPath USB interface (which have the USB boot device)
- Boot on Ubuntu, don't install, just start as live CD
- Open the Hypervisor1 partition
- Copy local.tgz on Desktop
- Untar the copy of local.tgz through these commands:
Code:
cd Desktop
sudo tar czf local.tgz etc

- Open the extracted folder etc on desktop, then go in vmware folder and finaly right click on esx.conf, edit in text editor.
- find the line looks like
Code:
   /device/000:27.0/owner = "passthru"
   /device/000:27.0/
   /device/000:27.1/owner = "passthru"
   /device/000:27.1/

- Delete these lines, there is two lines for one VMDirectPath enabled device.
- Save this file on Desktop and close editor
- Replace the old config, compact the new local.tgz through these commands
Code:
    sudo rm /etc/vmware/esx.conf
    sudo cp esx.conf /home/ubuntu/Desktop/etc/vmware/esx.conf
    sudo rm local.tgz
    sudo tar czf local.tgz etc

- If the new tgz as been made without error, replace local.tgz on Hypervisor1 partition with the new one on Desktop.
- Reboot ESXi
- Now, you are root, a read-write root 8-)


Does it work for you ?


(VMware ESXi 4.1 / Ubuntu 10.10 x86)


Tue Dec 07, 2010 1:16 am
Profile
Site Admin

Joined: Mon Mar 16, 2009 10:13 pm
Posts: 3880
Reply with quote
Post Re: Recover ESXi if USB boot device is VMDirectPath enabled
I haven't tried this, but it's a slick method. I had posted something similar here - http://www.vm-help.com/esx40i/VMDirectP ... issues.php but using a VM saves a reboot. Nice job.

_________________
Dave Mishchenko
VMware vExpert 2009-2013
Image
Now available - VMware ESXi: Planning, Implementation, and Security
Also available - vSphere Quick Start Guide


Tue Dec 07, 2010 11:29 pm
Profile

Joined: Mon Dec 06, 2010 4:04 pm
Posts: 3
Reply with quote
Post Re: Recover ESXi if USB boot device is VMDirectPath enabled
Thank you.
During troubleshooting, I have read your interesting post. It gave me a lot of usefull information.


Wed Dec 08, 2010 4:22 am
Profile

Joined: Tue Oct 11, 2011 2:06 pm
Posts: 2
Reply with quote
Post Re: Recover ESXi if USB boot device is VMDirectPath enabled
I just made this mistake. I was able to boot a Ubuntu CD and mount the USB partition with the local.tgz file but it appears empty as does the oem.tgz file. Any thoughts?

I'm trying to FIX it to learn rather than just reinstall. Besides, I don't want to reconfigure all the switches again :roll:

Thanks for any help. This website is a great help and wonderful learning place.


Tue Oct 11, 2011 2:10 pm
Profile

Joined: Tue Oct 11, 2011 2:06 pm
Posts: 2
Reply with quote
Post Re: Recover ESXi if USB boot device is VMDirectPath enabled
The idea behind this worked great for me. My "empty" file was because the first tar command was incorrect. I didn't really pay attention. Once I was able to successfully extract the file and modified it then the next tar command worked fine.

I used a Ubuntu CD and booted up into it. I did my changes and then copied the modified files off to a different USB memory stick as well.

This will teach me to just enable things without thoroughly understanding them. :roll:

Thanks again for all the good information.


Tue Oct 11, 2011 9:18 pm
Profile

Joined: Mon Dec 06, 2010 4:04 pm
Posts: 3
Reply with quote
Post Re: Recover ESXi if USB boot device is VMDirectPath enabled
Thanks for feedback ! :ugeek:


Wed Oct 12, 2011 11:59 am
Profile

Joined: Sun Nov 18, 2012 9:50 am
Posts: 1
Reply with quote
Post Re: Recover ESXi if USB boot device is VMDirectPath enabled
This looked like a great write up, but unfortunatly in ESXi 5 there appeared to be no local.tgz file.

It's almost cretain that I had caused the problem by accidentally setting the USB Boot device for passthough on the host.

However it's pretty hard to know which is the correct device to enable for passthough from the information given in Vspheare, so it's a pretty risky option to try to enable.

On Rebooting I got 'two file systems with same uuid have been detected' which I could bypass as a one of using Shift + O then entering "overrideDuplicateImageDetection" but could not dig myself out of this hole without doing a Host Reinstall.


Sun Nov 18, 2012 9:58 am
Profile
Site Admin

Joined: Mon Mar 16, 2009 10:13 pm
Posts: 3880
Reply with quote
Post Re: Recover ESXi if USB boot device is VMDirectPath enabled
eddyhartley wrote:
This looked like a great write up, but unfortunatly in ESXi 5 there appeared to be no local.tgz file.


You'd want to change state.tgz. In the past ESXi would use local.tgz on flash devices and state.tgz on hd installs.

_________________
Dave Mishchenko
VMware vExpert 2009-2013
Image
Now available - VMware ESXi: Planning, Implementation, and Security
Also available - vSphere Quick Start Guide


Tue Nov 20, 2012 10:18 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.