Tuesday, March 27, 2012

How to get Windows/Linux Dell Servers Service tag details remotely

When you don’t have physical access to the server, you can get the same information remotely from the OS level. Using Windows or Linux command line you can easily get DELL service tag as explained below.

1. Get DELL Service Tag on remote Windows system

Login to the Windows remote-host using VNC or remote desktop connection. Use WMIC on Windows to get service tag as shown below.

C:\>wmic bios get serialnumber
SerialNumber
XYZDEF1

Following WMIC command will give make and model number along with service tag.

C:\>wmic csproduct get vendor,name,identifyingnumber
IdentifyingNumber    Name                Vendor
ABCDEF1              PowerEdge 2950      Dell Inc.

If VNC or remote desktop connection to the remote-host is not available,  execute the following from the local-host to get the service tag of the remote-host.

C:\>wmic /user:administrator /node:remote-host bios get serialnumber
SerialNumber
XYZDEF1

[Note: Replace remote-host with the machine name of your remote-host.]

2. Get DELL Service Tag on remote Linux system

Login to the Linux remote-host using SSH. Use dmidecode on Linux to get service tag as shown below.

 [remote-host]# dmidecode -s system-serial-number
XYZDEF1

Saturday, March 17, 2012

How to Control ESXi virtual machine from a command line

Console to ESXi Server and make sure SSH is enabled on the ESXi

1) At the console of the ESXi host, press ALT-F1 to access the console window.
2) Enter unsupported in the console and then press Enter. You will not see the text you type in.
3) If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.
4) You should then see the prompt of ~ #. Edit the file inetd.conf (enter the command vi /etc/inetd.conf).
5) Find the line that begins with #ssh and remove the #. Then save the file. If you’re new to using vi, then move the cursor down to #ssh line and then press the Insert key. Move the cursor over one space and then hit backspace to delete the #. Then press ESC and type in :wq to save the file and exit vi. If you make a mistake, you can press the ESC key and then type it :q! to quit vi without saving the file.
6) Once you’ve closed the vi editor, run the command /sbin/services.sh restart to restart the management services. You’ll now be able to connect to the ESXi host with a SSH client.

Then SSH to the host using Putty

The basic command to control the virtual machines is

vim-cmd vmsvc/

To manage a virtual machine you need get its ID, run:

vim-cmd vmsvc/getallvms

To get a summary of the machine run:

vim-cmd vmsvc/get.summary [ID]

To power on a VM run:

vim-cmd vmsvc/power.on [ID]

To power off a VM run

vim-cmd vmsvc/power.off [ID]

To suspend a VM run

vim-cmd vmsvc/power.suspend [ID]