Monday, 30 April 2012

vMA - Time Zone configuration

Problem

There is a little used vMA server in our environment which needed to be used - when I got on it I found that the timezone was set to PDT.....

Since the work I wanted to do was to do with Syslog and AD having the right time would be critical!

Solution

I found a useful article after a bit of Googling and reading of the vSphere Management Assistant Guide which helped me: http://xtravirt.com/using-vma-your-esxi-syslog-server the article was written by Simon Long and obviously he deserves all the credit and not me!!

If the article ever disappears I'll just go over the bits I used:

1. Adding of the sites NTP server(s).
sudo nano /etc/ntp.conf

(I added the entries under #use the public servers from the...... )

2. Remove the local time file
sudo rm /etc/localtime

3. Replace the local time file with the correct one for your timezone
sudo ln -s /usr/share/zoneinfo/UTC /etc/localtime

4. Turn the NTP daemon on
sudo /sbin/chkconfig ntpd on

5. Restart the ntpd service to pick up the "new time"
sudo /sbin/service ntpd restart

6. Checking that your time server configuration has taken
sudo ntpq -p

7. Changing the keyboard from US to EN
sudo vi /etc/sysconfig/keyboard

Change the KEYTABLES entry from "us" to "en"

NOTE: I need to check whether UTC is good enough for our needs and if not I'll be amending the blog with what I actually used - Again, thanks to Simon for such a great article :-)

ESXi - Configuring SNMP

Background

We had to configure our ESXi Hosts so they were being reported on in SCOM. This blog covers the steps I did to get there.......

Step 1: Configure SNMP on our ESXi hosts.
Step 2: Configure the ESXi hosts to point t the Syslog server.

Tools: VMware vSphere CLI & VI Client

Step 1

1. Check the current SNMP configuration
 C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl --server <hostname or IP> --show
 (you will be prompted for the username and password)

Current SNMP agent settings:
Enabled  : 1
UDP port : 161
Communities :
Notification targets :
10.10.10.10@162/public

2. Configure SNMP
C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl -server <hostname or IP> -c <community string> -t <target server>@162/<community string>
 (you will be prompted for the username and password)

Changing community list to: <community string>...
Complete.
Changing notification(trap) targets list to: <target server>@162/<community string>...
Complete.

3. Recheck SNMP configuration
C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl --server <hostname or IP> --show
(you will be prompted for the username and password)

Current SNMP agent settings:
Enabled  : 1
UDP port : 161
Communities :
<community string>
Notification targets :
<target server>@162/<community string>

4. Enable SNMP agent
C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl --server <hostname or IP> --enable
(you will be prompted for the username and password)

Enabling agent...
Complete.

5. Test SNMP
C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl --server <hostname or IP> --T
(you will be prompted for the username and password)

Sending test nofication(trap) to all configured targets...
Complete. Check with each target to see if trap was received.

NOTE: While configuring one of the hosts I kept getting error messages. I deleted the snmp.xl file (/etc/vmware) and restarted the services (services.sh) and a new snmp.xml file appeared - I then repeated tasks 1-5 with no problem.
The host wasn't running any VMs when I restarted the services - if I can, I only do host work when it is clear of VMs just in case......

Step 2


1. Open up a VI Client session (either to the Virtual Center or direct to the Host) - I'm connecting to the Host via the Virtual Center.

2. Go to Home > Inventory > Hosts and Clusters

3. Click on the Host you want then go to the Configuration tab - Software > Advanced Settings > Syslog > Remote.

4. Type in the Hosts name into the Syslog.Remote.Hostname box of the Syslog server.

Get the SCOM Admin to check for incoming data.....

Tuesday, 27 March 2012

Solaris - Configuring link-based IPMP

When the new Solaris servers turned up at my place of work we didn't have anyone trained on Solaris to install the OS and configure the machines - so as part of the deal we paid for a number of contractors to come in and complete this work. One of the tasks I wanted them to do was to configure resilient network connections 2 x 1Gbe LAN and 2 x 10Gbe Storage LAN on most servers.

The lead Engineer then started talking about IPMP.
According to the speil from the manufacturer it does the following:
  1. Eliminates a single network adapter as a single point of failure in the the following cases
    1. Network adapter failure
    2. Network link failure
  2. It enables interfaces to fail over within approximately 10 seconds (default configuration) - value can be adjusted in the /etc/default/mpathd file.
  3. It can be configured for use with both IPv4 and IPv6.
  4. It enables interfaces to be configured as standby interfaces.
There are two different ways of configuring IPMP:
  • probe-based - utilises test addresses to monitor the health of the interfaces.
  • link-based - the interface kernel driver utilises "Link Up"/"Link Down" status of the interface to monitor interface state of health.

Prep Work

1. View the /etc/hosts file - edit if necessary
2. View the /etc/netmasks file - edit if necessary

NOTE: I've put this step in as you may have two sets of IPMP to setup (which I have) which will require adding additional IP addess and subnet mask.

By following these steps you can setup link-based IPMP with 2 interfaces.

1. Discover network interfaces

Run dladm show-link



(A type of non-vlan or vlan indicates that the hardware is GLDv3 compliant hardware).

For this example I'll be using bge0 and bge2 as the IPMP pairing.

2. Hostname files

Create, or amend, the appropriately named hostname files, add the text listed below (ipmp0 is the IPMP unique group name).
  • Check that files exist
   ls -al /etc | grep host
  • If they don't create them
   touch /etc/hostname.bge2
  • vi /etc/hostname.bge0
   <hostname> netmask + broadcast + group ipmp0 up
  • vi /etc/hostname.bge2
   group ipmp0 up

3. Bringing the cards up
  • ifconfig bge0 plumb
  • ifconfig bge2 plumb
  • ifconfig bge0 `cat /etc/hostname.bge0` up
  • ifconfig bge2 `cat /etc/hostname.bge2` up
4. Test the configuration

Bring the primary NIC down (bge0) to check the IPMP configuration.

From a console session run and leave it running:
tail -f /var/adm/messages

From a second console run the command below which will disable bge0:
if_mpadm -d bge0

In the console session running the message log output you should have an entry stating a successful fail over has occurred.

Run the following from the 2nd console to enable bge0:
if_mpadm -r bge0

Looking back at the message log console another entry should appear stating that the IPMP setting has failed back to bge0 - CTRL & C to exit

5. Complete

Configuration is now complete

Monday, 26 March 2012

Solaris 10 Admin PDFs site

A useful docs site which Oracle have moved over from Sun which covers a lot of Solaris 10 Admin PDFs

http://docs.oracle.com/cd/E19253-01/

Thursday, 15 March 2012

XSCF

Useful commnds for setting up the XSCF

Create new user:
adduser <user name>

Set password:
password <username>

Set the privileges to the accoutn you've just created (in this case an Admin account):
setprivileges <user account> useradm mode platadm fieldeng auditadm

Show user accounts:
showuser -l

Set NTP and check time:
Show current timezone:
showtimezone -c tz

Configure timezone:
settimezone -c settz -s Europe/London

Show current NTP setting:
showntp -l

Configure NTP:
setntp -c add <ip address>

Check time settings:
showdate

Domain sessions:
To check the domain status:
showdomainstatus -a

To start a Domain console session on Domain 0
console -d 0

To reset the Domain OS (which will reboot the OS!!!)
reset -d 0 por (there are other options apart from por)

To start up Domain 0:
poweron -d 0

To shutdown Domain 0:
poweroff -d 0

I found a number of useful sites while working on the XSCF, one of which is:
http://saifulaziz.com/2010/07/21/m-series-extended-system-control-facility-xscf-command-line-guide/

ILOM

Some useful commands I've gleaned while setting up a number of new T series SPARC boxes.

Create User account:
To create a new Administrator account: 
create /SP/users/<account name> role=administrator

To set the password:
set /SP/users/<account name> password

Show users:
show /SP/users

Set NTP settings:
Check settings:
show /SP/clock
(Check the Timezone is correct and the usentpserver=enabled)

To check to see if a NTP server has been assigned:
show /SP/clients/ntp/server/1

Set NTP server:
set /SP/clients/ntp/server/1 address=<ip address>

Set the clock so it uses the NTP server:
set /SP/clock/ usentpserver=enabled

Set timezone:
set /SP/clock timezone=Europe/London

Console - Solaris connection:
To boot the OS:
start /SYS

To make a console connection:
start /SP/console

To exit back into the ILOM from the console:
#.

If the console hangs - check to see if there are any existing console sessions
show /SP/sessions
Then disconnect the running console session:
stop /SP/console

Network settings:
Check configuration:
show /SP/network

I found a number of sites useful while going through the configuration of the ILOM, one of them was this site:
http://skullboxx.net/kb/node/482

A useful link to a Oracle cheat sheet

Wednesday, 14 March 2012

Solaris - Stopping/Starting services

At some point you may want to stop and start some services.

For example some kind soul started the Telnet service on one of Production servers and left it running - a big security no-no!!

To list all services:
svcs

To list the Telnet service:
svcs -l telnet

fmri         svc:/network/telnet:default
name         Telnet server
enabled      true
state        online
next_state   none
state_time   28 September 2011 14:08:15 BST
restarter    svc:/network/inetd:default
contract_id



To disable the telnet service:
svcadm disable telnet

To enable the telnet service:
svcadm -v enable -r telnet