Welcome to the blog of mechanised.com

This blog is mainly a technical repository of information on Virtualisation tools and management for our hosting service.

Also for HP's Bladesystem that we use at both our datacentres.

Other articles are also included on .Net development and MS SQL Server as well as other interesting things we come across.

Tuesday 29 July 2008

Get full control over your ESXi Server

How to get command line access and SSH running, just need a nice OS tool to manage all these ESXi instances!

Also here are the commands to get SNMP enabled via RCLI.

C:\Program Files (x86)\VMware\VMware VI Remote CLI\bin>perl vicfg-snmp.pl --server yourserverip -c public -p 5567 -t trapserverip@162/public
Enter username: root
Enter password:
Changing udp port to 5567...
Complete.
Changing community list to: public...
Complete.
Changing notification(trap) targets list to:
trapserverip@162/public...
Complete.

C:\Program Files (x86)\VMware\VMware VI Remote CLI\bin>perl vicfg-snmp.pl --server
yourserverip -E
Enter username: root
Enter password:
Enabling agent...
Complete.

C:\Program Files (x86)\VMware\VMware VI Remote CLI\bin>perl vicfg-snmp.pl --server
yourserverip -s
Enter username: root
Enter password:
Current SNMP agent settings:
Enabled : 1
UDP port : 5567

Communities :
public

Notification targets :
trapserverip@41472/public

C:\Program Files (x86)\VMware\VMware VI Remote CLI\bin>perl vicfg-snmp.pl --server
yourserverip -T
Enter username: root
Enter password:
Sending test nofication(trap) to all configured targets...
Complete. Check with each target to see if trap was received.

ESXi 3.5 does ship with the ability to run SSH, but this is disabled by default (and is not supported). If you just need to access the console of ESXi, then you only need to perform steps 1 - 3.

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 x key. Type in :wq to save the file and exit vi. If you make a mistake, you can press the ESC key and then type :q! to quit vi without saving the file.
6) Run ps | grep inetd to determine the process ID for the inetd process. The output of the command will be something like 1299 1299 busybox inetd, and the process ID is 1299. Then run kill -HUP (kill -HUP 1299 in this example) and you'll then be able to access the host via SSH.

No comments: