Apr
30
2008
0

HowTo – generate diagnostic logs for vmware esx from cli

While working with vmware support on the phone they required me to run a job from Virtual center to gather diagnostic log data from our VI3 cluster.  You can try this by opening your, “Virtual Infrastructure Client” and selecting the “Administration” menu and then “Export Diagnostic Data”.  When I run this command for as little or much information required I ALWAYS get the following error, “Failed to create diagnostic bundle.”

If you ssh to your host directly you can run the following command from each host and sftp the logs from the host afterwards.

vm-support

Written by Tom Tags: , , , , , , ,
Apr
30
2008
2

HowTo – Windows shutdown GUI and remote shutdown capabilities

From a windows command prompt you can get a shutdown gui.  This is cool because you can use it to execute remote shutdowns with ease and not have to remember all the flags.

start->run->  cmd

c:\shutdown.exe -i

The gui should be launched.  I find it handy when a server is supposed to reboot and gets “stuck”.  Some windows servers just don’t shutdown cleanly and hang on the process.  If you execute another remote shutdown command you can force the server out of the endless shutdown, and save yourself from a drive into the server room.

Written by Tom Tags: , , , , ,
Aug
15
2007
0

HowTo – extend a vm vmdk with vmware server or vmware workstation

On your vmware host run the following command from your windows host command prompt:

C:\path to vmware\vmware-vdiskmanager –x 50Gb windows.vmdk  (where windows.vmdk is the vmdk to expand)

Now boot your VM, login and run the following commands from within the vm to expand your new vmdk

1)diskpart.exe
2)list disk
3)list volume
4)select volume=#   (where # = the volume you need to expand)
5)extend

Written by Tom Tags: , ,
Aug
02
2007
5

HowTo – vmware esx and ntp configuration

I stole the below information from vmtn.net to assist in my ntp configuration with vmware vi3 esx and windows guest o/s vm’s.

http://www.vmware.com/community/message.jspa?messageID=577447

Once you SSH to the ESX server console and logon as root you need to edit the file /etc/ntp.conf. There are a few editors you can use. I prefer the nano editor.

From the command prompt type “nano /etc/ntp.conf”
Scroll down until you see the lines that read.

server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10

Just below this section add these lines.

restrict 192.168.11.5 mask 255.255.255.255 nomodify notrap noquery
server 192.168.11.5

Replace 192.168.11.5 with the IP address of your ntp server.

That is all that needs to be done in /etc/ntp.conf.
Exit the editor with a ctrl-x, Y to save changes, enter to confirm the filename. You should now be back at the command shell.

Next Step…
type in “nano /etc/ntp/step-tickers”
There should only be one line 192.168.11.5 (replace with the IP of your NTP server)
Exit the editer the same way as above.

Final Steps….
Type in all these commands in order.

esxcfg-firewall enableService ntpClient
service ntpd restart
chkconfig level 345 ntpd on
ntpdate -q 192.168.11.5
hwclock systohc

guest o/s and what to do with time sync:

What tool should I use to synchronize a Windows guest operating system with real time? Does the Windows Time service work in a virtual machine?
Solution

The most accurate way to keep guest operating system time synchronized with real time is to use the VMware Tools time synchronization function. You should not use the Windows Time service or other form of clock synchronization meant for physical machines to set the time in the guest operating system. Unlike a physical machine, a virtual machine is not always loaded and running on a CPU. A virtual machine’s clock can’t run when the virtual machine is not running. When the virtual machine gets to run on a CPU again, the virtual machine’s clock needs to catch up to real time. The Windows Time service attempts to synchronize the virtual clock to an external time source on the network; it is not aware of the unusual clock behavior of a virtual machine, however, so it does not synchronize accurately. In some cases, the Windows Time service can do more harm than good. The VMware Tools time synchronization feature is aware of the built-in clock catch-up function in a virtual machine and can accurately synchronize the guest’s clock to the host’s clock. To enable VMware Tools time synchronization in the guest:

1. Right-click the VMware icon in the System tray on the task bar and choose Open VMware Tools.
2. On the Options tab, check the Time synchronization between the virtual machine and the host operating system box.
3. Click OK to close the dialog box.

You can disable the Windows Time service from the Services control panel in the guest.

1. Right-click My Computer and choose Manage.
2. Double-click Services and Applications.
3. Double-click Services.
4. Scroll to Windows Time; right-click and choose Properties.
5. Click the Startup type selection box and choose Disable.
6. If the service status is Started, click Stop.
7. Click OK to close the Properties dialog box.

It’s a good idea to run a time synchronization tool on the host, for best accuracy. On Windows hosts, you can use the Windows Time service or other tool of your choice. On Linux hosts and in the ESX Server service console, you can run NTP. To install and configure NTP on an ESX Server machine, refer to www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1339.

When You Must Run Windows Time Service
If you use a virtual machine as a primary domain controller for a Windows network, the primary domain controller must run the Windows Time service as a time server, to provide time to secondary domain controllers and other hosts on the network. However, that primary domain controller does not need to use the Windows Time service as a client to receive time synchronization input for its own clock. You can still use VMware Tools to synchronize the virtual machine’s clock while running the Windows Time service in a server-only mode. For instructions on setting up the Windows Time service this way, see the Microsoft document titled “The Windows Time Service,” at download.microsoft.com/download/2/0/f/20f61625-7b2a-4531-b007-1c714f1e51b7/wintimeserv.doc. Search the document for the NoSync registry option.

Written by Tom Tags: , , , , ,
Aug
02
2007
0

HowTo – vmware esx and rolling out new esx into ha cluster

update the following file on your new esx server with the hostname of the new server

/etc/hosts

restart the following service:

service mgmt-vmware restart

Written by Tom Tags: , , , , , ,
Jun
06
2007
0

HowTo – esx update query – determine patches installed to esx

Command To Query currently Installed VI3 patches
esxupdate -l query

Written by Tom Tags: , , , ,
Jun
06
2007
0

HowTo – query for orphaned vm’s

Query orphaned VM’s
find -iname “*-flat.vmdk” -mtime +7 -ls

you could identify vmdk files older then 7 days that have not been modified and are either off or orphaned.

or

find -iname “*-delta.vmdk” -mtime +7 -ls

to find old snapshots

Written by Tom Tags: , , , ,

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes