Thursday, November 29, 2012

Bring ESX host out of maintenance mode without vCenter

I had a downtime recently that we were moving very old hardware running VMware ESX 3.5.  After the move the vCenter server would not start up, it wouldn't even boot!  The worst part is the hosts were in maintenance mode and wouldn't manually allow me to start the guests from the command line!  

The command to exit maintenance mode also failed:
vimsh -n -e /hostsvc/maintenance_mode_exit

So I knew this being based off of linux that there had to be a conf. file of some sort somewhere that told the host that it was in maintenance mode or not.  I found it here:
/etc/vmware/hostd/hostsvc.xml

This is what the code should look like:

  mode normal mode 






 B
y editing the file and changing the word maintenance to normal and rebooting the host I was then able to issue the command to start the vm:

vmware-cmd vm_guest.vmx start

It worked!

Error message when you try to set an IP address on a network adapter

Recently I have done some P2V and V2V migrations with the guests being windows 2003 and above and I get an error message when I go to IP the new nic's about there being a "hidden" nic with the same IP address.  I followed this KB and it did work.  In short here are the steps that I did:

Method 1

  1. Click Start, click Run, type cmd.exe, and then press ENTER.
  2. Type set devmgr_show_nonpresent_devices=1, and then press ENTER.
  3. Type Start DEVMGMT.MSC, and then press ENTER.
  4. Click View, and then click Show Hidden Devices.
  5. Expand the Network Adapters tree.
  6. Right-click the dimmed network adapter, and then click Uninstall.

Monday, October 15, 2012

create a .img file (floppy disk image)

I needed to mount a floppy disk image in a guest virtual machine onVMware ESXi.  It's been so long since I have needed one of those I had to use my googlefu.

I ran across a blog post from untitledfinale that did the trick.  Here is the code that I used:

dd bs=512 count=2880 if=/dev/zero of=imagefile.img
mkfs.msdos imagefile.img
sudo mkdir /media/floppy1/
sudo mount -o loop imagefile.img /media/floppy1/

Worked like a charm, but there was one problem.  vSphere4 wants to mount a .flp not a .img for a floppy image.  No worries just rename it to .flp and your good to go!







Tuesday, June 26, 2012

Get Evolution to work with Exchange 2010

I have been dying to have a fully functional email client for my linux machine that would work with our corporate Exchange 2010 environment.  Looks like its now possible with the evolution-mapi plugin.  I found these instructions and they worked flawlessly on my Mint 12 box! 

One less thing to rely on a windows machine!!!

Tuesday, June 5, 2012

Execute when any user logs in without Group Policies

Sometimes you just need to have something run for all users that log into a certain box but you don't want a GPO for it.  Local group policies don't work either if they log in with AD credentials.  It used to be that you could just put the .exe or .bat/.vbs into the startup directory. You still can but its a little harder with w2k8/w7.

The easiest way is to click start, all programs, then right click on startup and choose explore all users.  Then just drop a link or the file into that directory and you should be right as rain.  Here is the long UNC for it:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup


Putting a file on all users desktop in Win 7/Server 2008

Just put the file in c:\users\Public\Public Desktop and everyone on that box will get it on their desktop.  Only users with Admin level privileges can delete it!

How to create a .exe from a .bat file

I have known for a long time about iexpress.exe and had played around with it back when vista came out.  I could never really get it to work correctly though until I found this blog post.

So the long and the short of this are go through the wizard its pretty self explanatory but when you get to "Install program to launch" screen use this for the top input line of "install program".  In the field enter this cmd /c batch_file.bat.

Then just go through the rest of the wizard!  I have tested this on server 2008 R2 and it worked perfectly!  BTW just search for iexpress.exe if you need to find it.




Tuesday, May 15, 2012

Creating a vCenter alert for newly created VM's

If your like me and you want to know when a VM is created so as to try and curb virtual server sprawl then you should setup a custom alert to let you know when a new VM is created.

I actually want to know if a VM is either created or deployed as either will take up resources and managing resources in a virtual environment is key.  I did a fair amount of googleing but didn't run across anything that was pertinent.  I did however come up with this and its so simple.

VCenter actually already has the alerts pre-canned for you in either ESXi 4.1 or 5.   Follow these steps:

  1. Create a new alarm
  2. General settings should be monitor virtual machines
    1. Check radio button for Monitor for specific events
  3. On the triggers tab
    1. Add event for Deploying VM
    2. Add event for Creating VM
  4. On the Actions Tab
    1. Send a notification email
    2. Enter email address
    3. Alert once for green to yellow
    4. Alert once for yellow to green
Thats it!  Now you will have a big brother iron grip on newly created VM's!

Monday, May 14, 2012

Physical Network Card Failures on HP DL580

We were experiencing network failures on HP DL580 and DL980 servers.  This was happening across all OS's but it was very noticeable on our ESXi infrastructure.  After many hours of grepping logs I found a line that stated firmware hang and card reboot!

We swapped out the 365i and 365T cards for 375T and replaced the 365i with next gen 365i cards and things are much better!

Hard lesson but from now on I will never run the same vendor for both internal and PCI network cards!

Monday, April 16, 2012

vCenter host connections disconnect and reconnects every 73 minutes

This was a very strange issue.  vCenter would disconnect to all hosts causing the Host connection alert to activate.  Just as quickly it would reconnect and everything would be fine.  Unless your HA was configured!  After contacting VMware support to no avail I finally figured it out.  TIME!  The time that the server that ran vCenter and the hardware clocks on the hosts was set to one source but vCenter was setting the hosts inside VMware to another time source.  They were not the same time.  This caused vCenter to restart its service to sync to the new time every 73 minutes.  Basically the disconnect and reconnect was as fast as restarting the server service and it occurred exactly every 73 minutes!

I need a beer!!!!!!!

Install packages in ESXi 5

esxcli software vib install -v /path_to_file.vib

Install offline bundle in ESXi 4.1

esxupdate --bundle=bundle_name.zip update

List firmware/driver in esxi 4.1

ethtool -i vmnic0

Wednesday, January 11, 2012

Show date/time with history command in Linux

Run this command:

export HISTTIMEFORMAT="%F %T "
Then view history as usual:

 history
your output will look something like this:
2012-01-11 15:49:00 ps -A | grep firefox