How to Mount a USB Drive as an ESXi Datastore

Seagate Backup Plus Portable Drive
Seagate Backup Plus Portable Drive

Recently, I have upgraded my homelab – yet again. There will be an oncoming post about the hardware I chose and how it is set up. This time, my lab is mobile. I can take it with me on the road or leave it at home.
One of the features that I wanted to be able to capture and utilize was VMware Data Protection (vDP) to backup my Infrastructure and Important VMs. However, there was a small hurdle that I needed to overcome – storage – and how do I make it mobile. VDP requires – at minimum, a 2TB datastore for backup storage. Normally, you would utilize your storage array and carve out some space for the backups; I wanted to see if I could do something different – something radical. I wanted to use my USB3 USB drive.
Continue reading “How to Mount a USB Drive as an ESXi Datastore”

vusb seen as an available network adapter?

Recently, I had to install ESXi 4.1 on an IBM x3850 X5. Once the install was completed and I started configuring the host, I noticed something odd. I had a new vswitch and a network adapter that was defined as vusb0.

vusb0

WTF? At first, I thought I was imagining things. I opened the network adapters view, and sure enough there it was. I thought how could this be. Of course, I’ve never seen this before, so a little googling was in order. Lo and behold, I found this little jewel (VMware Forum Post: “Extra NICs showing up as vusb?”).
Continue reading “vusb seen as an available network adapter?”

Fixing Renumbered vmnics

I’ve been in a situation where I’ve installed a new NIC and it renumbered the vmnics within an ESX host. The reason this became an issue was that the Service Console vmnic was one of the vmnics that was affected. Thus I lost my access to the ESX host. Thankfully, I could just drive over to the Datacenter and fix it via the commandline. It was just inconvenient to do so. A quick google for instructions and I was off.

So apparently there are multiple ways to fix this. For me, Method 1 got me up and running within a few minutes with little to no fuss.

Method 1 – Editing the esx.conf file
• Login to the Service Console
• Check your existing NIC numbering by typing ‘esxcfg-nics –l
• Type ‘cd /etc/vmware’ to change to the correct directory
• Type ‘cp esx.conf esx.con.bak’ to make a backup of this file as it is a critical configuration file for ESX
• Type ‘nano esx.conf’ to open the file for editing
• Type CTRL-W and then enter ‘vmnic2’ to search for the new first NIC
• Change ‘vmnic2’ to ‘vmnic0
• Change the subsequent NIC’s from ‘vmnic3’ to ‘vmnic1’, ‘vmnic4’ to ‘vmnic2’ and ‘vmnic5’ to ‘vmnic3
• Type CTRL-O to save the file
• Type CTRL-X to exit the Nano editor
• Type esxcfg-boot -b to rebuild the config files
• Shutdown and restart the ESX server, when the server comes back up the NIC’s will be numbered vmnic0 – vmnic3, verify this by typing ‘esxcfg-nics –l

Method 2 – Modify your vswitch configuration
• Login to the Service Console
• Check your existing NIC numbering by typing ‘esxcfg-nics –l
• Check your current vswitch configuration by typing ‘esxcfg-vswitch –l’ , note which NIC’s are assigned to which vswitches (uplink column)
• Remove the old NIC’s that have been renamed by typing ‘esxcfg-vswitch –U vmnic# vswitch_name’, ie. esxcfg-vswitch –U vmnic0 vSwitch1
• Add the new NIC’s with the correct names by typing ‘esxcfg-vswitch –L vmnic# vswitch_name’, ie. esxcfg-vswitch –L vmnic2 vSwitch1
• Repeat this process for any additional NIC’s. Once you have the vswitch that contains the Service Console corrected you can also log in via the VI Client and correct the other vswitches that way
• Your newly renamed NIC’s should now be assigned to the original vswitches and your networking should now work again

This information was found within the VMware Knowledge Base. (Awesome!)
How To Configure Networking from the Service Console Command Line
VI Client loses connectivity to the ESX Server Host after you add a new network adapter

Stopping an Unresponsive VM

Sometimes a Virtual Machine can’t be stopped via the VIClient. The job just hangs. There are a number of options to stop your Virtual Machine from within the Service Console. Keep in mind that these are last resort options!

Stopping the virtual machine by issuing the command:
vmware-cmd /vmfs/volumes/datastorename/vmname/vmname.vmx stop
This must be done on the ESX host where the Virtual Machine is running!

If this does not work, one can issue the following command:
vmware-cmd /vmfs/volumes/datastorename/vmname/vmname.vmx stop hard
This will try to kill the Virtual Machine instantly.

A final solution is to kill the PID (process ID). Issue the following command:
ps auxfww | grep vmname
to locate the correct PID (BTW: this cannot be done via ESXTOP). The first number to appear in the output is your PID.
The PID can be used to terminate the process by issuing the command:
kill -9 PID.